The metabolic activities of gut microbes significantly influence host physiology; thus, characterizing the forces that modulate this micro-ecosystem is key to understanding mammalian biology and fitness. To investigate the gut microbiome of wild primates and determine how these microbial communities respond to the host's external environment, we characterized faecal bacterial communities and, for the first time, gut metabolomes of four wild lowland gorilla groups in the Dzanga-Sangha Protected Areas, Central African Republic. Results show that geographical range may be an important modulator of the gut microbiomes and metabolomes of these gorilla groups. Distinctions seemed to relate to feeding behaviour, implying energy harvest through increased fruit consumption or fermentation of highly fibrous foods. These observations were supported by differential abundance of metabolites and bacterial taxa associated with the metabolism of cellulose, phenolics, organic acids, simple sugars, lipids and sterols between gorillas occupying different geographical ranges. Additionally, the gut microbiomes of a gorilla group under increased anthropogenic pressure could always be distinguished from that of all other groups. By characterizing the interplay between environment, behaviour, diet and symbiotic gut microbes, we present an alternative perspective on primate ecology and on the forces that shape the gut microbiomes of wild primates from an evolutionary context.