Dense suspensions of swimming bacteria are known to exhibit collective behaviour arising from the
interplay of steric and hydrodynamic interactions. Unconfined suspensions exhibit transient,
recurring vortices and jets, whereas those confined in circular domains may exhibit order in the form
of a spiral vortex. Here we show that confinement into a long and narrow macroscopic ‘racetrack’
geometry stabilises bacterial motion to form a steady unidirectional circulation. This motion is
reproduced in simulations of discrete swimmers that reveal the crucial role that bacteria-driven fluid
flows play in the dynamics. In particular, cells close to the channel wall produce strong flows which
advect cells in the bulk against their swimming direction.Weexamine in detail the transition from a
disordered state to persistent directed motion as a function of the channel width, and show that the
width at the crossover point is comparable to the typical correlation length of swirls seen in the
unbounded system. Our results shed light on the mechanisms driving the collective behaviour of
bacteria and other active matter systems, and stress the importance of the ubiquitous boundaries
found in natural habitats.This is the final published version. It first appeared at http://dx.doi.org/10.1088/1367-2630/18/7/075002