Plant enrichment and tolerance to heavy metals are crucial for the phytoremediation of coal gangue mountain. However, understanding of how plants mobilize and tolerate heavy metals in coal gangue is limited. This study conducted potted experiments using Setaria viridis as a pioneer remediation plant to evaluate its tolerance to coal gangue, its mobilization and enrichment of metals, and its impact on the soil environment. Results showed that the addition of 40% gangue enhanced plant metal and oxidative stress resistance, thereby promoting plant growth. However, over 80% of the gangue inhibited the chlorophyll content, photoelectron conduction rate, and biomass of S. viridis, leading to cellular peroxidative stress. An analysis of metal resistance showed that endogenous S in coal gangue promoted the accumulation of glutathione, plant metal chelators, and non-protein thiols, thereby enhancing its resistance to metal stress. Setaria viridis cultivation affected soil properties by decreasing nitrogen, phosphorus, conductivity, and urease and increasing sucrase and acid phosphatase in the rhizosphere soil. In addition, S. viridis planting increased V, Cr, Ni, As, and Zn in the exchangeable and carbonate-bound states within the gangue, effectively enriching Cd, Cr, Fe, S, U, Cu, and V. The increased mobility of Cd and Pb was correlated with a higher abundance of Proteobacteria and Acidobacteria. Heavy metals, such as As, Fe, V, Mn, Ni, and Cu, along with environmental factors, including total nitrogen, total phosphorus, urease, and acid phosphatase, were the primary regulatory factors for Sphingomonas, Gemmatimonas, and Bryobacter. In summary, S. viridis adapted to gangue stress by modulating antioxidant and elemental enrichment systems and regulating the release and uptake of heavy metals through enhanced bacterial abundance and the recruitment of gangue-tolerant bacteria. These findings highlight the potential of S. viridis for plant enrichment in coal gangue areas and will aid the restoration and remediation of these environments.