A lot of people have phobias that they have a hard time getting over-- some people simply avoid facing them for most of their life, but sometimes people end up with one that deeply impacts their life. I'd say you can't avoid not sleeping at night, so you may not have a choice but to face this.
To be honest, it's going to be a hard thing to face, but you can do it!
Do you know where your phobia stems from? Let's be honest-- the dark is scary, because you can't see what's happening. Are you worried about something bad happening to you, or that something may try to harm you? Keeping a light on or having a trusted friend nearby can help reassure you that you're safe. If you can't have a friend nearby, talk to someone as a 'phone buddy'-- someone who won't mind if you call them up in the middle of the night who can talk to you until you calm down.
Do you sometimes have anxiety attacks? There are a lot of things you can do to bring yourself down from one. They're not pleasant and probably leave you more exhausted than avoiding your fear, but you may need to face some while working to overcome your fear. Make sure you research how to calm yourself down before you put yourself in an uncomfortable situation!
Also, if you have insomnia not directly caused by your fear (as you suggest in the tags,) you may want to talk to a doctor about getting on sleeping medication. Common insomnia can be countered with a careful diet and avoiding overstimulating things an hour before you head to bed, but sometimes medicine is the way to go. Try to ask for something non-habit forming if you choose to go down this path, and consider your options first. You don't want to have an anxiety attack over the dark while you're getting drowsier by the second!
I have a minor fear of the dark. It's not a phobia, but sometimes I get afraid to go to sleep or sit in a dark room. No matter what you do, don't be shy about turning on a light or sitting awake until you feel safe again. Do what you need to do to be healthy and happy, even if it means crossing over one heck of a rocky road.
Good luck! Deciding to face down your fear means you're already half way there. You can do it!