“My best friend doesn’t know my real identity”

So, I’ve known my best friend for two years now. I’m closer to him than I’ve ever been with anyone and he’s extremely important to me.

Two years ago when I met him I was using an alias to hide my real identity online, as I really don’t want people who know me irl to find me on my socials. I created a whole fake identity. Nationality, name, etc.

Now, I’m stuck in the lie. I’m so afraid I’ll lose him if I tell him I’ve been lying this long, but as someone who knows more about me than anyone else, I feel like he should at least know who I really am. Should I tell him? How should I go about it?