Multiple sclerosis (MS) is an autoimmune disease that affects the functioning of the central nervous system (CNS). Recent studies on MS and its animal model, experimental autoimmune encephalomyelitis (EAE), have shown that the composition and abundance of microbes in the intestinal microbiota are an environmental risk factor for the development of MS and EAE. Changes in certain microbial populations in the gastrointestinal tract can cause MS in humans, but MS inflammation can be reduced or even prevented by introducing other commensal microbes that produce beneficial metabolites. Other risk factors for MS include the presence of an altered gut physiology and the interaction between the intestinal microbiota and the immune system. Metabolites including short-chain fatty acids (SCFAs), such as butyrate, are the primary signaling molecules produced by the intestinal microbiota that interact with the host immune system, suggesting an association between MS pathophysiology and gut microbiota. In addition, several host microRNAs present in the gut have been found to interact with the intestinal microbial community, these interactions may indirectly affect the neurological system. Increasing evidence has shown that regulation of the intestinal microbiota is an important approach for reducing MS inflammation. Thus, here we review the use of diet to alter the gut microbiota and its application in the treatment and prevention of MS.