Lignin has been widely used as a high-quality carbon source in the preparation of carbon electrodes. Because the skeleton of lignin molecules is an unordered three-dimensional network structure, it is difficult to obtain high-performance porous carbon electrode materials with regular structures by conventional carbonization methods. To improve the electrochemical performance of lignin-based carbon, green, convenient and mass-produced lignin-based porous hollow carbon shell frameworks (HCSFs) were proposed. With the help of electrostatic forces, lignin/silica nanocomposites were generated by an insitu self-assembly and coprecipitation method using quaternary ammonium lignin and sodium silicate as raw materials. After carbonization and activation, HCSFs with hollow porous frame structures rich in nitrogen were obtained. The prepared HCSFs can maintain a reversible specific capacity of 480 mA h g−1 after 200 cycles at 200 mA g−1 as a lithium-ion battery anode, and they can also maintain a specific capacity of 180.4 mF g−1 after 10,000 cycles at 1 A g−1 as a supercapacitor electrode. Their better energy storage performance is mainly attributed to the special hollow shell structure of HCSFs, which can provide channels for rapid ion transport, and the doping of nitrogen atoms can also provide an increase in the number of storage sites. This work provides a theoretical basis for the preparation of carbon shells from biomass and widens the application field for the high value utilization of industrial lignin.