Inositol lipids are ubiquitous in eukaryotes and have finely tuned roles in cellular signalling and membrane homoeostasis. In Bacteria, however, inositol lipid production is relatively rare. Recently, the prominent human gut bacterium Bacteroides thetaiotaomicron (BT) was reported to produce inositol lipids and sphingolipids, but the pathways remain ambiguous and their prevalence unclear. Here, using genomic and biochemical approaches, we investigated the gene cluster for inositol lipid synthesis in BT using a previously undescribed strain with inducible control of sphingolipid synthesis. We characterized the biosynthetic pathway from myo-inositol-phosphate (MIP) synthesis to phosphoinositol dihydroceramide, determined the crystal structure of the recombinant BT MIP synthase enzyme and identified the phosphatase responsible for the conversion of bacterially-derived phosphatidylinositol phosphate (PIP-DAG) to phosphatidylinositol (PI-DAG). In vitro, loss of inositol lipid production altered BT capsule expression and antimicrobial peptide resistance. In vivo, loss of inositol lipids decreased bacterial fitness in a gnotobiotic mouse model. We identified a second putative, previously undescribed pathway for bacterial PI-DAG synthesis without a PIP-DAG intermediate, common in Prevotella. Our results indicate that inositol sphingolipid production is widespread in host-associated Bacteroidetes and has implications for symbiosis.