Biofilms constitute the predominant form of microbial life and a potent reservoir for innate antibiotic resistance in systemic infections. In the spore-forming bacterium Bacillus subtilis, the transition from a planktonic to sessile state is mediated by mutually exclusive regulatory pathways controlling the expression of genes required for flagellum or biofilm formation. Here, we identify mstX and yugO as novel regulators of biofilm formation in B. subtilis. We show that expression of mstX and the downstream putative K+ efflux channel, yugO, is necessary for biofilm development in B. subtilis, and that overexpression of mstX induces biofilm assembly. Transcription of the mstX-yugO operon is under the negative regulation of SinR, a transcription factor that governs the switch between planktonic and sessile states. Furthermore, mstX regulates the activity of Spo0A through a positive autoregulatory loop involving KinC, a histidine kinase that is activated by potassium leakage. The addition of potassium abrogated mstX-mediated biofilm formation. Our findings expand the role of Spo0A and potassium homeostasis in the regulation of bacterial development.