Transition-metal phosphides have received tremendous attention during the past few years because they are earth-abundant, cost-effective, and show outstanding catalytic performance in several electrochemically driven conversions including hydrogen evolution, oxygen evolution, and water splitting. As one member of the transition-metal phosphides, Co P-based materials have been widely explored as electrocatalyts; however, their application in the traditional thermal catalysis are rarely reported. In this work, cobalt phosphide/carbon nanocubes are designed and their catalytic activity for the selective hydrogenation of nitroarenes to anilines is studied. A high surface area metal-organic framework (MOF), ZIF-67, is infused with red phosphorous, and then pyrolysis promotes the facile production of the phosphide-based catalysts. The resulting composite, consisting of Co P/CN nanocubes, is shown to exhibit excellent catalytic performance in the selective hydrogenation of nitroarenes to anilines. To the best of our knowledge, this is the first report showing catalytic activity of a cobalt phosphide in nitroarenes hydrogenation.