Last year was one of the happiest of Nicola Roberts’ life. She signed off on the repossession of her home in Surrey and moved to London, close to friends, into a “gorgeous, French-style apartment, with flowers and plants everywhere and so much light,” she says, eyes widening. She had 12 months of trauma therapy, which she describes as “the best gift I ever gave myself”. And she won one of the leading roles in the West End production of the musical City of Angels, which opens in March.

We meet at a canalside bar in London just before Christmas. “Prior to this year, I’d say I had five of the unhappiest years of my life. Just really tough emotionally,” she says. There was a long period in which an ex-boyfriend harassed and stalked her, which led to his prosecution in 2017, all of which “took a massive toll on my life”, she says. “I had a few heartbreaks along the way. I was kind of ground down.” Roberts says that just two years ago she would not merely have lacked the confidence to audition for her new role – “I actually would have been terrified for it to be in the public domain that I was going to be in the same space every night, because I was fearful for my safety”.

In Josie Rourke’s award-winning production of City of Angels, Roberts plays Avril, an actor, and Mallory, the character Avril is playing. Her acting coach has had to remind her to exaggerate: to make her gestures big enough, declarative enough, to reach the back of the house. Roberts, 34, tiny in a black satin tracksuit, shrinks at the thought. “It goes against everything in me. I like everything to be natural … believable.”

This instinct for subtlety is not synonymous with most pop stars – particularly pop stars who started out on TV talent shows. But Roberts has always been different. She entered the limelight in 2002, aged 16, by auditioning for the singing competition Popstars: The Rivals while on a family holiday after her GCSEs. She became the youngest member of the band Girls Aloud, who won the show. They went on to have 21 Top 10 singles, including four No 1s; two of their five albums topped the charts.

(Left to right) Sarah Harding, Roberts, Nadine Coyle, Cheryl and Kimberley Walsh of Girls Aloud in 2002. Photograph: balkanpix.com/Rex/Shutterstock

Roberts was one of the group’s most recognisable faces, known as the alternative one, set apart from the other four not only by her red hair and pale skin, but by her measuredness and taste. She was often described by interviewers as “sulky” or “reserved”.

There were health difficulties – hypoglycaemia and anaemia – exacerbated by the gruelling performance schedule. And there was grotesque bullying over her appearance. When Matt Willis from the band Busted called her a “rude ginger bitch” in 2003, she made a stand, painting his words on a skirt, then performing in it. In 2007, Lily Allen called her “the ugly one” from Girls Aloud, while Chris Moyles, who was then a BBC Radio 1 DJ, insulted Roberts for years, calling her the “ropey-looking ginger one”, “horsey chops” and a “sour-faced old cow”. (Moyles made a non-apology in 2012.)

Today, Roberts downplays the impact on her self-esteem, but she marvels at how beauty standards have changed. In 2008, she launched a makeup line, Dainty Doll, to cater for those with a pale complexion. “I struggled all the time to find makeup that was light enough,” she says. The palest available shade would be “five shades too dark – but, again, that was because of beauty trends at the time. People weren’t pale. Everyone was on the sunbed and using fake tan ... It’s just crazy now, isn’t it, to think that?”

Early in her career, Roberts had tried sunbeds. But after presenting a BBC Three documentary about the health risks in 2010, she joined the then Labour MP Julie Morgan’s campaign to ban under-18s from using them; the law was introduced the following year.

For Roberts, the legacy of Girls Aloud is her friendships with her bandmates Kimberley Walsh and Cheryl (with whom she continues to collaborate; she co-wrote Cheryl’s recent singles). “Kimberley and Cheryl are really like my roots – there’s such a deep thread there. We’ve gone through everything together. Everything.”

The group went on hiatus in 2009 to allow each member to pursue solo projects. Roberts changed management, ended a six-year relationship and experienced a sort of delayed adolescence. She also released her debut solo album, Cinderella’s Eyes, in 2011, informed by her struggles to fit in. It was widely acclaimed by critics for its musical idiosyncrasies and lyrical insight – in the ballad Sticks + Stones, Roberts sang of “being told I’m ugly, over and over” and pleading with her driver to buy her vodka to help her cope.

Kimberley and Cheryl are really like my roots – we’ve gone through everything together

The band split for good in 2013, after their 10th-anniversary tour, and Roberts was finally outside the long-standing group dynamic. Roberts has always been “emotionally independent”, something she credits to being the eldest sibling of four. “I just handle everything myself,” she says. But she was forced to accept the limits of that approach when she was stalked by a former partner. From 2012 to 2017, Carl Davies – an ex-soldier Roberts dated seriously before an acrimonious split in 2008 – sent Roberts thousands of messages over Twitter and Instagram, including some that were described in court as “violent and threatening”. Davies also sent proclamations of love and had flowers delivered to Roberts’ manager’s office.

Roberts never replied, but she documented 3,000 messages over five years, only going to the police in 2017 when Davies started contacting her friend, the R&B singer Joel Compass. For a long time, Roberts says, her approach to the harassment had been to “process it and process it and process it myself … until it just became explosive”. She wrote in her victim impact statement that the messages had been a reminder of “all the terrible things” in her relationship with Davies: “It was like walking on eggshells.”

In May 2017, Davies admitted one count of stalking and another of persistent use of public communication networks to cause annoyance or inconvenience, for which he was handed a 15-month suspended prison sentence (meaning he served no time). He was also given a lifetime restraining order, prohibiting him from contacting or approaching Roberts or any member of her family. His defence said Davies had suffered post-traumatic stress disorder after serving in Afghanistan and noted that Roberts had not told him to stop sending the messages.

