Behind the tree-crowded path, there's a splash, a round of cheers and, over the happy commotion, the deep dulcet tones of Rag'n'Bone Man. "Some people got the real problems," wavers the singer's soulful voice. "Some people out of luck…"

It's an apt soundtrack. We're in northern Italy, seven miles from the centre of Rimini, at San Patrignano – Europe's largest and most successful drug rehabilitation centre – and it is hot. Even under the shade of the bowed elms and leafy cypress trees, the pavement pulses with the midday Mediterranean heat. Behind the fences and creeping vegetation, a group of residents make the most of a well-earned break in the community's pool.

I'm being shown around by Danny McCubbin. Back home, he's Jamie Oliver's culture manager, but here, his role is the UK ambassador for San Patrignano. The centre is huge, and it doesn't just stop at the foliage-filled walkways and single-storey workshops we're meandering through now. Beyond the dusty orange buildings the clean, ordered lines of 250 hectares' worth of vineyards, heavy with the season's crop, roll up and out almost as far as the eye can see.

San Patrignano is one of a kind for many reasons – including (but not limited to) the fact that it's the only drug rehabilitation centre in the world to use commercial winemaking as a form of therapy. It might seem contradictory, but as turns out, it's a method that works.

The rehabilitation programme is completely free, mostly funded by the award-winning products and produce the residents put out

We're on our way to check out the cantina, or winery, where more than 500,000 bottles of the wine are made each year. As the distance grows, Rag'n'Bone Man's voice slowly starts to fade away, getting caught up and sucked into the verdant greenery that dominates the community's grounds: "I'm only human. I make mistakes…"

It might seem like we're taking the scenic route, but there's only one way to get there and it's through these winding, sun-beaten paths. San Patrignano sometimes feels more like a rural Italian town from the future than a drug rehabilitation centre, but there's no doubt that this is exactly what it is. This year the social enterprise celebrates its 40th birthday: it was founded back in 1978 by the late Vincenzo Muccioli and to date, it has helped more than 25,000 people struggling with substance addiction.

Residents come from all walks of life and come from all over the world. Right now, the community is home to around 1,300 boys, girls, men and women of various ages. There are some, like Thomas, a sharp boy from Chelsea, who found their way here thanks to the help of ambassadors such as McCubbin; and others who made their way here of their own accord, like Danny, a friendly South African who left his family to give himself and them the best chance in life.

At San Patrignano, residents aren't necessarily treated like they're sick. Instead, the centre's approach to rehabilitation draws parallels with occupational and cognitive behaviour therapy, while education, personal growth and trust-building exercises take the lead over traditional medicated 'treatment'. Residents are encouraged to be open and talk about their problems as they work with and alongside their peers. Every thought, habit and piece of behaviour is dissected, and the reason why they fell into drug abuse in the first place is challenged by those who have been through exactly the same situation.

"It's a very natural way of learning not to take drugs," explains McCubbin. "Some might cry for the first time in their life, whereas what they might do on the outside with those feelings is go and take drugs to mask them. The more emotions they can experience in a safe environment, the more ready they are to be outside the community."

But it isn't run like Alcoholics Anonymous, and the conventional 12 steps of abstinence don't get so much as a second thought. In San Patrignano's eyes, there's nothing to cure; the community goes by the idea that residents have just made poor choices, and now they're here to turn the page. The minimum length of stay is three years, but this is clearly a tried-and-tested length of time: San Patrignano's follow-up drug-free success rate currently sits around 72% – a stat independently verified by a number of universities. It's the highest in the world, and there are offshoot communities popping up in Scotland, Canada and beyond.

The rehabilitation programme is completely free for residents and the taxpayer – funded mostly by the high-quality, often award-winning products and produce the residents put out – but it's hard work. Days start at 6am and don't finish until well beyond 10pm; unless the room votes to skip that evening's social activities. There's no time for napping – even a light doze will land you in trouble.

it isn't run like Alcoholics Anonymous, and the conventional 12 steps of abstinence don't get so much as a second thought

It sounds like tough love – and it is – but everything about the programme is designed to teach self-control and independence, with the aim to equip residents with the necessary skills and experience to not just live within a group, but to live for the group. For this reason, no one is allowed to do anything on their own and often decisions, such as avoiding that evening's film screening so that they can go to bed early (an option residents have three times a week) rests on a conscientious, democratic vote from the dorm, made up of around 15 to 20 people.

Days are spent working in an assigned sector. There are 52 different trades that residents can learn across a number of sectors that could include anything from the dairy, which produces around 4,000 litres of milk a day; the bakery, which claims to make the best panettone in Italy; or in textiles, stitching for the likes of Chanel, or behind the loom helping on projects like that of Bethany Williams, a student at the London College of Fashion who worked with the community to create her boundary-pushing sustainable collection for last year's London Fashion Week.

