To express the antimicrobial peptide cecropin D in Pichia pastoris and determine the activity of the expressed product, four oligonucleotide fragments were synthesized in accordance with the available cecropin D sequences and a codon bias suitable for Pichia pastoris. Sequence fragments were phosphorylated, annealed, linked and cloned into the expression vector pGAPZαA and the yeast α-mating factor signal peptide was used as the signal sequence. The P. pastoris SMD1168 cells were transformed by electroporation using the constructed recombinant plasmid pGAPZαA-cecropin D. We were able to demonstrate by PCR that the cecropin D sequence had integrated into the P. pastoris genome. The expressed and secreted product was identified using Tricine-SDS-PAGE. Antibacterial activity was demonstrated using an agarose diffusion test and turbidimetry. The molecular mass of the recombinant cecropin D was estimated to be 3,900 Da. The recombinant cecropin D exhibited antibacterial activity for both Gram-positive and Gram-negative bacteria, suggesting that cecropin D was successfully expressed in P. pastoris. This approach holds great promise for antibacterial drug development.