Some people here have great ideas, but I also think this is a state of mind. I have been very solitary for most of my life but never actually felt lonely. I knew I always could connect with some people out there who were friends or family, but most of my time was spent alone because I preferred it that way.
There are always people nearby, whether they are in the physical world or online. It's difficult to really be alone when you can always reach out to people with today's technology.
I realized that the difference was within myself when I began to enjoy doing things, whether people wanted to join me or not. Going to movies -- alone. Going out for dinner -- alone. Going to a nightclub -- alone. Some people are terrified to do these things by themselves! I did all of these things and more, and found that many people approached me with ease because I wasn't in an intimidating group with friends. It opened me up to allow someone new to come over to me and say, "Why are you alone?" We'd have a conversation and I'd either make a new friend or have a pleasant experience talking with a stranger.
The more I did this, the more comfortable I felt about being alone. You have people around you, as we all do, but do you also like your company well enough? When you are comfortable with you, the rest falls into place without you even realizing it.
Having this sort of comfort allowed me to meet my husband years later. I married late in life. My attitude was that I would rather wait and have it be the right time with the right person, than rush into it because I was lonely and impatient.