With the development of modern sheep raising technology, the increasing density of animals in sheep house leads to the accumulation of microbial aerosols in sheep house. It is an important prerequisite to grasp the characteristics of bacteria in aerosols in sheep house to solve the problems of air pollution and disease prevention and control in sheep house. In this study, the microorganisms present in the air of sheep houses were investigated to gain insights into the structure of bacterial communities and the prevalence of pathogenic bacteria. Samples from six sheep pens in each of three sheep farms, totaling 18, were collected in August 2022 from Ningxia province, China. A high-volume air sampler was utilized for aerosol collection within the sheep housing followed by DNA extraction for 16S rRNA sequencing. Employing high-throughput 16S rRNA sequencing technology, we conducted an in-depth analysis of microbial populations in various sheep pen air samples, enabling us to assess the community composition and diversity. The results revealed a total of 11,207 operational taxonomic units (OTUs) within the bacterial population across the air samples, encompassing 152 phyla, 298 classes, 517 orders, 853 families, 910 genera, and 482 species. Alpha diversity and beta diversity analysis indicated that differences in species diversity, evenness and coverage between different samples. At the bacterial phylum level, the dominant bacterial groups are Firmicutes, Proteobacteria, and Actinobacteria, among which Firmicutes (97.90–98.43%) is the highest. At the bacterial genus level, bacillus, Bacteroides, Fusobacterium, etc. had higher abundance, with Bacillus (85.47–89.87%) being the highest. Through an in-depth analysis of microbial diversity and a meticulous examination of pathogenic bacteria with high abundance in diverse sheep house air samples, the study provided valuable insights into the microbial diversity, abundance, and distinctive features of prevalent pathogenic bacteria in sheep house air. These findings serve as a foundation for guiding effective disease prevention and control strategies within sheep farming environments.