Metabolic imbalance drives organ aging and diseases, but the underlying mechanisms remain elusive. Here, we identify magnesium (Mg) deficiency as is a risk factor of gut health with age across species (human, primate, murine). Although Mg restriction had minimal effects in young mice, it exacerbated intestinal aging phenotypes in older animals and aggravated colitis severity. Integrated multi-omics analysis revealed that Mg deficiency remodels the phosphoproteome and N-glycoproteome and disrupts proteostasis, leading to destabilization of adhesion complexes, a hallmark of gut aging and inflammation. UK Biobank analysis (n=182,213) demonstrated a robust inverse correlation between dietary Mg intake and gut disorder incidence. Notably, a daily Mg intake of 334.7–420 mg/day conferred significant protection against Crohn’s disease, ulcerative colitis, irritable bowel syndrome, and diverticular disease. Our findings establish Mg homeostasis as a fundamental regulator of gut health and propose dietary Mg supplementation as a potential strategy to mitigate age-related gut dysfunction.