It’s 10.32 on a Friday night and I am staring at the glow of my iPhone screen. It is almost three hours since I checked in to social media. It is also more than two months since I left the house. After falling ill with flu complications in January, I have been at home recovering, too ill to go outside or even to have visitors. Everyday social interactions – going to the pub with friends or chatting in the office – have become phantoms, replaced by four walls and my (disappointingly dull) inner monologue.

Instead, I have turned to the internet: browsing “wish you were here” photos on Instagram; reading the details of a friend’s week on Facebook Messenger; keeping up with news on Twitter; receiving “get well” emojis on WhatsApp. When it comes to my mental health, social media has been invaluable.

This is an increasingly unpopular opinion. The Cambridge Analytica scandal has made an unprecedented dent in the appeal of social media, with #DeleteFacebook embodying this mood shift. Even before this, it felt as if the tide was turning against social media, with piece after piece in the traditional media (including the Guardian) advocating a “digital detox”, as if the internet were now a poison to be purged. There are apps dedicated to helping users break their online habit, with trackers such as Moment promising to measure how much time you spend looking at your screen.

There are plenty of good reasons for this unease. The revelations about Facebook’s data harvesting make it hard to see such platforms, or time spent on them, as harmless fun. There are also valid concerns about the impact on mental health, particularly where young people are concerned. One US study found that teenagers who use social media and the internet the most are twice as likely to be unhappy. I worry increasingly that I feel a discomforting twitch if my phone isn’t near me day and night.

But I can’t help but wonder if only privileged people can afford to take a position of social media puritanism. For many, particularly people from marginalised groups, social media is a lifeline – a bridge to a new community, a route to employment, a way to tackle isolation.

“Without social media, life would be so much harder,” says Philip Green, 56, from London. Green has arthritis in his spine, as well as mental health problems, and lives with severe pain that means going out to socialise is often impossible.

“I’m relatively lucky to have some really good close friends, but my most frequent communication with them is via Facebook or WhatsApp,” he says. Because he lives on disability benefits, he can rarely afford a trip to the cinema or lunch with friends. “On top of this, if I get a flare-up of pain, all plans have to be cancelled.” This sort of isolation is a common experience: recent research showed that almost half of disabled people in Britain are “always or often” lonely.

Hannah Hodgson, from a hamlet on the outskirts of Lancaster, agrees. “My world would be tiny without the internet, especially on days when my body makes me a prisoner in my own bed,” she says. “I’d be lost without it.” The 20-year-old was diagnosed with a life-limiting condition as a teenager – she has intestinal failure and hearing loss and collapses several times a day. As her friends went off to university, she found herself stuck at home with her parents in a tiny community.

Hannah Hodgson talks about her illness and shares the news that her community has grown to 2,000 subscribers.

In response, she used YouTube to create a community for people with rare health conditions, which a year later has more than 2,000 subscribers. “Off the back of my YouTube channel I’ve started a letter-writing PO box, where people can send me letters if they feel lonely or like they could do with a friend,” she says. “I have friends down south, even one in Australia, and I feel very loved [even] when I have never physically met a lot of my friends.”

If social media can facilitate friendships for people such as Green and Hodgson, it can also give a sense of power and opportunity to those who might otherwise lack it.

For Alice Strick, social media has created new communities and a dream job she thought she would never have. The 28-year-old was unable to complete her art degree in 2011 due to severe depression and borderline personality disorder and she worried that her mental health had “totally scuppered” her chance of success as an artist. Unable to find an art workshop she could afford during her recovery, she used Facebook to set up her own; after others shared the event, 1,000 people asked to attend. Now, 18 months later, putting on workshops for women with mental health problems is Strick’s full-time job. After forming a connection via Instagram, she has been commissioned to hold one at the Tate. “Without social media, I wouldn’t have had a career that I love and I’m proud of,” she says. “I wouldn’t be so far along in my mental health recovery.”

