This study reports the construction of a novel SPME fiber based on chitosan and glutaraldehyde as coating material composites combined with high-performance liquid chromatography with an ultraviolet detector (HPLC-UV) for extraction and detection of phenobarbital. In this technique, the chitosan biopolymer, as a new coating of SPME fiber, was produced on the stainless-steel wire, using glutaraldehyde and phenobarbital as cross-linker and template, respectively. For comparison, a nonimprinted polymer was created using the same procedure to evaluate fiber selectivity (but without the addition of phenobarbital). The SPME-MIP fiber coating was characterized by field emission scanning electron microscopy, Fourier-transform infrared spectroscopy, and thermal gravimetric analysis. The efficiency of fiber was then improved by adjusting the impact of numerous factors such as pH, extraction time, desorption time, desorption solvent, and stirring rate. The results showed that the proposed fiber has a linear range of 0.01–4 μg·mL−1, and detection limit of 7.5 ng·mL−1. The average recoveries in the four concentration levels for the spiked river and well water samples were 95.7 and 95.3%, with relative standard deviations of 3.8 and 5.9% for single fiber and between fibers, respectively.