Calcium phosphate coatings are used in orthopedics due to their excellent bioactivity, which improves the bonding between the metal implant and the bone. The use of self-assembling monolayers of long-chain organic acids can induce calcium phosphate growth. In this article, the self-assembling monolayers of stearic acid and octadecylphosphonic acid formed on the Mg alloy surface were additionally modified with electrodeposited hydroxyapatite coating to increase the bioactivity and biocompatibility of the Mg alloy in a physiological solution. Hydroxyapatite coating was prepared by a two-step reaction: hydrogen phosphate formed by electrodeposition at constant potential was converted into hydroxyapatite coating through an acid–base reaction. The results obtained by voltammetry and electrochemical impedance spectroscopy have shown a beneficial effect of organic acid self-assembling monolayer and especially of organic acid self-assembling monolayer modification by hydroxyapatite electrodeposition on the corrosion properties of Mg alloy in physiological solution. Fourier transform infrared spectroscopy and scanning electron microscopy were used to verify the existence of the organic acid SAM|HAp film on the Mg alloy surface and their morphology.