The aim of the cohort research was to study the association between chronic prostatitis and the probability of herpes zoster in Taiwan. Using the National Health Insurance Research Database (NHIRD) of Taiwan, we selected male persons newly diagnosed with chronic prostatitis aged 20-84 years between 2013 and 2020. These male persons were then matched with a non-prostatitis group who did not have a diagnosis of prostatitis by using 1:1 propensity score matching on age and relevant comorbidities. All participants were observed either until a new diagnosis of herpes zoster was noted or until the completion of the study period in 2020. Cox proportional hazards regression analysis was employed to study the hazard ratio (HR) and 95% confidence interval (CI) for the risk of herpes zoster associated with chronic prostatitis. A total of 69 239 participants with chronic prostatitis and 69 239 participants with non-prostatitis were included in the analysis. The incidence rate of herpes zoster was higher in participants with chronic prostatitis compared to the non-prostatitis group (8.03 per 1000 person-years for chronic prostatitis group versus 4.74 per 1000 person-years for non-prostatitis group, incidence rate ratio = 1.69, and 95%CI = 1.59-1.81). After adjusting for co-variables, participants with chronic prostatitis were found to have a higher risk of developing herpes zoster compared to the non-prostatitis group (adjusted HR = 1.69, 95%CI = 1.59-1.81, and p < 0.001). This cohort research suggests that people with chronic prostatitis may have a greater risk of developing herpes zoster compared to the non-prostatitis group in Taiwan. Preventive strategies, such as the administration of the herpes zoster vaccine, might be beneficial in people with chronic prostatitis.