Papaver somniferum L. is an important medical plant that produces analgesic drugs used for the pain caused by cancers and surgeries. Recent studies have focused on the expression genes involved in analgesic drugs biosynthesis, and the real-time quantitative polymerase chain reaction (RT-qPCR) technique is the main strategy. However, no reference genes have been reported for gene expression normalization in P. somniferum. Herein, nine reference genes (actin (ACT), glyceraldehyde-3-phosphate dehydrogenase (GAPDH), cyclophilin 2 (CYP2), elongation factor 1-alpha (EF-1α), glyceraldehyde-3-phosphate dehydrogenase 2, cytosolic (GAPC2), nuclear cap-binding protein subunit 2 (NCBP2), protein phosphatase 2A (PP2A), TIP41-like protein (TIP41), and tubulin beta chain (TUB)) of P. somniferum were selected and analyzed under five different treatments (cold, drought, salt, heavy metal, and hormone stress). Then, BestKeeper, NormFinder, geNorm, and RefFinder were employed to analyze their gene expression stability. The results reveal that NCBP2 is the most stable reference gene under various experimental conditions. The work described here is the first report regarding on reference gene selection in P. somniferum, which could be used for the accurate normalization of the gene expression involved in analgesic drug biosynthesis.