Large-scale electrolysis of water to produce hydrogen is an effective way to obtain clean renewable energy. The first-row transition-metal-based oxygen evolution reaction (OER) catalysts with high activity have been developed to replace the noble-metal catalysts, e.g., RuO2 and IrO2. In the work reported in this paper, we developed the Ni–Fe Prussian-blue analog (PBA) on the Ni foam surface (PBA/NF) via an in situ electrodeposition method and transferred the PBA/NF into bimetallic phosphides (NiFePx/NF) through the phosphidation process as highly active OER electrocatalysts in alkaline medium. The in situ electrodeposition method could not only precisely control the nucleation and growth processes of PBA on the surface of nickel foam, as well as the purity, structures, and morphologies of the deposits obtained, but also provide sufficient adhesive force between catalysts and Ni foam substrates without further use of poorly conductive binder material, which guaranteed robust electrode stability. When applying for OER, NiFePx/NF presented excellent catalytic activity. Upon screening a wide electrodeposition time range, results demonstrate that NiFePx-80/NF (deposition time 80 min) possessed the best OER catalytic activity with only 224 mV to deliver a current density of 10 mA cm−2 as well as a Tafel slope of 29 mV dec−1 in 1 M KOH, which shows that the use of electrodeposition methods to directly grow PBA nanomaterials on conductive substrates may be an effective method for the preparation of multifunctional electrocatalysts.