A Western lifestyle with high salt consumption can lead to hypertension and cardiovascular disease. High salt may additionally drive autoimmunity by inducing T helper 17 (TH17) cells, which can also contribute to hypertension. Induction of TH17 cells depends on gut microbiota; however, the effect of salt on the gut microbiome is unknown. Here we show that high salt intake affects the gut microbiome in mice, particularly by depleting Lactobacillus murinus. Consequently, treatment of mice with L. murinus prevented salt-induced aggravation of actively induced experimental autoimmune encephalomyelitis and salt-sensitive hypertension by modulating TH17 cells. In line with these findings, a moderate high-salt challenge in a pilot study in humans reduced intestinal survival of Lactobacillus spp., increased TH17 cells and increased blood pressure. Our results connect high salt intake to the gut-immune axis and highlight the gut microbiome as a potential therapeutic target to counteract salt-sensitive conditions.