If you would like to lock your barn door from the outside you will need a different type of lock.
How to lock interior barn doors.
A hasp and a padlock definitely the easiest way to secure a barn door from the outside is a hasp and padlock.
I would suggest a hook and eye latch like this one.
Padlock option for double sliding barn doors.
Then fix the hasp to the door itself.
How to add a lock to a barn door handle cut out to begin we grabbed a piece of wood we literally have enough left lying around that it prevents most trips to the store these days.
Consider your room choice.
Get a hasp lock and fix the hook to the door frame with screws.
Being able to lock a barn door makes it a viable solution for any room in the house.
How to lock a sliding barn door from outside.
However the simplest as well as most cost effective method of locking your barn doors is using a hasp lock.
Interior and exterior barn doors cabin closet tips for selection if the barn door is in a room that sees a lot of family time such as a living room or common rooms go for locks that are good in design and functional at the same time.
Depending on the thickness of your sliding barn door you might need to add some sort of spacer between your eye latch and the wall.
Consider the type of barn door.
There are many kinds of locks that you can install on your door.
The simple answer is yes.
With this you have added a lock to your door.
Some barn door privacy locks are only on the inside of the door while others allow you to lock the sliding barn door from both sides.