Background Human cytomegalovirus (HCMV) infection plays a crucial role in the development and progression of cancer. However, the effect of HCMV on colorectal cancer (CRC) remains controversial. This study was performed to explore the pathogenesis of HCMV in CRC. Methods HCMV DNA was detected in 74 CRC and paired normal samples by PCR. HCMV IEA protein expression was confirmed in 717 CRC biopsies by immunohistochemistry. HCMV gene expression profiles (GEPs) were further analyzed in 5 CRC tissues by transcriptome sequencing. The associations of HCMV infection with clinical features and prognosis were also evaluated. Results The prevalence rates of HCMV in CRC tissues were 29.73% and 23.17% at the DNA and protein levels respectively, which was significantly higher than those in normal tissues (0%). Transcriptome sequencing to evaluate the GEPs revealed 119 HCMV genes in CRC tissues. The high reads of transcriptions were RNA2.7, RNA4.9, RNA5.0, RL5A, UL82, UL83, and UL70, which correlate with gene expression or regulation. Survival analysis showed that patients with CRC patients and pIEA(++) had longer overall survival (OS) than those with pIEA(+)s at the protein level. However, there was no correlation between pIEA expression and clinical features. Conclusions HCMV, a common virus found in CRC tissues, is related to the development and progression of CRC. GEP analysis revealed genes correlated with lytic infection. Additionally, genes functioning in gene expression or regulation showed high expression in CRC. We found that CRC patients with HCMV lytic infection have a better prognosis than those with non-HCMV infection. Here, we revealed features of the pathogenic mechanism and provide insight that may be useful for targeted treatment of CRC.