When putting up a Mezuzah (or Mezuzos), place the Mezuzah in position on the wall, and partially knock the nails in. Then say the Brocho:
ברוך אתה ד' אלוקינו מלך העולם, אשר קדשנו במצותיו, וצונו לקבוע מזוזה
Immediately after the Brocho, complete knocking in the nails.
The following are some halachos regarding the Brocho on Mezuzah. (the list is far from complete)
For more Halachos, see the Sefer referenced below, find a different sefer on Hilchos Mezuzah, or ask your local Orthodox Rabbi.
Source: The Complete Mezuzah Guide