A doctor can write you a prescription to get an EpiPen from a pharmacy. Before prescribing the drug, they may test you for allergies and monitor your symptoms. If you experienced an anaphylactic event in the past, make sure to let the doctor know what happened.