The study of bacterial ion channels has provided fundamental insights into the structural basis of neuronal signalling; however, the native role of ion channels in bacteria has remained elusive. Here we show that ion channels conduct long-range electrical signals within bacterial biofilm communities through spatially propagating waves of potassium. These waves result from a positive feedback loop, in which a metabolic trigger induces release of intracellular potassium, which in turn depolarizes neighbouring cells. Propagating through the biofilm, this wave of depolarization coordinates metabolic states among cells in the interior and periphery of the biofilm. Deletion of the potassium channel abolishes this response. As predicted by a mathematical model, we further show that spatial propagation can be hindered by specific genetic perturbations to potassium channel gating. Together, these results demonstrate a function for ion channels in bacterial biofilms, and provide a prokaryotic paradigm for active, long-range electrical signalling in cellular communities. Ion channels in bacterial biofilms are shown to conduct long-range electrical signals within the biofilm community through the propagation of potassium ions; as predicted by a simple mathematical model, potassium channel gating is shown to coordinate metabolic states between distant cells via electrical communication. Gürol Suel and colleagues show that ion channels in bacterial biofilms, which have no known functional role, conduct long-range electrical signals within the biofilm community through the propagation of potassium ions. Metabolic coordination between spatially segregated cells in a Bacillus subtilis biofilm is shown to be dependent on ion channel activity. Metabolic limitation triggers activation of the YugO potassium channel, which also propagates the extracellular potassium signal within the biofilm, resulting in a wave of depolarization that coordinates metabolic states among cells in the interior and periphery of the biofilm. Using a simple mathematical model the authors demonstrate that YugO channel gating is sufficient to promote efficient electrical communication between distant cells.