Whether valacyclovir-associated neurotoxicity (VAN) occurs more frequently in patients with end-stage renal disease (ESRD) on dialysis is unknown. This is the first population-based study to examine the risk of VAN associated with ESRD patients on dialysis. Among 2,284,800 patients diagnosed as having herpes zoster from 2002 to 2016, patients with ESRD on dialysis and individuals with normal renal function were enrolled in this study. Following propensity score matching, we compared the risk of altered mental status between valacyclovir users and non-users in the ESRD and normal renal function cohorts over a 30-day follow-up period. In the ESRD cohort, the incidence of altered mental status was 1.68 and 0.52 per 1,000 person-day in valacyclovir users and non-users, respectively, with an adjusted hazard ratio (HR) of 3.22 (95% confidence interval [CI]: 2.04–4.99, P < 0.001). The incidence of altered mental status of valacyclovir users on hemodialysis (HD) and peritoneal dialysis (PD) was higher than that of non-users. The adjusted HR was 3.20 (95% CI: 1.98–5.15, P < 0.001) for those on HD and 3.44 (95% CI: 1.13–10.49, P = 0.030) for those with PD. However, altered mental status was not observed in patients on HD receiving ≤500 mg of valacyclovir three times per week or in those on PD receiving ≤500 mg of valacyclovir per day. The findings demonstrate that adjusting the valacyclovir dosage and monitoring VAN in patients with HD and PD who have herpes zoster is crucial.