Animal guts are often colonized by host-specialized bacterial species to the exclusion of other transient microorganisms, but the genetic basis of colonization ability is largely unknown. The bacterium Snodgrassella alvi is a dominant gut symbiont in honey bees, specialized in colonizing the hindgut epithelium. We developed methods for transposon-based mutagenesis in S. alvi and, using high-throughput DNA sequencing, screened genome-wide transposon insertion (Tnseq) and transcriptome (RNA-seq) libraries to characterize both the essential genome and the genes facilitating host colonization. Comparison of Tn-seq results from laboratory cultures and from monoinoculated worker bees reveal that 519 of 2,226 protein-coding genes in S. alvi are essential in culture, whereas 399 are not essential but are beneficial for gut colonization. Genes facilitating colonization fall into three broad functional categories: extracellular interactions, metabolism, and stress responses. Extracellular components with strong fitness benefits in vivo include trimeric autotransporter adhesins, O antigens, and type IV pili (T4P). Experiments with T4P mutants establish that T4P in S. alvi likely function in attachment and biofilm formation, with knockouts experiencing a competitive disadvantage in vivo. Metabolic processes promoting colonization include essential amino acid biosynthesis and iron acquisition pathways, implying nutrient scarcity within the hindgut environment. Mechanisms to deal with various stressors, such as for the repair of double-stranded DNA breaks and protein quality control, are also critical in vivo. This genome-wide study identifies numerous genetic networks underlying colonization by a gut commensal in its native host environment, including some known from more targeted studies in other hostmicrobe symbioses.type IV pilus | transposon mutagenesis | microbiota | symbiosis | Neisseriaceae