Last September, I visited Greta Thunberg's Nordic homeland. When I arrived in her hometown of Stockholm, I just missed the celebrated young Swedish climate activist as she’d departed by solar-powered yacht to attend the UN Climate Summit in New York. But I did come to understand why Sweden is a global leader in the tourism-sustainability movement, and why Gothenburg, its second-largest city, has been named a European Capital of Smart Tourism 2020 by the European Commission.

Located on Sweden’s scenic west coast, the former industrial port town was not always so environmentally conscious. That changed in the mid-1980s, when Sweden’s minister of the environment, Birgitta Dahl, toured Gothenburg and declared the decaying and dirty blue-collar city “a courtyard to hell”. Properly chastened, political and business leaders vowed to transform the gritty 17th-Century city into a beacon of urban sustainability.

That effort, in part the result of widespread community engagement, seems to have worked.

Today, Gothenberg is a glass and cast-iron greenhouse with towering palms and exotic plants. It is blue-and-white electric trams scooting along the streets, past locals riding bikes. It is roasted coffee, craft beer, some of world’s best seafood and a dozen varieties of vegan “milk”. It is Dutch-built canals, lush urban parks and cobblestone streets, where you can walk from your hotel to shopping, restaurants and nightlife. It is a ferry that takes you across the Götaälv river to a free sauna and public pool, where the water is cleaned entirely without chlorine and the changing rooms are made of recycled bottles.

Greta is a really important voice in our time

It is no wonder that, for three years in a row, Gothenburg has been declared the world’s most sustainable destination by the Global Destination Sustainability Index. Even its once-grungy harbour has been cleaned up. In 2011, the port received the Shipping Award for Regional Environmental Contribution, and was the first in the world to provide onshore power to vessels at berth, reducing carbon emissions.

You may also be interested in:
Why Sweden is relocating an entire town
The glitzy European city going green
The Swedish word poached by the world

Because of Thunburg’s global presence in the climate crisis that started with her 2018 protest outside the Swedish Parliament, I wondered about Thunburg’s influence in Gothenburg. “Greta is a really important voice in our time,” said Katarina Thorstensson, head of sustainability at the local tourism board, Goteborg & Co. “Of course, she affects us all, in different ways. I think the travel industry in Gothenburg is well aware of the importance of sustainability, since we’ve been working quite a while with these issues. But Greta has clarified the urgency of levelling up in all industries.” Notably, Thorstensson said, she is “bringing courage to young people to raise their voice.”

That was evident even during my visit, when Thunberg tweeted “Goteborg!” with the hashtags #ClimateStrike and #FridaysForFuture to cheer on the hundreds of activists protesting in late September.

During my visit, I encountered Gothenburg’s sustainability ethos from the moment my train from Helsingborg slid into the Central Station. With its convenient location, the city’s main transportation hub was steps from my hotel, the Clarion Hotel Post, a grand old post office with elements of its original architecture. The local tourism board touts that more than 90% of its hotels are eco-certified, meaning they must meet environmental and sustainability standards set by regional organisations, and here, tiny shampoo bottles, plastic cutlery and straws were long gone, a sign of the hotel’s drive to forgo plastic.

Nearby Hotel Eggers, Sweden’s third-oldest hotel, has similarly been remodelled in Greta-like fashion, sourcing its electricity from its own wind turbine on the coast and strictly regulating fossil fuels, chemical products and waste.

On my hotel rooftop, I discovered an organic vegetable garden planted by urban farmers as part of an emerging “hyperlocal” produce movement. Visitors to the city can join urban safaris to learn more about local food production on a tour of the city’s several urban farms and gardens, such as Kajodlingen, a commercial vegetable farm atop a pier in the industrial area of Frihamnen.

One of Gothenburg’s advantages is its intimacy and accessibility. To explore the compact city, I had many eco- friendly options. I could rent a bike from Styr & Stall, a bike-sharing system with 72 stations. I could try an electric scooter (and get praised via the app for choosing this “carbon-neutral” ride). I could hop on one of the city’s 260 electric trams, many of them named after famous Gothenburg citizens, or enjoy the sights from a quiet, zero-emission electric bus. Currently, 65% of Gothenburg’s public transportation hums on renewable energy, with the goal of making it fully electric is by 2030.

The other choice I had was to walk, which I happily did.

