The intestine is densely populated by anaerobic commensal bacteria. These microorganisms shape immune system development, but understanding of host-commensal interactions is hampered by a lack of tools for studying the anaerobic intestinal environment. We applied metabolic oligosaccharide engineering and bioorthogonal click chemistry to label various commensal anaerobes, including Bacteroides fragilis, a common and immunologically important commensal. We studied the dissemination of B. fragilis after acute peritonitis and characterized the interactions of the intact microbe and its polysaccharide components in myeloid and B cell lineages. We were able to assess the distribution and colonization of labeled B. fragilis along the intestine, as well as niche competition after coadministration of multiple species of the microbiota. We also fluorescently labeled nine additional commensals (eight anaerobic and one microaerophilic) from three phyla common in the gut--Bacteroidetes, Firmicutes and Proteobacteria--as well as one aerobic pathogen (Staphylococcus aureus). This strategy permits visualization of the anaerobic microbial niche by various methods, including intravital two-photon microscopy and non-invasive whole-body imaging, and can be used to study microbial colonization and host-microbe interactions in real time.