The deuteron injector developed for the PKUNIFTY (Peking University Neutron Imaging Facility) has been installed and commissioned at Peking University (PKU). The injector system must transfer 50 keV 50 mA of D(+) ion beam to the entrance of the 2 MeV radio frequency quadrupole (RFQ) with 10% duty factor (1 ms, 100 Hz). A compact 2.45 GHz permanent magnet electron cyclotron resonance (PMECR) ion source and a 1.36 m long low energy beam transport (LEBT) line using two solenoids was developed as the deuteron injector. A φ5 mm four-quadrant diaphragm was used to simulate the entrance of RFQ electrodes. The beam parameters are measured after this core with an emittance measurement unit (EMU) and a bending magnet for ion fraction analysis at the end of injector. During the commissioning, 77 mA of total deuteron beam was extracted from PMECR and 56 mA of pure D(+) beam that passed through the φ5 mm four-quadrant diaphragm was obtained at the position of RFQ entrance with the measured normalized rms emittance 0.12-0.16π mm mrad. Ion species analysis results show that the deuteron fraction is as high as 99.5%. All of the parameters satisfy PKUNIFTY's requirements. In this paper, we will describe the deuteron injector design and report the commissioning results as well as the initial operation.