Background Laying hens with access to outdoor ranges are exposed to additional environmental factors and microorganisms, including potential pathogens. Differences in composition of the cloacal microbial community between indoor- and outdoor-housed layers may serve as an indicator for exposure to the outdoor environment, including its pathogens, and may yield insights into factors affecting the chickens’ microbiota community dynamics. However, little is known about the influence of outdoor housing on microbiota community composition in commercial layer flocks. We performed a cross-sectional field study to evaluate differences in the cloacal microbiota of indoor- vs outdoor-layers across farms. Eight layer flocks (four indoor, four outdoor) from five commercial poultry farms were sampled. Indoor and outdoor flocks with the same rearing flock of origin, age, and breed were selected. In each flock, cloacal swabs were taken from ten layers, and microbiota were analysed with 16S rRNA gene amplicon sequencing. Results Housing type (indoor vs outdoor), rearing farm, farm and poultry house within the farm all significantly contributed to bacterial community composition. Poultry house explained most of the variation (20.9%), while housing type only explained 0.2% of the variation in community composition. Bacterial diversity was higher in indoor-layers than in outdoor-layers, and indoor-layers also had more variation in their bacterial community composition. No phyla or genera were found to be differentially abundant between indoor and outdoor poultry houses. One amplicon sequence variant was exclusively present in outdoor-layers across all outdoor poultry houses, and was identified as Dietzia maris. Conclusions This study shows that exposure to an outdoor environment is responsible for a relatively small proportion of the community variation in the microbiota of layers. The poultry house, farm, and rearing flock play a much greater role in determining the cloacal microbiota composition of adult laying hens. Overall, measuring differences in cloacal microbiota of layers as an indicator for the level of exposure to potential pathogens and biosecurity seems of limited practical use. To gain more insight into environmental drivers of the gut microbiota, future research should aim at investigating community composition of commercial layer flocks over time