Phenotypic switching in bacteria is an evolutionary adaptation that enhances fitness under changing environmental conditions. Here, we report phenotypic switching in Enterobacter sp. SA187 during the transition from its free-living state in soil to its endophytic state in plant root colonization. SA187 phenotypic switching is not host-restricted but occurs during colonization of various host plants. Genome re-sequencing of switcher colonies revealed consistent mutations in the rpoS gene compared to the ancestral strain. Loss-of-function mutations in the rpoS gene were both necessary and sufficient to trigger the phenotypic change, leading to widespread alterations in gene regulation that affected motility, biofilm formation, metabolism and growth. Metabolic analysis further revealed that SA187 switchers have enhanced capacity to thrive in media mimicking the acidic, sucrose-rich apoplastic compartment of plants. Phenotypic switching can be induced in media mimicking plant cell conditions but can be partially reverted on standard bacterial growth media. Overall, our study unravels the genetic mechanism and pivotal role of phenotypic switching in the evolutionary adaptation of a bacterial symbiont to different environments.