Anhedonia and amotivation are debilitating symptoms and represent unmet therapeutic needs in a range of clinical conditions. The gut-microbiome-endocannabinoid axis might represent a potential modifiable target for interventions. Based on results obtained from animal models, we tested the hypothesis that the endocannabinoid system mediates the association between gut-microbiome diversity and anhedonia/amotivation in a general population cohort. We used longitudinal data collected from 786 volunteer twins recruited as part the TwinsUK register. Our hypothesis was tested with a multilevel mediation model using family structure as random intercept. The model was set using alpha diversity (within-individual gut-microbial diversity) as predictor, serum and faecal levels of the endocannabinoid palmitoylethanolamide (PEA) as mediator, and anhedonia/amotivation as outcome. PEA is considered the endogenous equivalent of cannabidiol, with increased serum levels believed to have anti-depressive effects, while increased stool PEA levels, reflecting increased excretion, are believed to have opposite, detrimental, effects on mental health. We therefore expected that either reduced serum PEA or increased stool PEA would mediate the association between microbial diversity and anhedonia amotivation. Analyses were adjusted for obesity, diet, antidepressant use, sociodemographic and technical covariates. Data were imputed using multiple imputation by chained equations. Mean age was 65.2 ± 7.6; 93% of the sample were females. We found a direct, significant, association between alpha diversity and anhedonia/amotivation (β = −0.37; 95%CI: −0.71 to −0.03; P = 0.03). Faecal, but not serum, levels of the endocannabinoid palmitoylethanolamide (PEA) mediated this association: the indirect effect was significant (β = −0.13; 95%CI: −0.24 to −0.01; P = 0.03), as was the total effect (β = −0.38; 95%CI: −0.72 to −0.04; P = 0.03), whereas the direct effect of alpha diversity on anhedonia/amotivation was attenuated fully (β = −0.25; 95%CI: −0.60 to 0.09; P = 0.16). Our results suggest that gut-microbial diversity might contribute to anhedonia/amotivation via the endocannabinoid system. These findings shed light on the biological underpinnings of anhedonia/amotivation and suggest the gut microbiota-endocannabinoid axis as a promising therapeutic target in an area of unmet clinical need.