The mezuzah is supposed to be placed on the right side of the entrance when going into the house. Yet I have seen a number of people who place the mezuzah of their door going to the deck in the back of their house on the right side of the exit leaving the house. Since the deck does not have a roof it is not considered a room and therefore should not require a mezuzah going into it. Only the house is required to have a mezuzah so shouldn't the mezuzah be on the right side going in?
If the deck is enclosed, meaning that it doesn’t serve as an alternative entrance to the house, then the mezuzah should be placed on the right of the door as one leaves onto the deck. If the deck serves as an alternative entrance into the house, the mezuzah should be placed on the right side coming into the house.
Sources: See Taz, Yoreh De’ah 289:4; Chazon Ish 169:2; the common custom is as mentioned in the answer, following the ruling of the Chazon Ish only when the deck (balcony) serves as an entrance.
The explanation that I was given is that many decks do not have full (or normal) access from the yard. Even if they do, the normal access is from the house. As a result, people put the mezuzah on the right in the direction that the normal access uses (going out).
The question is, what is the deck considered. An enclosed deck means that he deck does not have a way of of going from the deck to the yard. Thus, it is the equivalent of entering a room with only one door into the rest of the house. In that case, the mezuzah goes on the right going from the room that is mainly used (the house) to the room that cannot be used for anything else (the deck). An unenclosed deck or a deck with stairs into the yard, is the equivalent of a porch, which is treated as part of the outside. As a result, it is treated as coming into the house from the outside. Thus, the mezuzah should be on the right as you enter the house.
Of course each house is different and needs to be checked. We have some beams in the middle of a room (along the ceiling and on one side) that required a mezuzah (as an example).
I discussed it with my LOR this shabbos and he said that if the deck does not have a set of stairs to the yard, then he would hold that it should have the mezuzah on the right going out. He also said that there are rabbonim who hold that it goes on the right coming in in any case. He needs to discuss it with some others to determine a final psak. We also have a door to the shul that is normally locked and only opened with a safety bar from the inside. The door is at the bottom of a ramp to the basement so that handicapped people (who have the key to the door) can use the ramp rather than the stairs (on the inside). Since people do have the key and use it, then the mezuzah is set going in. The shul also has an emergency door that can be opened only from the inside. The rav wants to put the mezuzah going out, but is going to discuss it with others first. He says that he does not understand why people would say that it should be put as if it were an entrance, but is going to study the matter further.
Note that I put in what my rav says in order to show the logic behind what different people do. Obviously, I cannot expect others to blindly accept this.
I found a reference to a machlokes on the matter which cited She'arim Metzuyanim Ba'Halacha 11:3
In modern times, HaGaon HaRav Moshe Feinstein zt"l (Igros Moshe ibid., 181) held that in completely enclosed balconies and yards the mezuza should be fixed on the right side of the doorway as you exit to your yard. The Chazon Ish zt"l (Yoreh De'ah 168:7) held the opposite - the mezuza should be fixed on the right side of the doorway as you enter your house.
Mezuzah.net found on a google search. Disclaimer I am not familiar with this site and am pointing to it only to show the logic being dicussed.
On which side of the doorway leading into the garden should a mezuzah be fixed (doors open from inside the house into the garden, not really possible to open them from the garden side, and not really possible to enter the garden other than from the house) – on the garden side or in the house on the right hand side?
Many thanks Polina
There are two views about which side to put the mezuzah on.
Here's the logic: The rule is that you put a mezuzah on the right, as you enter a room. Is an enclosed yard as a kind of "room"?
Opinion 1: An enclosed yard is like a room. So the mezuzah would go on the right as you enter the yard.
Opinion 2: An enclosed yard is not like a room, so it doesn't require a mezuzah. However, the room which leads to the yard does require one. So you would put the mezuzah on the right as you enter that "inside" room. In other words, it would go on the left as you enter the yard.
Conclusion: You can put it on either side.
Best wishes, Eliyahu