CoFe/MgO nanocomposites have been prepared from single-source inorganic layered double hydroxide (LDH) precursors via a H2 gas-phase reduction; the metal composition can be freely manipulated by tailoring the molecular composition of the LDH precursors.