A short-term composting process to prepare substrate is an effective way to cultivate oyster mushrooms (Pleurotus spp.), which can increase the yield of mushrooms and lower the rate of contamination in non-industrialized cultivation. Moreover, it is different from the traditional composting processes for fertilizers and lacks systematic study, such as microbial succession and compost quality. In this study, a series of different tests of composting duration (0, 2, 4 and 5 d) were performed. A composting duration of 4–5 d over 58 °C was suitable for mushroom cultivation based on the biological efficiency (BE) range of 69.76–73.41 % and the contamination rate of 0 %. The content of total carbon (TC) continuously decreased during composting, while the content of total nitrogen (TN) reacted in an opposite matter. The final TN and C/N ratios were 1.89 % and 28/1, respectively, which fell well within the optimal range of nutritional requirements for oyster mushroom cultivation. The composting bacteria were more diverse than the fungal species. Caldibacillus, Thermobispora, Thermopolyspora, Thermobacillus and Ureibacillus were the predominant bacterial genera during the thermophilic stage. Co-occurrence patterns of microbial communities and physicochemical properties were performed using a network analysis, which indicated that bacteria can play more efficient roles than fungi in the degradation of organic matter. The structural equation model showed that composting duration significantly affected bacterial diversity, lignocellulose degradation rates, and BE. The correlations between bioinformatics parameters with composting characters and agronomic traits were determined by the Mantel test and showed that the induction of bacterial diversity over time rapidly activated carbon metabolism during short-term composting. This study provides a new idea of agro-waste composting for mushroom cultivation.