Lactoferrin in milk is a multifunctional protein. In addition, lactoferrin has antiviral, antifungal and antiparasitic activity. In this study, the N-terminus from porcine lactoferrin (PLF-N) was designed to express the antimicrobial action of recombinant porcine lactoferrin. We cloned a 1077 bp fragment of the PLF gene from mammary gland tissue of the lactating sow at the third day. Comparing nucleotide sequence with four strains of PLF gene published on GenBank, the homology was more than 99%. With the reference template of the cloned fragment of PLF-N and optimizing codon bias, we synthesized the gene of N-terminus encoding porcine lactoferrin (PLF-NS). The high expression gene of PLF-NS was cloned into the fusion expression vector pET30b and expressed in E. coli BL21 (DE3). After induced with Isopropyl beta-D-1-Thiogalactopyranoside (IPTG), the target fusion protein was successfully expressed and identified in inclusion bodies by SDS-PAGE and Western blotting. The protein had a molecular weight of 42 kDa and accounted for 32% of the total cellular protein. After purification and renaturation, the purity of the expressed protein was 98%. The expressed PLF-NS protein showed obviously antibacterial activity. This method provides an excellent way for high expression of antimicrobial proteins when optimizing codon bias.