Gothenburg wouldn’t be truly green, of course, without its proximity to nature. Surrounded by thick forests of linden and beech, the city offers a hefty 274 sq m of green space per citizen. The Botanical Garden and Slottsskogen, the city’s most beautiful parks, are wonderful to explore. At the latter, you’ll find tranquil meadows and wooded paths, Sweden’s only free zoo and the Goteburg Natural History Museum, which, oddly enough, claims to have the world’s only full-size taxidermy blue whale.

More recently, the city has created Gotaleden, a new and extensive hiking path that starts in Gothenburg and links up with various train stations along the 71km route. The end point is the small town of Alingsas, often described as “the capital of Swedish fika” (a beloved Swedish ritual, where people pause during the day to gather with friends over coffee and cake) as it has the most cafes per capita in the country.

Along the way, you can stop in the town of Floda to visit the much-loved restaurant Garveriet, which has a locally sourced organic menu and a “zero-waste” policy. The restaurant is also part of an innovative program called “meet the locals”, where visitors can experience the Swedish lifestyle and the region’s little-known sights and activities through residents.

True to the city’s green image, Gothenburg residents have avidly embraced sustainable fashion. You can find much of it in the charming neighbourhood of Haga. Thrive, for instance, sells only natural, organic or recycled clothing that is free of toxins and unfair labour practices. Nudie Jeans, the international brand that launched its successful line of sustainable jeans from Gothenburg, is located here, too. Flea markets abound, and they’re a great way to mingle with locals. The largest one, Megaloppis, occurs in the trendy Majorna district at the end of May.

As with its fashion and hotels, eco-friendly restaurants are also easy to find. Vegetarian restaurants are plentiful, and a law requires that all meat sold in the municipality must be organically farmed. (KRAV, a regional organisation, certifies restaurants for animal health and toxic-free farming; look for KRAV-labelled eateries to confirm you’re being good to the environment.)

Taverna Averna, a KRAV-endorsed Italian bistro in an old auction house, grows its own vegetables on the roof. Upper House, a one-star Michelin establishment, is perched on the 25th floor of the Gothia Towers, a huge luxury hotel and convention centre. Besides its magnificent view, the restaurant also maintains a roof-top garden and a beehive, with its honey used to sweeten cocktails served in the bar. Koka, another celebrated restaurant, plans its menu around the seasons, working with local farmers and seafood producers to provide the freshest ingredients. A recent seven-course menu featured, among other dishes, scallops with elderflower and leek followed by lingonberries with ice cream, mustard and caramel.

But can Gothenburg maintain its lofty vision of sustainability, I wondered? Change was evident everywhere. As I walked towards the harbour from the historical town centre, past old buildings, alfresco cafes and small specialty shops, the skyline suddenly transformed. Glass and steel structures rose above the waterfront, and building cranes pierced the sky.

Next year will be the 400th anniversary of Gothenburg, and the city has been busy preparing – running workshops with young people, hosting sustainable urban design conferences and consulting residents on sustainability projects that enhance life for locals. It seems like they’re well prepared.

“This work started in 2009, with focus groups and dialogue with the people of Gothenburg,” said Eva Lehmann, head of public relations for Goteburg & Co.

One of the most exciting projects is Jubileumsparken, an urban park unfolding in the working-class Frihamnen neighbourhood, near the outdoor pool and sauna. The goal is to make the area a green and dynamic part of the inner city. Local residents have been busy designing new activities and projects here, including a “rain” playground for children built to accommodate the region’s frequent downpours. “This is a new approach to urban development, with people allowed to gradually take over the area and make it their own,” Lehmann said.

Still, this building boom could dramatically change the city’s intimate feel, and perhaps even its ambition to create a greener city. RiverCity Gothenburg, a multi-million-dollar redevelopment project with office towers, apartments and shopping, is springing up along the waterfront. The massive construction is intended to house the city’s anticipated 250,000 new residents over the next 15 years.

But Gothenburg seems to have planned for challenges to its sustainability goals, too. You have only to peruse the city’s blueprint for the future  – including efforts to tackle the rising sea levels predicted in the next decade and prevent the river from flooding – to know they’re working on it.

Comeback Cities is a BBC Travel series that showcases under-the-radar capitals, champions the urban underdogs and revels in the success stories of cities that have turned their fortunes around.

Join more than three million BBC Travel fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "The Essential List". A handpicked selection of stories from BBC Future, Culture, Worklife and Travel, delivered to your inbox every Friday.