Instructions
Craft the items necessary for the procedure: an iron door, six pieces of redstone dust, a redstone torch, two pressure plates and two levers. An iron door requires six iron ingots, a torch requires a piece of redstone dust and a stick, a lever requires a stick and a block of stone, a pressure plate requires two pieces of stone, and redstone dust requires mining redstone ore.
Dig a 2-by-5 pit two blocks deep where you want to place your door. Place a block of your choice, such as stone or cobblestone, in the center space of the bottom row of the bottom layer of your pit.
Hold the redstone torch. Right-click on the side of the block to place the torch so that the torch occupies the center block of the top row of the bottom layer of your pit.
Fill the rest of the bottom row of the bottom layer with redstone dust. Place redstone dust in the first and last square of the top row of the bottom layer. This dust turns into redstone wire when placed, and the close proximity to the torch allows it to be powered to function like electricity.
Fill the entire top layer of your pit with a block of your choice. The top layer is necessary to place your pressure plates and door, and this method allows you to hide all of the wiring.
Place a pressure plate on the first and last squares of the top row of your now-enclosed pit. These plates are what will open your door; you do not need to manually open your door each time.
Place the door in the center square of the top row of your pit. If placed properly, it will appear open. Step on and then off one of the pressure plates to close the door.
Place a block of your choice in the center square of the bottom row of your pit. This should be adjacent to your now-closed door.
Hold the levers in your hand and right-click either side of the block next to the door. These should face parallel to the door, and they are what act as your lock.
Right-click one of the levers to lock the door. Even if you walk around the other side and flip the lever, the door will not unlock until you flip the original switch to the unlock position.