The a/c must be able to freely ventilate on both sides to work.
On the cold side, make sure we don't have anything stacked in front of the register or fins, by at least 2 feet, ideally more. We need to allow sufficient space for the air to circulate throughout the room. Also, if there is anything too close, it can cause the cold air to ricochet back into the fins and cause an ice up.
On the hot side, we need to allow at least a two feet above and to the sides of the a/c for the heat to exhaust. We want to have at least 5 ft back. If we box in the unit it will overheat and cause the compressor to break down.
If you have a very thick wall, you can make the front of the a/c flush with the wall if that helps add a few extra inches more ventilation in the back.
If that is still not sufficient, then carve away the area around the backside so the vents are exposed, leaving at least 6 inches open on the top and sides.
**These are all just minimums from our experience that work. For the best working results, follow the a/c manufacturers guide lines for installation. Every owners manual shows a minimal set back for the back and sides, top and bottom of the back of the unit.