The association between altered gut microbiota, intestinal permeability, inflammation and cardiometabolic diseases is becoming increasingly clear but remains poorly understood1,2. Indoleamine 2,3-dioxygenase is an enzyme induced in many types of immune cells, including macrophages in response to inflammatory stimuli, and catalyzes the degradation of tryptophan along the kynurenine pathway. Indoleamine 2,3-dioxygenase activity is better known for its suppression of effector T cell immunity and its activation of regulatory T cells3,4. However, high indoleamine 2,3-dioxygenase activity predicts worse cardiovascular outcome5-9 and may promote atherosclerosis and vascular inflammation6, suggesting a more complex role in chronic inflammatory settings. Indoleamine 2,3-dioxygenase activity is also increased in obesity10-13, yet its role in metabolic disease is still unexplored. Here, we show that obesity is associated with an increase of intestinal indoleamine 2,3-dioxygenase activity, which shifts tryptophan metabolism from indole derivative and interleukin-22 production toward kynurenine production. Indoleamine 2,3-dioxygenase deletion or inhibition improves insulin sensitivity, preserves the gut mucosal barrier, decreases endotoxemia and chronic inflammation, and regulates lipid metabolism in liver and adipose tissues. These beneficial effects are due to rewiring of tryptophan metabolism toward a microbiota-dependent production of interleukin-22 and are abrogated after treatment with a neutralizing anti-interleukin-22 antibody. In summary, we identify an unexpected function of indoleamine 2,3-dioxygenase in the fine tuning of intestinal tryptophan metabolism with major consequences on microbiota-dependent control of metabolic disease, which suggests indoleamine 2,3-dioxygenase as a potential therapeutic target.