The coffee white stem borer, Xylotrechus quadripes Chevrolat (Coleoptera: Cerambycidae), is a major destructive pest of Coffea arabica L. (Gentianales: Rubiaceae), widely planted in many Asian countries, including China. Quantitative real-time polymerase chain reaction (qRT-PCR) is a common method for quantitative analysis of gene transcription levels. To obtain accurate and reliable qRT-PCR results, it is necessary to select suitable reference genes to different experimental conditions for normalizing the target gene expression. However, the stability of the expression of reference genes in X. quadripes has rarely been studied. In this study, the expression stability of nine candidate reference genes were investigated under biotic and abiotic conditions for use in qRT-PCR's normalization. By integrating the results of four algorithms of NormFinder, BestKeeper, geNorm, and RefFinder, the optimal reference gene combinations in different experimental conditions were performed as follows: RPL10a and EIF3D were the optimal reference genes for developmental stage samples, EIF4E, RPL10a, and RPS27a for tissue samples, V-ATP and EF1α for the sex samples, EIF3D and V-ATP for temperature treatment, RPS27a and RPL10a for insecticide stress, and RPL10a, RPS27a, and EF1α for all the samples. This study will help to obtain the stable internal reference genes under biotic and abiotic conditions and lay the foundation for in-depth functional research of target genes or genomics on olfactory molecular mechanisms, temperature adaptability, and insecticide resistance in X. quadripes.