Magnesium oxychloride has excellent early strength, lightweight and environmentally friendly properties, and excellent application value. However, insufficient water resistance affects its engineering application. This paper uses fly ash to improve the water resistance of magnesium oxychloride cement (MOC). The response surface method was used to optimize the ratio of magnesium oxychloride cement. The influence of fly ash content, magnesium oxychloride cement ratio, and their interaction on the water resistance of magnesium oxychloride cement was studied using a response surface experiment. The fly ash content and magnesium oxychloride cement ratio were optimized to form magnesium oxychloride cement with good water-resistance. The experimental results show that the fitting efficiency of the response surface model is R2 = 0.9951; the model reflects the relationship between the factors of magnesium oxychloride cement and water resistance well. The magnesium oxychloride cement has a maximum softening coefficient of 0.898 when the amount of fly ash added is 21.94%, and the molar ratio of magnesium oxychloride cement is 11.49: 1:11.77. The magnesium oxychloride cement has good water resistance by optimizing the ratio based on external fly ash and response surface methodology. The study provides a reference for improving the water resistance of magnesium oxychloride cement.