Many bacterial habitats—ranging from gels and tissues in the body to cell-secreted exopolysaccharides in biofilms—are rheologically complex, undergo dynamic external forcing, and have unevenly-distributed nutrients. How do these features jointly influence how the resident cells grow and proliferate? Here, we address this question by studying the growth ofEscherichia colidispersed in granular hydrogel matrices with defined and highly-tunable structural and rheological properties, under different amounts of external forcing imposed by mechanical shaking, and in both aerobic and anaerobic conditions. Our experiments establish a general principle: that the balance between the yield stress of the environment that the cells inhabitσyand the external stress imposed on the environmentσregulates bacterial growth by modulating transport of essential nutrients to the cells. In particular, whenσy< σ, the environment is easily fluidized and mixed over large scales, providing nutrients to the cells and sustaining complete cellular growth. By contrast, whenσy> σ, the elasticity of the environment suppresses large-scale fluid mixing, limiting nutrient availability and arresting cellular growth. Our work thus reveals a new mechanism, beyond effects that change cellular behavior via local forcing, by which the rheology of the environment may regulate microbial physiology in diverse natural and industrial settings.