Lithium–sulfur (Li–S) battery is a potential energy storage technology with high energy density and low cost. However, the gap between theoretical expectation and practical performance limits its wide implementation. Herein, we report a nitrogen-doped porous carbon derived from biomass pomelo peel as sulfur host material for Li–S batteries. The hierarchical porous architecture and the polar surface introduced by N-doping render a favorable combination of physical and chemical sulfur confinements as well as an expedite electron/ion transfer, thus contributing to a facilitated and stabilized sulfur electrochemistry. As a result, the corresponding sulfur composite electrodes exhibit an ultrahigh initial capacity of 1534.6 mAh g− 1, high coulombic efficiency over 98% upon 300 cycles, and decent rate capability up to 2 C. This work provides an economical and effective strategy for the fabrication of advanced carbonaceous sulfur host material as well as the significant improvement of Li–S battery performance.