Bacteria-based vaccines have received increasing attention given the ability to induce strong systemic immune responses. However, the application of bacteria as therapeutic agents inevitably suffers from infection-associated side effects due to the living characteristics. Here, the use of bacteria-derived flagella is described to construct self-adjuvated nanofiber vaccines. With the help of charge-reversal mediated by decoration with cationic polymers, the flagella can be coated with negatively charged antigens through electrostatic interaction. By virtue of the large aspect ratio, the resulting nanofiber vaccines show prolonged retention at the injection site and increased uptake by dendritic cells and macrophages. Thanks to the innate immunogenicity, self-adjuvated flagella robustly promote dendritic cell maturation and macrophage polarization, resulting in the elicitation of antigen-specific T-cell and B-cell immune responses. In ovalbumin-overexpressing melanoma-bearing mice, immunization with ovalbumin-carried vaccines not only exhibits a favorable tolerance, but also displays superior inhibition efficacies on tumor growth and metastasis separately under the therapeutic and prophylactic settings. The flexibility of this approach is further demonstrated for vaccine fabrication by coating with the SARS-CoV-2 Spike protein S1 subunit. Bacterial flagella-based self-adjuvated nanofiber platform proposes a versatile strategy to develop various vaccines for disease prevention and treatment.