Magnesium alloys are potential biodegradable hard-tissue implant materials because of their excellent biomechanical compatibility, biosafety, and absorbability. In order to further improve the biocompatibility of these alloys, a ceramic coating was prepared on the surface of a magnesium alloy specimen by plasma electrolytic oxidation (PEO) in a phosphate solution. The ceramic coating has a rough surface, porous structure, and no harmful elements in the ceramic membrane. Further, experiments with MG63 cells show that the PEO ceramic coating can promote cell adhesion and proliferation, and it causes no obvious cytotoxicity. In conclusion, PEO can be used to prepare a suitable ceramic coating on the surface of the magnesium alloy, thereby increasing its potential for clinical applications.