Microbial communities perform key functions for the host they associate with or the environment they reside in. Our ability to control those microbial communities is crucial for maintaining or even enhancing the well-being of their host or environment. But this potential has not been fully harvested due to the lack of a systematic method to control those complex microbial communities. Here we introduce a theoretical framework to rigorously address this challenge, based on the new notion of structural accessibility. This framework allows the identification of minimal sets of “driver species” through which we can achieve feasible control of the entire community. We apply our framework to control the core microbiota of a sea sponge and the gut microbiota of gnotobiotic mice infected with C. difficile. This control-theoretical framework fundamentally enhances our ability to effectively manage and control complex microbial communities, such as the human gut microbiota. In particular, the concept of driver species of a microbial community holds translational promise in the design of probiotic cocktails for various diseases associated with disrupted microbiota.