Major depressive disorder (MDD) is a complex disorder and a leading cause of disability in 280 million people worldwide. Many environmental factors, such as microbes, drugs, and diet, are involved in the pathogenesis of depressive disorders. However, the underlying mechanisms of depression are complex and include the interaction of genetics with epigenetics and the host immune system. Modifications of the gut microbiome and its metabolites influence stress-related responses and social behavior in patients with depressive disorders by modulating the maturation of immune cells and neurogenesis in the brain mediated by epigenetic modifications. Here, we discuss the potential roles of a leaky gut in the development of depressive disorders via changes in gut microbiota-derived metabolites with epigenetic effects. Next, we will deliberate how altering the gut microbiome composition contributes to the development of depressive disorders via epigenetic alterations. In particular, we focus on how microbiota-derived metabolites such as butyrate as an epigenetic modifier, probiotics, maternal diet, polyphenols, drugs (e.g., antipsychotics, antidepressants, and antibiotics), and fecal microbiota transplantation could positively alleviate depressive-like behaviors by modulating the epigenetic landscape. Finally, we will discuss challenges associated with recent therapeutic approaches for depressive disorders via microbiome-related epigenetic shifts, as well as opportunities to tackle such problems.