The aim of this study was to explore the risk of Simplex virus type 1 (HSV-1) in patients with insomnia. This study applied a population-based retrospective cohort design. A total of 50,210 patients aged ≥ 20 years who had received a diagnosis of insomnia between 2000 and 2015. They were identified according to the corresponding International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM) code. The control cohort comprised 100,420 age-matched and sex-matched patients. Data from the Taiwan National Health Insurance Research Database were employed from 2000 to 2015. The overall incidence of HSV-1 in the insomnia cohort was significantly higher than that in the comparison cohort (3.10 vs 0.33 per 1000 person-years). Patients with insomnia had a higher risk of HSV-1 infection, compared with the comparisons (hazard ratio (HR) = 4.33, 95% confidence interval (CI) 2.18-5.58). For individuals divided into 3 age groups (≤40, 41-65, and >65 years old), the HSV-1 infection risk of the insomnia cohort was significantly greater than that of the comparisons. As the duration of insomnia increases, the risk of HSV-1 occurrence decreases.