There is a difference between "getting connected" (through technology) and avoiding loneliness. I don't think technology has made us closer - but the opposite might be true. Loneliness has become a problem exactly because people nowadays spend too much time communicating with their gadgets - and this might be weakening their ability to create and maintain meaningful relationships.
One of the reasons why I moved to Morocco is because at some point i felt that social relationships were quickly deteriorating in the after-Brexit UK. People there are not going out to pubs to meet other people - people different from themselves - they prefer to stay at home typing with those who they already have intelectual/emotional affinity. Intolerance raises from this avoidance. Social Media is definitely NOT SOCIAL. This pattern of behaviour has created a generation of self-centered misanthropes, unable to develop deep relationships. In the UK people feel ok to avoid each other for any reason, and common courtesy has been replaced by so called "political correctness" (in my case I believe there was some xenophobia involved, but not only - the "open society" has exposed each of us to the sight and the judgment of the majority - privacy is a luxury we no longer have in "the West"). Not that I blame Social Media entirely (politics also plays a role), but I believe this platform of communication has made people behave in a more selfish, egocentric and anti-social manner. It has affected our brains! I recommend you to read the book "The Shallows", by Nicholas Carr.
So, my main advice: Quit Social Media, get out of your computer, and start talking to strangers.
My other suggestion is: appreciate your loneliness the best you can. It is ok to be with your own thoughts. Try to adventure in the wilderness. Book a trip in order to interact with strangers. If that doesn't work, go to a cafe and talk to the nearest person to you. If you are not comfortable about interacting with locals, I recommend you to find another country to live.
Morocco doesn't provide the same "hostile environment" that now is growing in Europe and elsewhere - and it is easy to get to know people here, and despite some cultural differences, locals are much more open to accept your particularities than most of the countries I've been to. hat's why I love Morocco - people here seem to be immune to the political paranoia that took over "the West". Try not to focus only on meeting expats - try the locals. There are so many good locals! If that doesn't work - a good massage will probably satisfy your need for human contact (and put you in a better mood).
Regards,
Anoush.