Microbial corrosion is a universal phenomenon in salt water media such as seawater and wastewater environments. As a kind of efficient protective metal coating for steel, the damage of the Zn–Ni alloy coating was found to be accelerated under microbial corrosive conditions. To solve this problem, chitosan, which is considered a natural product with high antibacterial efficiency, was added to Zn–Ni electrolytes as a functional ingredient of electrodeposited Zn–Ni–chitosan coatings. It was found that the addition of chitosan significantly and negatively shifted the electrodeposition potentials and influenced the Ni contents, the phase composition, and the surface morphologies. By exposing the coatings in a sulfate-reducing bacteria medium, the microbial corrosion resistance was investigated. The results showed that compared to the Zn–Ni alloy coating, Zn–Ni–chitosan coatings showed obvious inhibiting effects on sulfate-reducing bacteria (SRB) and the corrosion rates of these coatings were mitigated to some degree. Further research on the coatings immersed in an Escherichia coli-suspended phosphate buffer saline medium showed that the bacteria attachment on the coating surface was effectively reduced, which indicated enhanced antibacterial properties. As a result, the Zn–Ni–chitosan coatings showed remarkably enhanced anticorrosive and antibacterial properties.