Carbon materials derived from bacterial cellulose have been studied in lithium-ion batteries due to their low cost and flexible characteristics. However, they still face many intractable problems such as low specific capacity and poor electrical conductivity. Herein, bacterial cellulose is used as the carrier and skeleton to creatively realize the composite of polypyrrole on its nanofiber surface. After carbonization treatment, three-dimensional carbon network composites with a porous structure and short-range ordered carbon are obtained for potassium-ion batteries. The introduction of nitrogen doping from polypyrrole can increase the electrical conductivity of carbon composites and provide abundant active sites, improving the comprehensive performance of anode materials. The carbonized bacterial cellulose@polypyrrole (C-BC@PPy) anode exhibits a high capacity of 248 mA h g-1 after 100 cycles at 50 mA g-1 and a capacity retention of 176 mA h g-1 even over 2000 cycles at 500 mA g-1. Combined with density functional theory calculations, these results indicate that the capacity of C-BC@PPy is contributed by N-doped and defect carbon composite materials as well as pseudocapacitance. This study provides a guideline for the development of novel bacterial cellulose composites in the energy storage field.