Quinoa is widely cultivated for its nutritional value and its high tolerance to environmental problems. Our study was conducted at two planting densities (LD, 10 plants/m2; HD, 65 plants/m2) on ameliorated coastal mudflats in Jiangsu Province, China. The microbial composition in soil was determined by high-throughput sequencing technology, and root metabolites were determined by a liquid chromatograph-mass spectrometer (LC–MS). The results showed soil salinity and organic matter were higher at the HD than LD treatment and compared with the non-rhizosphere (bulk) soil, the salinity of the rhizosphere soil was higher. Quinoa grown at HD was taller, with thicker stalks and lower yields per plant, but higher yield per unit area. Amplicon sequencing showed that Proteobacteria, Bacteroidota and Acidobacteria accounted for the absolute majority. Regarding the rhizosphere soil, the Shannon index was higher in the HD than LD, and Proteobacteria and Bacteroidota were more abundant in the HD treatment. Fifty-one differential metabolites were identified by metabolomic assays, belonging to 14 annotated metabolic pathways. S-adenosylmethionine was the most abundant and up-regulated metabolite (fold change >1.67), and was more abundant in the roots from the LD than in HD treatment. Docosahexaenoic acid was more abundant in the HD than LD treatment, and was a down-regulated metabolite. In conclusion, planting density was an important factor affecting quinoa yield; compared with unplanted soil, planting quinoa at low density increased the content of the important metabolite S-adenosylmethionine in the root system of quinoa, and high-density cultivation of quinoa increased soil salinity and microbial abundance and diversity.