Obesity and diabetes in humans are associated with increased rates of anxiety and depression. To understand the role of the gut microbiome and brain insulin resistance in these disorders, we evaluated behaviors and insulin action in brain of mice with diet-induced obesity (DIO) with and without antibiotic treatment. We find that DIO mice have behaviors reflective of increased anxiety and depression. This is associated with decreased insulin signaling and increased inflammation in the nucleus accumbens and amygdala. Treatment with oral metronidazole or vancomycin decreases inflammation, improves insulin signaling in the brain and reduces signs of anxiety and depression. These effects are associated with changes in the levels of tryptophan, GABA, BDNF, amino acids, and multiple acylcarnitines, and are transferable to germ-free mice by fecal transplant. Thus, changes in gut microbiota can control brain insulin signaling and metabolite levels, and this leads to altered neurobehaviors.