Plasmids drive bacterial evolutionary innovation by transferring ecologically important functions between lineages, but acquiring a plasmid often comes at a fitness cost to the host cell. Compensatory mutations, which ameliorate the cost of plasmid carriage, promote plasmid maintenance in simplified laboratory media across diverse plasmid-host associations. Whether such compensatory evolution can occur in more complex communities inhabiting natural environmental niches where evolutionary paths may be more constrained is, however, unclear. Here, we show a substantial fitness cost of carrying the large conjugative plasmid pQBR103 in Pseudomonas fluorescens SBW25 in the plant rhizosphere. This plasmid fitness cost could be ameliorated by compensatory mutations affecting the chromosomal global regulatory system gacA/gacS, which arose rapidly in plant rhizosphere communities and were exclusive to plasmid carriers. These findings expand our understanding of the importance of compensatory evolution in plasmid dynamics beyond simplified lab media. Compensatory mutations contribute to plasmid survival in bacterial populations living within complex microbial communities in their environmental niche.