Cellular polymer nanocomposites can combine high mechanical performance with low density. However, the manufacturing of porous nanocomposites into complex shapes can represent a challenge. Therefore, this article deals with the preparation, characterization, and 3D printing of porous nanocomposites. The filaments were extruded from the polymer nanocomposite filled by thermal chemical blowing agent, and then processed by 3D printing into the required shapes. In‐situ and post‐treatment foaming strategies were investigated and compared. The nanoparticles (NPs) significantly affected the processing, structure, thermal and mechanical properties of polymeric foams. The NPs, serving as a nucleating agent, allowed preparation of smaller pores and led to finer and more homogeneous foams. At the same time, they reinforced foam walls and thus improved mechanical properties. Moreover, NPs catalyzed decomposition of the blowing agent grains at lower temperature which brought about faster and more efficient foaming. This study showed the straightforward approach to prepare mechanically robust lightweight 3D printed materials.