Doped porous carbon materials have attracted great interest owing to their excellent electrochemical performance toward energy storage applications. In this report, we described the synthesis of nitrogen-doped porous carbon (N-PC) via carbonization of a triazine-based covalent organic framework (COF) synthesized by Friedel–Crafts reaction. The as-synthesized COF and N-PC were confirmed by X-ray diffraction. The N-PC exhibited many merits including high surface area (711 m2 g−1), porosity, uniform pore size, and surface wettability due to the heteroatom-containing lone pair of electron. The N-PC showed a high specific capacitance of 112 F g−1 at a current density of 1.0 A g−1 and excellent cyclic stability with 10.6% capacitance loss after 5000 cycles at a current density of 2.0 A g−1. These results revealed that the COF materials are desirable for future research on energy storage devices.