Personally, I would say that being alone and being lonely are two wildly different things.
I'm my best around other people. Mental & emotional thing. I'm just a much f*ckin better person. On top of that, I need, crave, fierce contact with other people. Huge physical piece to it. That said? I'm usually alone -at present- but rarely lonely. ((The inverse has been true, too... Lonely as hell, in a dang sea of people.)) For me, lonely isn't about who I've got in my life. Or not. It's about my own head & heart.
Also for myself, I do stupid shit when I'm lonely. Hang around people I shouldn't, or at least definitely wouldn't, if I weren't lonely. That's all different kinds of bad juju. Walked that particular road down to stone. Desperation? Nah. Not a place I want to be. Not for the results I need/want in my life.
So when I take those 2 pieces together? First step to solving lonely isn't adding people to my life. It's about getting good with myself in my life. Then adding people. When I can do so on a huge smile & grateful for when shit works out, instead of bawl or rage in disappointed ickiness when shit doesn't work out.
At that stage? The article on the homepage, about how to go about breaking out of isolation, is pretty much where I start.