Rocky desertification (RD), a natural and human-induced process of land degradation in karst areas, has become the primary ecological disaster and one of the obstacles to sustainable ecological development in southwest China. Nevertheless, the variation of soil physical and chemical properties, bacterial and fungal communities, and their relationships in RD forests remains limited. Therefore, soil samples were collected from forests under four degrees of RD (NRD, non-RD; LRD, light RD; MRD, moderate RD; and SRD, severe RD) and subjected to high-throughput sequencing of 16S rRNA and ITS1 genes. The results showed a significant reduction in bacterial richness and diversity, while fungal richness and diversity decreased markedly and then showed a balanced trend with the increase in RD degree, indicating that bacteria and fungi did not present the same dynamics in response to the process of RD. The bacterial communities were dominated by Proteobacteria, Actinobacteria, Acidobacteria, and Chloroflexi, while the fungal communities were dominated by Basidiomycota, Ascomycota, and Mortierellomycota. The PCoA and NMDS demonstrated significant differences in microbial communities in study sites, among which the fungal communities in non-RD forest and LRD forest clustered together, suggesting that fungal communities were more stable than bacteria in RD forest. The db-RDA, Mantel test, and random forest model confirmed the important role of soil BD, pH, SOC, AN, and AP in driving microbial diversity and communities. The IndVal analysis suggested that Chloroflexi, Patescibacteria, Atheliales, and Cantharellales with high indicator values were identified as potential bio-indicators for RD forests. This study could not only improve our understanding of bacterial and fungal community dynamics across RD gradients, but also could provide useful information for the further use of microorganisms as indicators to reflect the environmental changes and ecosystem status during forest RD.