Dietary composition is associated with the differential prevalence of psychiatric disorders; the Western diet confers increased risk, while the Mediterranean diet appears to reduce risk. In nonhuman primates, anxiety-like behaviors and social isolation have been linked to both Western diet consumption and increased inflammatory disease risk, and recent evidence suggests that diet composition may affect immune system function in part through its effects on behavior. This is particularly important in the context of the global COVID-19 pandemic in which social isolation has been associated with disease. Here, we examined the effects of Western- and Mediterranean-like diets on social behavior in a randomized, 34-month preclinical trial in middle-aged female cynomolgus macaques (Macaca fascicularis). Diet induced rapid and persistent changes in a suite of behaviors. After just three months of experimental diet consumption, a composite measure of diet-altered behavior (DAB) significantly differed between the two diets (p = 0.014) and remained different throughout the 24-month experimental observation period (p = 2.2 × 10−8). Monkeys fed the Western diet spent more time alone (FDR = 4.4 × 10−5) and displayed more anxiety behavior (FDR = 0.048), whereas monkeys fed the Mediterranean diet spent more time resting (FDR = 0.0013), attentive (FDR = 0.017), and in body contact with groupmates (FDR = 4.1 × 10−8). These differences were largely due to changes in behavior of animals fed the Mediterranean diet, while Western-diet-fed-animals exhibited similar behaviors compared to the eight-month baseline period, during which all monkeys consumed a common laboratory diet. These observations provide experimental support in a nonhuman primate model, demonstrating a potential therapeutic benefit of the Mediterranean diet consumption to reduce social isolation and anxiety and thus mitigate social isolation-associated disorders that often accompany illness and disability.