Antimicrobial peptides (AMPs) are small-molecule polypeptides that occur widely in nature, have a broad antibacterial spectrum, and do not induce drug resistance in bacteria. Therefore, they are potential substitutes for antibiotics. However, there have been few reports of the production of the AMPs secreted by diatoms. Phaeodactylum tricornutum is a model diatom species for which protocols for its transformation are well established, and it can be directly used as fish and shrimp bait. In this study, we used P. tricornutum as a cell factory to produce secreted AMPs extracellularly. We also constructed an expression vector containing the secretory promoter and signal peptide of the Scygonadin gene, and successfully expressed AMPs in P. tricornutum, confirmed at the levels of DNA, RNA, and protein. Bacteriostatic experiments showed that the secreted AMPs exerted an obvious antibacterial effect on Kocuria sp. and Trelief5α Chemical Competent Cells. This study demonstrates that P. tricornutum effectively expresses and secretes AMPs with obvious antibacterial effects.