The spatial structure of natural habitats strongly affects bacterial life, ranging from nanoscale structural features that individual cells exploit for surface attachment, to micro- and millimeter-scale chemical gradients that drive population-level processes. Nanofabrication and microfluidics are ideally suited to manipulate the environment at those scales and have emerged as powerful tools with which to study bacteria. Here, we review the new scientific insights gained by using a diverse set of nanofabrication and microfluidic techniques to study individual bacteria and multispecies communities. This toolbox is beginning to elucidate disparate bacterial phenomena-including aging, electron transport, and quorum sensing-and enables the dissection of environmental communities through single-cell genomics. A more intimate integration of microfluidics, nanofabrication, and microbiology will enable further exploration of bacterial life at the smallest scales.