To improve the comprehensive protection performances of steel C1045 surface, the Ni–Co–P alloy coatings with varying CoSO4·7 H2O concentration (0, 10, 20, 30, 40, 50, 60 and 70 g·L–1) were successfully prepared by an electrodeposition technique on a steel C1045 surface. The effect of the addition of CoSO4·7 H2O in the plating solution on the surface microstructure, elemental composition, crystallite size, microhardness, wear and corrosion resistance of the Ni–Co–P alloy coatings were analyzed by using a scanning electron microscope, an energy dispersive spectroscopy, an X-ray diffraction, a microhardness tester, a friction wear tester and an electrochemical workstation, respectively. The results indicated that the Ni–Co–P alloy coating exhibited a flatter morphology, compact microstructure and more excellent properties compared with Ni–P alloy coating, and the addition and variation of CoSO4·7 H2O in the plating solution had significant effects on the surface microstructure and comprehensive protection performances Ni–Co–P alloy coating. Notably, when the mass concentration of CoSO4·7 H2O in the plating solution was 50 g·L–1, the Ni–Co–P alloy coating had the highest content of Co element (22.67 wt·%), smallest crystallite size (20.41 nm) and highest microhardness (716.2 HV0.1). Furthermore, its wear resistance and corrosion resistance were considerably improved compared to that of the Ni–P alloy coating. The minimum average dynamic friction coefficient, wear scar width and depth of Ni–Co–P alloy coating at 50 g·L–1 were 0.47±0.02, 450.9 µm and 14.1 µm, respectively. The corrosion current density (Icorr) of Ni–Co–P alloy coating was the smallest (0.68 µA·cm–2), the corrosion rate (Rcorr) was slowest (8.25 µm·year–1), and the polarization resistance (Rp) of the Ni–Co–P alloy coating was highest (29.83 kΩ·cm2). The corrosion resistance of Ni–Co–P alloy coating was best.