I used this type with the long side up, worked like a charm. I screwed the roost onto the outer edge of the bracket to maximize space from wall. You just need to be sure you give them enough space from the wall and that the bracket can support the combined weight of roost and chickens. Mine is used by a couple of Sebrights, so that part was pretty easy for me.
View attachment 2858903
Just a word of caution on the brackets - I use them in my small integration coop but make sure all the extra screw holes are covered, I had a hen get her nail stuck in one & tear it off. We ended up covering the extra holes from the wall out to the 2x4 with a piece of furring strip because they insist on roosting on that part too.