It is significant to develop new adsorbents with excellent adsorption performance and convenient operation ability for removing pollutants from wastewater owing to the growing environmental problems. In this paper, a novel ultralight aerogel-based adsorbent with highly porous structure and good mechanical integrity was fabricated based on the interaction of amine groups on polyethyleneimine (PEI) and hydroxyl groups on cellulose nanofibers (CNF), with epichlorohydrin (ECH) serving as a crosslinker. The obtained CNF/PEI aerogel showed excellent water stability in harsh conditions, fast water-activated shape recovery, and ultra-fast water transport. The adsorption capacity for methyl orange (MO) in batch can reach to1226 mg g−1 at pH 6. Furthermore, the membrane also exhibited excellent selective adsorption and filtration, and separation performance. Therefore, this paper presents a new strategy to prepare low-cost and highly efficient adsorbents to remove organic dyes from wastewater for potential practical applications.