The residents don't just work hard – they work to the highest of standards, too, and for that reason San Patrignano's clientele base is pretty impressive: they're currently hand-painting hundreds of metres of wallpaper for artist Jeff Koons' penthouse suite, and the week before, Kanye West was in the community to check out an art installation in the retired furniture-making workshop.

But if you're wondering why this drugs rehabilitation centre is teaching those with a history of substance abuse how to make alcohol, then it's time to turn to the cantina, a set of huge vaulted buildings on the edge of the community's grounds.

"Wine is a way to take dignity and respect in oneself," says Claudio, our guide and one of San Patrignano's winemakers. "When you drink a glass of our wine, you drink our hard work." He believes that you can use wine to educate people, and that working with the grape gives these residents a sense of perspective that other sectors don't have. "We know the story behind the glass. We know the vines in the winter when it's very cold and the grapes in the summer under the sun." He leads us past the tall vats of fermenting must and down into the belly of the winery. "On our body is written the story of wine. For this reason, it is very hard to fall into alcohol."

It makes sense to me. And as Tamsin Peachy, a consultant psychiatrist, later explains, the success of this operation lies in its ability to deliver "the whole package. The peer-to-peer support, the environment and the distraction opportunities get them to realise that there's more to life than just drug taking." She also believes that if you took the winemaking out of the equation, it's likely that the result would be no different: "it's about appreciating how to make things."

This is a sentiment echoed by Claudio when showing us around the winery's cavernous church-like ageing cellar. "If you stay here for a long time, all your patience with wine, yourself and all the world around you gets stronger." At San Patrignano, everything the residents make has a social significance, but nowhere is this more apparent than with its wine. Pointing to the community's collection – standing tall and proud against the back wall of the cellar's glittering glass tasting room – Claudio explains that, when they finish the programme, those who have worked in the vineyards take a bottle of its Avi bottling and gift it to their parents.

San Patrigano's Avi is dedicated to the community's revered founder Vincenzo. But more importantly, the vintage of the bottle matches the number of years the resident has stayed in the community. They take the Avi's sangiovese grapes, press them and age them, first for two years in the huge Slavonian oak barrels behind the tasting room, and then two years in the bottle. The cycle of the grape mimics the resident's journey, and as the wine matures, so do they.

The cycle of the grape mimics the resident's journey: as the wine matures, so do they

Although we're stood under the tasting room's glowing wine glass chandelier, we don't get to try it. The community stopped serving glasses of wine to the residents around two years ago out of respect for its new intake of residents, people who once struggled with alcohol, too. But we do get a taste of the montepirolo colli de Rimini cabernet sauvignon later that evening at SP.accio, an old post-office turned popular pizzeria just a few hundred metres down the road from San Patrignano's front gates.

The restaurant is one of two (the other, Vite, sits on top of the hill overlooking the cantina) run by the community. Residents of a certain level can go there to work for a small wage either in the shop, on the floor, at the bar or behind the pass, and all the food, including much of the produce, is made by members of San Patrignano. It's won the title of best pizza in Italy twice, but it doesn't take itself too seriously: SP.accio means 'shop' in Italian, but the name is a play on the word spacciatore, meaning drug dealer.

Where to get it

Where to get it

Japan is the biggest importer of San Patrignano's wine, but you can still find a selection in Fortnum & Mason and Jamie's Italian, and soon it will feature on the wine list at Alex Head's new restaurant Soane's Kitchen in Pitzhanger Manor in Ealing. The wine is distributed in the UK by Luca Dusi, who runs Shoreditch wine bar and shop Passione Vino. Rumour has it Dusi only represents winemakers whom he respects and befriends first. Talk about carefully curated...

The space is cheery and bright, and, as has happened more than once throughout our short time in the community, many of the staff come bounding over to say hello to McCubbin. Among them is a brilliant aspiring patisserie chef from Brighton named Naomi. Thanks to her time at San Patrignano she is now fluent in Italian and our pudding – a sharp smack of passionfruit coulis encased in a creamy sphere of coconut mousse – was made by her. It might just be one of the best desserts I have ever tried.

But that holds true for most, if not all, of the things I've seen at San Patrignano. The centre is full of talented, hardworking people creating incredible products and produce that don't only give a nod back to the community, but embody the positive spirit of it, too. Even our glass of montepirolo, ripe with juicy blackcurrant notes and a hint of pepper, seems packed with life.

And later, as we stroll back to our cabin through the dusky vineyards and rustling olive trees of the community, the unexpectedness of it all – the quality of the wine, the taste of the food and the resilience of the people we've met this weekend – lingers on well into the night.

sanpatrignano.org