Acyclovir is used to treat infections caused by certain types of viruses. It treats cold sores around the mouth (caused by herpes simplex), shingles (caused by herpes zoster), and chickenpox. This medication is also used to treat outbreaks of genital herpes.