Traditional fermented foods are usually produced by spontaneous fermentation, which is dependent on climatic conditions. It is important to unveil the effect of climatic conditions on spontaneous food fermentation. Here, this study aimed to unveil the regulation of climatic factors on microbiota structure and production of flavor compounds in spontaneous fermentation of Daqu (the starter for Chinese liquor fermentation). The diversity indexes of both microbiota and flavor compounds were significantly different (P < 0.01) across four seasons. Mantel test showed that climatic factors, including daily average temperature (R2 = 0.41, P = 0.019) and relative humidity (R2 = 0.38, P = 0.036), played important roles in the variation of microbiota and flavor compounds. A model was constructed to predict the diversity of flavor compounds, the parameter determining the quality of Daqu, based on these two climatic factors. The maximal value of diversity of flavor compounds reached 3.67, when daily average temperature was 18.89 °C and relative humidity was 49.21%. It increased by 70.69% compared to the lowest value 2.15. This study shed new light on the effect of climatic factors on the flavor compound production in spontaneous food fermentation. It would help improve and stabilize quality of spontaneously fermented foods.