Recent technological advances have enabled comprehensive analyses of the previously uncharacterized microbial community in the gastrointestinal tracts of numerous animal species; however, the gut microbiota of several species, such as the endangered proboscis monkey (Nasalis larvatus) examined in this study, remains poorly understood. Our study sought to establish the first baseline data on the gut microbiota of free-ranging foregut-fermenting proboscis monkeys and to determine how their microbiota are affected locally by environmental (e.g., geographical distance) and social (e.g., group size) factors in proboscis monkeys living in a riparian forest in Sabah, Malaysian Borneo. Using 16S ribosomal RNA gene sequencing of feces collected from more than 300 free-ranging proboscis monkeys, we demonstrated that they were dominated by Firmicutes and Bacteroidetes at the phylum level, with Ruminococcaceae and Lachnospiraceae being the most abundant families and Oscillospira and Ruminococcus being the dominant genera; this trend suggests that the microbial community composition of proboscis monkeys is not particularly distinctive compared to other foregut and hindgut fermenting primates. The microbial alpha diversity was higher in larger groups and individuals inhabiting diverse vegetation (i.e., presumed to have a diverse diet). For microbial beta diversity, some measures were significant, showing higher values with larger geographical distances between samples. These results suggest that social factors such as increased interindividual interactions, which can occur with larger groups, as well as physical distances between individuals or differences in dietary patterns, may affect the gut microbial communities of proboscis monkeys.