Kuwait has one of the most arid climates in the world, with brackish groundwater that has excessively high hardness due to limestone-rich aquifers with suboptimal ionic compositions, high evapotranspiration, and scarce water sources for shrimp farming. The study aimed to assess whether increasing the magnesium to calcium (Mg/Ca) ratio through Mg-supplementation could enhance shrimp performance, despite the absolute magnesium concentration being higher than diluted seawater of the same salinity. The study comprised a 4-week nursery and an 8-week grow-out trial with Pacific White Shrimp (Litopenaeus vannamei) in low-salinity groundwater in a biofloc system. Experimental groups included a groundwater control (Mg/Ca ratio 0.49) and three different Mg/Ca ratios (about 1, 2 and 3) in three replicates. Postlarvae (0.02 g) and juveniles (0.54 g) were stocked at a density of 1250 and 250 m−3 in the nursery and grow-out trials, respectively, in 1,000 L tanks. In the nursery trial, the control exhibited a final weight of 0.174 g and a survival rate of 58.5%, which was significantly lower in comparison to all Mg+2 treatments, exceeding 0.215 g and 92.5%, with no significant differences between the three treatments. The grow-out trial revealed a proportional increase in growth rate with the Mg/Ca ratio, showing a significantly better performance in treatments with Mg/Ca ratios of 2.12 or higher. The Mg/Ca 2 treatment exhibited the best performance, with a survival rate of 70.8% and a yield of 2.89 kg m−3 of mean weight 16.3 g. The results showed that Mg/Ca ratios have an affect both survival and growth in postlarvae, but only growth in juveniles and larger shrimp. The study suggests that increasing the Mg/Ca ratio above 1.07 and 2.12 through magnesium supplementation can significantly improve shrimp growth in nursery and grow-out phases in low-salinity water. Additionally, the expression of immune-related genes such as prophenoloxidase (proPO), transglutaminase (TGase) and cytosol manganese superoxide dismutase (cMnSOD), and superoxide dismutase (SOD) activity within different Mg/Ca ratios were analyzed. The results revealed significant differences in gene expression and higher SOD activity in the Mg/Ca 2 treatment of the grow-out phase, suggesting that Mg/Ca ratio closer to seawater may enhance the immunity and antioxidant activity of L. vannamei in a low-salinity biofloc system. In conclusion, the study provides valuable insights for shrimp producers using groundwater with high calcium hardness. The findings emphasize the importance of Mg/Ca ratio, rather than the absolute Mg+2 concentration, in improving shrimp growth and suggest potential benefits for shrimp immunity and antioxidant activity in low-salinity environments.