Metal–organic framework (MOF) derivatives are excellent energy storage devices such as lithium–sulfur batteries. Here, a bimetallic (CoNi)-embedded nitrogen-enriched carbon framework was synthesized by a simple metal-doped zeolitic imidazolate framework thermal conversion strategy. CoNi-NC materials have a large specific surface area and a pore-rich structure. This unique structure interacts with a cobalt-based electroactive phase and a secondary metal to enhance electrochemical performance. By changing the molar ratio of nickel to cobalt and selecting the best bimetallic nitrogen-doped carbon framework, the initial discharge capacity of the lithium–sulfur battery with Co0.75Ni0.25-NC as the electrode material was 1278 mA h g−1 at 0.1 C, with excellent rate performance and good cycle stability.