Bacterial motility and growth play central roles in agriculture, the environment, and medicine. While bacterial behavior is typically studied in bulk liquid or on flat surfaces, many bacterial habitats—e.g., soils, sediments, and biological gels/tissues—are complex and crowded spaces. In this talk, I will describe my group's work using tools from soft matter physics to address this gap in knowledge. In particular, using studies of E. coli in transparent 3D porous media, we demonstrate how confinement in a crowded medium fundamentally alters bacterial behavior. In particular, we show how the paradigm of run-and-tumble motility is dramatically altered by pore-scale confinement, both for cells performing undirected motion and those performing chemotaxis, directed motion in response to a chemical stimulus. Our porous media also enable precisely structured multi-cellular communities to be 3D printed. Using this capability, we show how spatial variations in the ability of cells to perform chemotaxis enable populations to autonomously stabilize large-scale perturbations in their overall morphology. Finally, we show how when the pores are small enough to prevent cells from swimming through the pore space, expansion of a community via cellular growth and division gives rise to distinct, highly-complex, large-scale community morphologies. Together, our work thus reveals new principles to predict and control the behavior of bacteria, and active matter in general, in complex and crowded environments.