Locking Doors is a custom feature unique to Loka. Having a locked door stops raiders from just walking into a town building. Only town members can open and close the locked doors in their town, unless they have been claimed by another player.
Locking and Unlocking
To lock, shift-click the door. You should hear an anvil sound and a green message at the bottom of your screen saying "Locked." To unlock, shift-click the door again, and the same thing should happen, but it should say "Unlocked" in red.
Trapdoors and Uses
This feature also works on trapdoors, and many players use them to cover chests. The door and trap door can be locked in any position (open or closed.) Be warned though, if you try to spam click a locked door without it opening and try to walk through, you can become glitched inside and suffocate.