Just a few months after his sentencing, Davies was accused of breaching the restraining order by following Roberts on Instagram – but the Crown Prosecution Service dropped the charges on the advice that there was little chance of a conviction. In 2018, the CPS apologised for that decision, which Roberts’ lawyer said reflected a “lack of understanding” about social media.

Roberts says of the apology now: “It was too late. That’s the first time in my whole life, I am extremely fortunate to say, that I ever felt [I’d been done] an injustice because I was a woman ... I felt genuinely begrudged, like something extremely unfair was placed upon me, because I was a woman. And it was a horrible feeling.

Roberts (centre) on stage with Girls Aloud in 2005. Photograph: Dave Etheridge-Barnes/Getty Images

“I think sometimes certain behaviour of men is seen as normal or usual – but it’s never normal or usual to the victim, ever. It’s horrific.”

Does she have any closure now? “It’s behind me in my everyday life, and that has been a blessing. It’s behind me in that I don’t have, like, a paranoia that I had before. I don’t feel scared.”

When the messages started, anticipation was high for a follow-up to Cinderella’s Eyes, but years of fearing for her safety took a “massive toll” on Roberts’ confidence. “To have these bloody messages, life-threatening messages, every day – it just ground me down. I’m happiest when I’m being creative, with a project to work on – but I just couldn’t. I’d sit with the pen and go to write and I’d be like: ‘This. Is. Shiiit.’ Like: ‘I can’t get out of me what I want to get out.’”

Two changes enabled her to move on. The first was “getting out of that house” in Surrey, where she had felt so afraid. In October, she signed off on the repossession of the £1.25m home; she had been trying to sell it since 2017, slashing the price to £825,000.

Roberts says now that she was “scared to be there”. “It was a prison – a horrible, horrible prison … I’d just had enough.” Moving to London, closer to her friends, has made a “massive contribution” to her happiness.

But most transformative was her year of trauma therapy. Before this, Roberts says, she had a tendency to put her feelings in a box, then set them to one side. “It got to a point where I was compartmentalising everything … the box just got full.” She laughs, before continuing. “I was like: ‘I don’t want this to affect me any more – it is my responsibility to make me happy.’”

In therapy, there was no way of separating out the different parts of her life and herself. She draws a parallel with getting a neck massage: “They start doing your back and you’re like: ‘I don’t want my back done,’ and they’re like: ‘Well, you gotta do your neck to do your back, y’know?’

“We opened all the boxes. I feel like it’s just changed me in the most amazing way, for ever.”

Watch the video for Roberts’ song Sticks + Stones.

In the past, Roberts was “a fixer” in relationships – not any more, she says. She has developed her boundaries. “It means that you take all the red flags that pop up extremely seriously and you turn around and walk the other way, straight away. Things that maybe you would tolerate before, or things that you would [explain away and] be like: ‘Oh, you know, it’s because they’re ...’

“I have been too unhappy and I am now so happy – I will never let anything disrupt that. So unless you are continuing with me in this happy, peaceful state, you’re not getting near me.”

Roberts is single now, but open to a relationship with the right person. The bar is set high. “I don’t like the feeling of being unhappy. I don’t like the feeling of being unsure about myself, or uncertain with where something’s going – I would rather turn away. I just can’t feel like that ever again. It’s just horrible.”

For now, she is focusing on her career. Roberts decided 18 months ago that she wanted to act, but she waited long after signing with an agent for the right debut project – “right” meaning “nothing too happy or too obvious”. She says she is “not really a girl that you can just throw into anything – it has to really resonate with me in order for it to work”.

New music may be on the way, too: Roberts makes passing reference to having been in the studio with Fred Ball, a producer for Rihanna, Beyoncé and Jay-Z. She won’t be drawn on specifics, but she says she and Ball have known each other for years and that he had commented on how “calm and different” she seemed. “And I could honestly say: ‘Yeah – I just feel happy.’”

Roberts says that, perhaps for the first time, she is gaining weight. “I have boobs, I have a bum,” she says delightedly. “I threw out 17 pairs of jeans – can’t get them past my thighs. But I welcome it. I always just had a sort of nervous energy running through me, no matter how much I ate … When I eat spaghetti every day, it makes a difference now, whereas it didn’t before – but I love it.” She catches herself, rolls her eyes. “Like, if I see a picture, I’m like: ‘OK, mate – don’t get too excited.’”

Roberts does not feel angry about the past five years. “I feel sad that it happened to me,” she says. “But I feel like it led me to do therapy and the therapy has been the best thing I could ever have done for myself. It’s honestly just changed me so much, and I’m so thankful for that.

“Equally, you know, I don’t want this to read that I’m thankful for that period of time, because I’m definitely not.” But without therapy, she says, “I wouldn’t have got to this place, who I am now. I’m calm. I’m confident again. I’m excited.

“I’ve had a lot of relationships in my life that weren’t quite on the same frequency as me. Romantic, career-wise, friendships – I needed to just leave some behind to then make room for people who really got on my wavelength.”

She has learned something important about herself. “The therapist did say to me I was one of the most resilient people she’d ever met. I was like: OK.” She looks, fleetingly, happy and proud – then returns to her resting temperature, characteristically cool. “I mean, it might be something she says about everyone.”

City of Angels is at the Garrick theatre, London, from 5 March to 5 September