Antonio Pinto’s makeshift home on the outskirts of Manaus is an open-air shack, one of dozens of similar dwellings of timber and tarpaulin scattered around the hills.

Around them is the evidence of the use of flame and iron: the hills are scorched and brown, littered with fallen logs and toppled, twisted trees.

Pinto, 57, moved here earlier this year from an isolated Amazonian river town, 18 hours away by boat. He’s sick and needed to be closer to a hospital to get regular treatment.

“I’m indio,” he said, meaning indigenous. “There’s a bunch of indigenous people here.”

Manaus should be an example to the world of how man and nature can live together, but unfortunately that’s not the case

Not long ago, this area was covered in pristine Amazon rainforest and native shrubbery. In 2015, a group arrived and began clearing the land using chainsaws and fire. Today the settlement is known as Monte Horebe, and is home to about 5,000 people.

It is the largest of dozens of shantytowns in this jungle metropolis, population 2 million. Dubbed “invasions”, these informal settlements are expanding outwards into the forest: in 2018 authorities identified a new occupation attempt every 11 days on average.

The threat to the rainforest is severe. Communities such as Monte Horebe cause deforestation and enormous environmental degradation. “There are a lot more bugs here and it’s hotter now [after the forest clearances],” said Nara Sampaio, 31, a resident of nearby Live Better, a federal government complex housing 55,000 people.

“Manaus should be an example to the world of how man and nature can live together, but unfortunately that’s not the case,” said Marcos Castro, a professor at the Federal University of Amazonas.

Informal community Monte Horebe, which borders the Adolpho Ducke reserve. Photograph: Sam Cowie

Critics say the clearances are also the result of a government failure to address a chronic shortage of affordable housing. As the economic powerhouse of the Brazilian Amazon, Manaus attracts thousands of migrants each year.

Many of the poorest end up in informal housing such as Monte Horebe. According to the Manaus environment secretariat, at least 100 football pitch-sized patches of forest and vegetation have been destroyed to make space for squatters to build homes. Monte Horebe borders the Adolpho Ducke reserve, one of Brazil’s largest preserved urban forests.

As a kid, I used to swim in the igarapés. That’s impossible now

The trees are not the only concern, however, said the city’s environment secretary, Antonio Nelson de Oliveira. “Deforestation is, of course, bad, but it can be resolved by planting more trees. Cleaning polluted waters is a lot more complex,” he said.

Untreated waste and rubbish from the occupations usually ends up in Manaus’s hundreds of igarapés – little rivers – that snake across the city. Today, all are polluted.

“As a kid, I used to swim in the igarapés. That’s impossible now,” said the mayor, Arthur Virgilio Neto.

Igarapés flow into the Rio Negro, the city’s main river and primary water supply. The smaller tributaries are important for maintaining healthy soils, and if blocked can lead to serious flooding during rainy seasons.

Garbage and sewage disposed directly into a river in Manaus. Photograph: Ricardo Funari/Brazil Photos/LightRocket via Getty Images

Nevertheless, migration continues to increase, recently fed by new groups of Haitians and Venezuelans fleeing civil strife. Manaus is the capital of Amazonas state, a vast area more than five times the size of Germany that is home to the world’s largest remaining tropical forest reserves.

In the interior towns, however, jobs are scarce and traditional ways of life such as fishing and family farming are becoming more difficult. Public services, schools and hospitals are often far away.

But housing in Manaus proper is expensive and in scarce supply, leading many people to build their own informal accommodation on the forest’s edge.

It’s easy to blame drug traffickers and poor people. But this is a long-term problem

Sebastiana Cruz, 43, who works in a shopping mall, came here to escape expensive rent in 2015. She says the housing deficit feels unaddressed. “The mayor never visited,” she said. “Politicians only come when they want votes.”

According to Brazil’s Institute of Geography and Statistics, Manaus needs an additional 128,000 homes. The deficit takes into account currently existing stock that is substandard or unaffordable, but also the need for more housing overall.

“You could fix much of the irregular occupations problem by building more low-income housing,” said Virgilio Viana, CEO of the Sustainable Amazon Foundation.

Complicating matters, local government authorities said occupations are typically led by organised crime groups. Monte Horebe is controlled by the city’s most powerful drug gang, the Northern Family, which was was recently accused of ordering a bloody prison massacre that killed dozens. The group controls large swathes of the city

Residents of the Betania slum use a makeshift walkway to avoid garbage floating on floodwaters in Manaus. Photograph: Amazonaspress/Reuters

“Today, the force of the invasions is much stronger than the forces to protect against them,” De Oliveira said, arguing that security and combating crime should be first priority.

Castro argued that the problems are symptomatic of successive government failures. “It’s easy to blame drug traffickers and poor people,” he said. “But this is a long-term problem.”

Manaus itself was built largely informally. In the 1970s the city’s population began to swell with the opening of a free trade zone that was home to thousands of factory jobs.

“But the government was unable to cope with the demand,” said Castro.

He emphasised that while squatter communities like Monte Horebe indeed cause enormous environmental damage, luxury condominiums and factories also dump waste into rivers, and noted that the vast majority water in Manaus goes untreated.

Many believe the situation can only get worse. One factor cited is a plan to reopen the dilapidated highway connecting the Manaus to Porto Velho. Currently, Manaus is mostly only accessible by plane or boat; the 870km highway fell into disrepair decades ago. Now the authorities have signalled that they plan to reopen it, many fear Manaus’ migration and housing crisis will be aggravated, leading to more occupations.

“The fact that Manaus is isolated kept people out to a certain extent,” said Philip Fearnside, an American biologist who has lived in Manaus since the 1970s.

The extreme weather effects of the climate crisis are also only likely to exacerbate the environmental degradation, Viana pointed out.

“It’s an extremely worrying scenario,” he said.

Additional reporting by Fábio Oliveira

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