It all began in September 2011, when Martin Lundberg sailed his boat into the marina in the fashionable Aker Brygge district in central Oslo, Norway.

A native of Malmö, Sweden, Lundberg had spent the summer on his boat moored off one of Oslo’s islands. He didn’t have a job, or a home other than the boat.

Sweat rituals are the oldest rituals we have. Millennials want something real. There’s so much fake in the world Lasse Eriksen

“He’s more of a bohemian. He was living on his boat, and living off fish,” says a friend, Hans Jørgen Hamre. “He hadn’t had a shower for months. He didn’t doubt there would be a sauna [in the marina]. He was looking forward to that. But there wasn’t one – or even hot water.”

Lundberg was hugely disappointed. Most ports in Sweden have saunas, where it is part of the popular culture; in neighbouring Finland saunas are practically a way of life. “And we didn’t have that in Norway.”

Hamre, a proud Osloite, suggested what he assumed would be a logical conclusion: that they build a floating sauna themselves. He found a group of people who were visiting Norway for temporary seasonal work, established a camp on a beach in nearby Hovedøya island, and set about the construction as a kind of gift to the city. After all, he reasoned, Oslo was in the process of transforming its waterfront.

Martin Lundberg, centre, waving, built the first public sauna in Oslo. Photograph: Courtesy: SBHA

Like many cities, Oslo has seen the fortunes of its harbour change dramatically. Forty years ago the area was full of warehouses and shipyards, and the water was heavily polluted. Then, in 1982, “our shipbuilding industry was shut down due to competition from Japan and Korea”, said Stein Kolstø of the city’s Waterfront Planning Office during the recent Urban Future global conference in Oslo.

The city faced a dilemma: keep a working port with several port terminals, or open the harbour and fjord to the public. In January 2000, Oslo city council chose the latter. Its “fjord city” plan has seen former port areas redeveloped, creating around 52 hectares of parks and public spaces, 9,000 apartments and 50,000 workplaces. A major highway that had acted as a physical barrier between the city and the fjord was closed, and rebuilt underground. Polluted soil was dredged from the fjord, and the cargo terminal was moved round the coastline.

Hamre assumed his DIY sauna would be welcome in this new, friendlier Oslo harbour. “On the outside of the sauna we used driftwood so it looked like it came out of the ocean,” he says, adding that the team sourced high-quality sauna wood from a local carpenter in exchange for doing some work for him. The idea was to make the sauna look like it had been washed up from the sea, but to create a clean, cosy, modern interior.

The result was a striking and charmingly odd sight: a low ramshackle shed made from a patchwork of mismatched wooden planks, with a large black chimney and a palm plant on one side, it fit just 12 people. Unlike many modern Scandinavian saunas, which are sleek, contemporary and tasteful, designed by architects rather than anarchists, the small vessel was made with “more of an artistic approach”, says Hamre.

Oslo’s ‘fjord city’ plan has created more leisure, work and living space in former port areas around the harbour. Photograph: Nattee Chalermtiragool/Alamy

But when they floated it into the harbour, the authorities saw it in a very different light. “There were a lot of people who saw it and [thought] it looks like a slum shack,” Hamre says. “The Swedish guy [Lundberg] was making art, and the Norwegians saw garbage.”

Speaking at the Urban Future conference, Kolstø recalled the reaction from the planning lawyers: “No, it’s forbidden, it looks too bad, it can’t be here.”

So Hamre and his team went on the run. They moved the sauna 14 times over the course of the year to different parts of the waterfront where it wouldn’t be seized. “We put it places that we knew the authorities didn’t have an eye on,” he says. Then they anchored it along a border between the jurisdiction of the municipality and the port authority, so that each thought it was the other’s problem.

“I was surprised we weren’t welcome,” says Hamre. “But the bureaucrats weren’t ready for initiatives like this sauna. It wasn’t in the regulations to receive floating saunas. It’s an industrial harbour and they’re supposed to handle industrial ships and they don’t like all this recreational bullshit.”

One day, however, the sauna’s fortunes changed: former footballer Freddy dos Santos Instagrammed a selfie next to it.

Suddenly it was hot property. The team met an urban developer working for the municipality who became an advocate, and a cold water swimming group of workers from the Ministry of Foreign Affairs suggested they could help file paperwork to legalise the construction.

One of those swimmers was Ragna Marie Fjeld, now director of the nonprofit Oslo Fjord Sauna (Sørenga Badstuflåte): “They didn’t have the resources to fight the bureaucracy, and do the applications, so we helped them. It’s difficult to get permission to stay in downtown Oslo, but we made it, because we know the bureaucracy. We know how to write applications and who to talk to.”

The sauna, called Måken (“Seagull”), was eventually legalised, and is run as a co-operative by Oslo Fjord Sauna. “We were the first to have a sauna for public use in modern times in Oslo,” says Hamre, a historian.

Others began to seize on the idea, and suddenly pop-up saunas – previously a typically private affair, something enjoyed at home with family or at a spa – were a public craze. Today Oslo Fjord Sauna now runs two floating saunas in the Bjørvika area, and has another two in the pipeline, while another business, KOK, runs three sauna boats. Further round the inlet is Salt, a cluster of tall wooden pyramids with food shacks, a bar, a concert venue and four saunas – the largest a huge glass-fronted amphitheatre where guests can listen to DJs and bands while they sweat.

“In the next few years there will be 10-15 saunas by the harbour for the public,” predicts Lasse Eriksen, Norwegian member of the International Sauna Association.

The new breed of public pop-up saunas is urban, social and popular with a younger crowd – Måken attracts a morning crowd of professionals in their 30s and 40s who head to work after an invigorating dip in the fjord. They have formed a key part of the reinvention of Oslo’s waterfront: the new Munch Museum, a 13-floor building covered in perforated aluminium, is due to open next year, as is the new public library, and a 9km harbour promenade and outdoor swimming area at nearby Sørenga is helping make this area busy with tourists and locals alike.

Eriksen believes the ritualistic and ancient nature of sauna has been adopted as a tonic by the city’s younger people because of the pressures of modern life. “Sweat rituals are the oldest rituals we have,” he says. “The millennials want something real. They have all these worries. I believe for them it’s about authenticity and finding something true and real. There’s so much fake in the world.”

People enjoy the Måken floating sauna in Oslo harbour. Photograph: Geir Anders Rybakken Ørslien

KOK, meanwhile, is exporting the floating sauna idea with a franchise model. “Our motto is, a bit jokingly, ‘Make the ports clean again,’ as we believe modern societies acceptance of sub-par water quality in our cities ports should come to an end,” says the firm’s founder, Kristin Lorange.

There remains an uneasiness around the recreational use of Oslo’s water: huge ferries and cruise ships dock on one side, at Vippetangen, and while the port of Oslo encourages swimming, paddling and sailing, safety is a major concern when people stray too close to docking areas. “It might be dangerous to be close to the ship fairway and docking areas,” says a spokesperson. “If you’re a big ferry you don’t expect people in your dock. We try to encourage people not to do that.”

The licences for the floating saunas are also temporary: Oslo Fjord Sauna, for example, has permission for its saunas to stay for one more year, though “we hope we’ll be able to stay here permanently”, says Fjeld.

Hamre is amused by how things have worked out. “What can I say? It’s the last laugh and all that. I go there all the time – I get a discount!”

As for Lundberg, who’s only contactable on his boat his via VHF radio, he’s now in the town of Moss, south of Oslo, building another sauna.

Follow Guardian Cities on Twitter, Facebook and Instagram to join the discussion, catch up on our best stories or sign up for our weekly newsletter