There are two ways to overcome loneliness. One is by getting involved with other people so you neither are nor feel lonely; the other is by yourself, so that although you are alone, you don't feel lonely. Your question seems to rule out the first route, but the second remains open. Loneliness is not just being alone, it is being unhappy about it. And you may be able to bring yourself to accept being alone in a way that stops the unhappiness.
But I would recommend the first route if at all possible. And perhaps your question does not rule it out after all. For even if you are surrounded by other people you may feel lonely, and even though you are surrounded by other people you may need to overcome the feeling by yourself, or at least the impetus must come from you. But I think the way to do that is to engage with people and projects in ways that help you get rid of that lonely feeling.