Nitrogen-doped ordered mesoporous carbons (OMCs) were prepared by using a post-synthetic method with cyanamide as a nitrogen source; they were used as supports for the fabrication of the cobalt-based Fischer–Tropsch synthesis (FTS) catalysts. The obtained composites were well characterised by using nitrogen physisorption, Raman spectroscopy, high-angle annular dark-field scanning transmission electron microscopy, hydrogen chemisorption, X-photoelectron spectroscopy, thermogravimetry–MS, and in situ XRD to investigate the effects of nitrogen on the dispersion of cobalt species and successive autoreduction behaviour of cobalt oxide as well as the catalytic performance in the FTS. The results indicate that the doped nitrogen atoms, especially the pyridine-like nitrogen, actually serve as the anchoring sites for cobalt species. Consequently, the more uniform cobalt particle size is observed for the catalysts with nitrogen-doped OMCs as supports in comparison with their counterparts based on the pristine OMCs. In contrast, the autoreduction temperature of cobalt oxide in the as-synthesised catalysts lowers considerably after nitrogen doping, although slightly increased autoreduction temperature is observed for the catalysts with relatively high nitrogen content owing to the metal–support interaction. Dictated by the balance between decreasing particle size of cobalt and increasing strength of the metal–support interaction, the cobalt specific activity of the nitrogen-doped catalysts reaches a maximum and then decreases in the FTS with increasing nitrogen content. Notably, under optimum conditions, the cobalt specific activity on the nitrogen-doped sample with medium nitrogen content is 1.5 times higher than its analogue on the pristine OMC without compromising the selectivity to C5+ hydrocarbons.