The mammalian gastrointestinal (GI) tract is colonized by trillions of beneficial commensal bacteria that are essential for promoting normal intestinal physiology. While the majority of commensal bacteria are found in the intestinal lumen, many species have also adapted to colonize different anatomical locations in the intestine, including the surface of intestinal epithelial cells (IECs) and the interior of gut-associated lymphoid tissues. These distinct tissue localization patterns permit unique interactions with the mammalian immune system and collectively influence intestinal immune cell homeostasis. Conversely, dysregulated localization of commensal bacteria can lead to inappropriate activation of the immune system and is associated with numerous chronic infectious, inflammatory, and metabolic diseases. Therefore, regulatory mechanisms that control proper anatomical containment of commensal bacteria are essential to maintain tissue homeostasis and limit pathology. In this review, we propose that commensal bacteria associated with the mammalian GI tract can be anatomically defined as (i) luminal, (ii) epithelial-associated, or (iii) lymphoid tissue-resident, and we discuss the role and regulation of these microbial populations in health and disease.