Diamond‐like carbon (DLC) possesses brilliant and excellent properties, including excellent corrosion resistance as well as outstanding wear resistance. Ni and B co‐doped DLC films were deposited on AZ91D magnesium alloy by electrodeposition under mild conditions (300 V and 25°C). Uniform and dense morphology of co‐doped DLC films were observed, and Ni and B were uniformly incorporated into the carbon‐based films. Among all the electrodeposits, the appearance of D and G peaks near 1330 and 1570 cm−1 revealed that the as‐deposited films were typical DLC films. As the addition of Ni was increased to 0.05 g, the highest microindentation hardness, the lowest friction coefficient, and wear loss were achieved to be 164.5 HV, 0.3, and 0.6 × 10−5 kg/m, respectively. The amorphous carbon films fabricated at 0.05 g Ni had the lowest corrosion current density and the most positive corrosion potential, which was mainly due to the small and dense granular structure effectively hindering the penetration of corrosion media.