We developed an efficient and environmentally friendly strategy for synthesizing an N-doped carbon aerogel by the carbonization of an alkaline peroxide mechanical pulp (APMP) fiber aerogel saturated with rhodamine B (RB) dyes. The APMP aerogel was prepared via cellulose extraction, sol-gel, and freeze drying. The resulting aerogel had a high adsorption capacity (250 mg g−1) and a fast adsorption rate (within 30 s) towards RB dyes. The saturated aerogel was used as a starting material for further carbonization to prepare N-doped carbon aerogels. SEM studies showed that the 3D network structure of the APMP aerogels was well preserved after RB adsorption and carbonization. The prepared carbon aerogel exhibited a graphitized structure, and N (2.15%) was doped at pyridinic N and pyrrolic N sites in the 3D carbon network. The specific capacitance of the N-doped carbon aerogel reached 185 F g−1 at a current density of 1 A g−1, which is higher than carbon aerogels (155 F g−1).