Intestinal IL-17-producing T helper (Th17) cells are dependent on adherent microbes in the gut for their development. However, how microbial adherence to intestinal epithelial cells (IECs) promotes Th17 cell differentiation remains enigmatic. Here, we found that Th17 cell-inducing gut bacteria generated an unfolded protein response (UPR) in IECs. Furthermore, subtilase cytotoxin expression or genetic removal of X-box binding protein 1 (Xbp1) in IECs caused a UPR and increased Th17 cells, even in antibiotic-treated or germ-free conditions. Mechanistically, UPR activation in IECs enhanced their production of both reactive oxygen species (ROS) and purine metabolites. Treating mice with N-acetyl-cysteine or allopurinol to reduce ROS production and xanthine, respectively, decreased Th17 cells that were associated with an elevated UPR. Th17-related genes also correlated with ER stress and the UPR in humans with inflammatory bowel disease. Overall, we identify a mechanism of intestinal Th17 cell differentiation that emerges from an IEC-associated UPR.