Locate a spot for your burglar alarm door sensor. Ideally, it should be high up on the door and on the opposite side from the hinges. If your door alarm sensor is mounted with screws, pick a spot on the jamb where it won't interfere with the door opening and closing. The same holds true with a corresponding spot for the magnet on the interior side of the door. If you need to insert it directly into the door, pick a spot in the door jamb interior, facing the door directly. Mark the location with a pencil so you can refer back to it later.
Drill fitted holes into the spots if you're inserting the alarm sensor into the door (your instruction manual should tell you what size drill bit to use) or screw the mounting plates into position if you're mounting the alarm sensor on the surface. Give it a tug to ensure that it's firmly mounted or that the holes are the right size.
Run wiring from the door alarm sensor to the central security box in order to link it up with the remainder of the alarm system. In many cases this may not be necessary---wireless alarms use radio signals and some door alarm units are completely self-contained---but if it is, you want to connect the wires before you mount the alarm. Most alarms will have designated slots for the wires, along with screws which you can tighten to hold the wires in position.
Fit the door alarm sensor into position in its mounting plate, making sure it's flush with the door frame.
Mount the magnet into the door itself, either by inserting it into the hole you have drilled or screwing it into position. When the door is closed, it should line up perfectly with the alarm sensor on the jamb.
Turn on the burglar alarm system and test the door sensor to make sure it works.