The gut microbiome has a measurable impact on the brain, influencing stress, anxiety, depressive symptoms and social behaviour. This microbiome–gut–brain axis may be mediated by various mechanisms including neural, immune and endocrine signalling. To date, the majority of research has been conducted in animal models, while the limited number of human studies has focused on psychiatric conditions. Here the composition and diversity of the gut microbiome is investigated with respect to human personality. Using regression models to control for possible confounding factors, the abundances of specific bacterial genera are shown to be significantly predicted by personality traits. Diversity analyses of the gut microbiome reveal that people with larger social networks tend to have a more diverse microbiome, suggesting that social interactions may shape the microbial community of the human gut. In contrast, anxiety and stress are linked to reduced diversity and an altered microbiome composition. Together, these results add a new dimension to our understanding of personality and reveal that the microbiome–gut–brain axis may also be relevant to behavioural variation in the general population as well as to cases of psychiatric disorders.