To analyse Xuanwei ham flavour quality at different post-ripening times, and to elucidate its microbial diversity, we studied free amino acids and volatile flavouring compounds (VOCs) and their relationships. We determined microbial community changes in Xuanwei ham at 1, 2, 3 and 4 years (W1-4) by high-throughput sequencing, and simultaneously, VOCs and free amino acid contents by gas chromatography-mass spectrometry (GC-MS) and liquid chromatography (LC), respectively. Then heatmap analysis was used to determine correlations between microbial communities, free amino acids and VOCs. A total of 25 free amino acids were detected, among which W3 contained the fewest and most were generally lower than in hams in the other three years. Fifty-nine VOCs were detected, among which were 17 esters, and the highest ester content was found in W4. Atotal of 87508391 reads were obtained from the samples, of which 812844 were clean reads, and the bacterial Chao1 index and Shannon index were significantly higher in W3 than in the other three ham years. In differetly-aged Xuanwei hams, Pseudomonadota was the dominant bacterial phylum, and the most abundant genera were Sarocladium, Klebsiella and Vibrio. Klebsiella was the most abundant genus in W1, and Vibrio in W3, and the second most abundant genera were Sarocladium and Gammaretrovirus. We elucidated differences in Xuanwei ham microflora structures in different years and the main flavor-related microorganisms, thus providing a theoretical basis for subsequent Xuanwei ham storage, quality and improvement.