As a mixed-race woman, Strick also uses Twitter to be part of a community she has struggled to find offline (“I’ve always felt I don’t really belong in white or Indian communities,” she says). Many LGBT, BME and disabled people tell similar stories.

Ruth Sullivan, from Brighton, has used social media to find what she calls her “little niche part of the queer community” after struggling in the local club scene. “On Twitter, the bi community is way more visible and I’ve been able to find people to chat with and celebrate those elements of myself I felt were keeping me on the outside,” she says.

My world would be tiny without the internet, especially on days when my body makes me a prisoner in my own bed Hannah Hodgson

When Laura Elliot, 26, fell severely ill in 2016 with intermittent paralysis, vertigo and joint dislocations, she found a disability community online to tell her she wasn’t alone. “As the months went on, and doctors kept telling me it was stress, disabled and chronically ill people on Twitter were an absolute lifeline,” she says. Elliot, who lives in Sheffield, has since been diagnosed with the rare condition hypermobile Ehler‑Danlos syndrome. Although mostly housebound, she has used her journalism degree to start a politics podcast from her bedroom, working with disability activists online to campaign about everything from universal credit to wheelchair provision.

“Before I became unwell, I was quite critical of people who were always on their phones,” she says. “Without social media, I’m not sure I’d still be here today. I’m not sure how I’d have stayed sane.”

This is the paradox of social media and mental wellbeing. While social media can exacerbate problems – Green, for example, takes breaks during periods of heightened anxiety – it can also improve one’s mental state. Sullivan, who has depression, credits Twitter with saving her life when she felt suicidal in 2009. Having become isolated in the offline world after signing off sick from work, she began speaking regularly to people online. One day, she made a suicide plan and stopped logging in. “Those people who’d been with me every day, some hour by hour, realised that I wasn’t around and worked out how to reach out to me by phone,” she says. “Without those strangers online, I wouldn’t be here today.”

Despite its evident benefits, social media still has a way to go to improve the experience for marginalised groups. Laura Kalbag, author of Accessibility for Everyone and part of the Indienet initiative to create “a more equal internet”, says that, as in other areas of society, marginalised groups are most vulnerable to potentially unethical practices such as data harvesting. “They’re often less likely to have the resources and time required to seek out the technology that is least harmful to them,” she says. “Much of this is a result of the majority of mainstream technology being designed and built by wealthy, white, straight, non-disabled, cis men from similar backgrounds, building products either to benefit people who are exactly the same as them or to attempt to exploit people who are not.”

Further progress will come by making the internet more accessible. “We assume the internet is open to all when it’s not,” says Astra Taylor, author of The People’s Platform: Taking Back Power and Culture in the Digital Age. For example, disabled people are less likely to have online access (in 2017, more than one-fifth of disabled people in the UK had never used the internet, compared with only one in 10 of the adult population overall), while people from poorer and rural areas are often excluded from high‑speed broadband.

“The first level [for improvements] is getting people online in a real way – a phone really doesn’t suffice if you need to apply for a job or do your homework,” Taylor says. “In addition to the problem of connectivity, the platforms and services we use have minimal incentives to be truly accessible. Every travel navigation service should immediately offer accessible routes. Every image should have a visual description. Every video should be captioned.”

For Kalbag, dealing with the concerns about social media will lead to improvements for all of us. “We must regulate, and extend our laws, to protect people from the worst harms caused by these businesses. And we must fund and build alternative, ethical technology, including ethical alternative social media platforms,” she says. “It’s not realistic to tell people they should just leave social media, which has become vital social infrastructure. We have to give people a place to go.”

Green is concerned about the Cambridge Analytica reports, but he is wary of quick calls to quit Facebook. “As with much in life, the choices people can make come down to privilege,” he says. “I don’t have the luxury of simply signing out, as I’d once again become isolated.”

In the UK, Samaritans can be contacted on 116 123. In the US, the National Suicide Prevention Lifeline is 1-800-273-8255. In Australia, the crisis support service Lifeline is 13 11 14. Other international suicide helplines can be found at befrienders.org