
How Trash-Eating Flies Can Tame Dangerous Floods in Kenya’s Capital
Garbage blocks many drains and waterways in Nairobi, worsening the effects of flooding. Residents are breeding millions of flies to consume that waste and help keep streets and homes dry.
This is the fifth story in Climate-Proofing Cities, a series that explores how cities around the world are adapting to the impacts of global warming. Read about Beira, Mozambique’s cyclone warning system; why São Paulo is planting rain gardens by the hundred; how Boulder, Colorado, is warding off wildfire; and Frankfurt’s efforts to capture airflow to stay cool.
For most urban dwellers, flies are a nuisance to be kept in check with screens, swatters and traps. But in the Mukuru area of Nairobi, Kenya’s capital, they are being cultivated for a surprising purpose: to help tame increasingly destructive flash floods.
Enter one fly farm, located in a church compound, and you’ll be greeted by fetid odors. A peek at a nearby plastic tray reveals why: Clumps of larvae wriggle around decaying food waste. The greenhouse-like facility breeds a common species known as the black soldier fly, tens of millions of them at a time, to feed on tons of rubbish brought in from around the neighborhood that might otherwise choke drainage channels.
“These flies are soldiers in waste management,” says David Kinyanjui, 43, an operator of the experimental farm, standing next to a rack of trays.
While flash flooding can occur anywhere that experiences bursts of intense rainfall, the risk is amplified here by heaps of garbage that block storm drains and natural waterways. Of the 2,500 tons of waste Nairobi generates daily, only one-third is collected for proper disposal. In Mukuru, where about half a million people cook, clean, sleep and work every day, there is no regular waste collection at all.

A collection of informal settlements sitting on the Nairobi River’s floodplain south of the city center, Mukuru is prone to torrential rains that occur more and more often under a changing climate. As rural Kenyans migrate to Nairobi in search of work, open spaces and rivers have increasingly given way to unplanned construction, leaving rainwater nowhere to go.
The drainage ditches of Mukuru are like a slow-moving showroom of discarded items, with plastic bags, food scraps and, on a recent visit, a torn life jacket drifting away in ink-black wastewater. Every time it rains, the trash becomes a liability. In May, when catastrophic rainfall battered the district, “there was flooding almost everywhere,” Kinyanjui recalls, in part because of the clogged ditches. He spent days draining flood water out of his home. But Kinyanjui is still lucky—the flood killed dozens of his neighbors.
As climate change disrupts weather patterns, scientists say that flash floods will likely get “flashier,” meaning the water level rises higher, faster. That’s an increasingly common scene around the world. In 2022, nearly a month’s worth of rain fell in London in an hour, flooding about 1,000 buildings. Last year, the heaviest rainfall in 139 years hit Hong Kong, stranding cars and submerging subways. And in April, downpours in Dubai unleashed a deluge that brought the city — together with the world’s second-busiest airport — to a standstill.
Governments worldwide are expanding and retrofitting infrastructure to withstand future flooding, but that requires time and a big budget. Take New York. The city estimated in a 2024 report that to protect its high-risk areas alone, roughly $1 billion would be needed in stormwater system upgrades for each of the next 30 years.


While advanced economies may be able to afford that kind of outlay, poorer nations such as Kenya cannot. More than 5 million people now call Nairobi home, yet the city’s decades-old drainage was designed to serve only one-tenth of that number, making it all the more important to maximize existing infrastructure.
Hence the enlisting of black soldier flies to battle garbage in Mukuru — a pilot funded by the Netherlands-based Global Center on Adaptation. The organization has bankrolled the creation of 10 fly farms in the area, including Kinyanjui’s.
“This kind of innovative solution is really, really appealing,” says Lisa Dale, a climate change adaptation specialist at Columbia University. “I don’t think we’re ever going to be in a place where we can say we don’t need more gray infrastructure — that’s just not where we are,” Dale adds, but “it offers an additional tool in the toolbox.”
Found on every continent except Antarctica, black soldier flies are playing a growing role in waste management across Africa. While scientific studies have long proven that under the right conditions, the flies can process organic waste faster than conventional composting, researchers are just starting to understand their co-benefit of urban flood control. To that end, Mukuru’s experiment could offer an invaluable case study for global cities to assess the approach’s effectiveness and determine potential limitations.
For Kinyanjui, rearing black soldier flies means frequently knocking on his neighbors’ doors. Twice a week, he and his 10-member crew visit alleys of corrugated iron shacks to collect organic waste. They also stop at food stands and community farms to gather more. Organic waste — an umbrella term for all biodegradable refuse — is the main culprit behind Mukuru’s trash accumulation.










“If you’re able to deal with organic waste, you’re able to deal with almost three-quarters of the total waste,” says Patrick Njoroge, deputy director at Akiba Mashinani Trust, a Nairobi nonprofit that advocates for fly-based waste management. (Njoroge says that of the remaining trash, roughly 20% is recyclables, such as plastics and metal, that can be sold for a fee, but the community has yet to find a solution for diapers, spent batteries and other toxic waste, which accounts for nearly 10% of the total and often ends up on the street.)
Back at the farm, Kinyanjui turns on a blender to grind organic waste into smaller pieces. The team then adds reagents — including probiotics and molasses, a thick syrup that sweetens the waste and masks its smell — to prepare a meal for fly larvae.
Over the next 14 days, a tray of larvae will consume as much as 10 kilograms (22 pounds) of such meals. “They’re like an army,” Kinyanjui says.
The two weeks of non-stop feeding transform the larvae from a size smaller than a grain of rice to the length of a person’s fingernail. As they eat, they leave behind nutrient-dense manure that can be sold as organic fertilizer. Since Russia’s invasion of Ukraine drove up fertilizer prices worldwide, Kenyan farmers have been in search of more affordable alternatives, spurring the demand for fly manure.
Air-dried fly larvae — protein-rich and cheaper than traditional animal feed — have also turned heads of the country’s pig farmers. So the fly farm operators let a small portion of the larvae reach their maturation and reproduce (the black soldier fly has a 45-day life cycle from egg to adult), while the rest will head to the market.
The farm has yet to break even since its debut in June, but Kinyanjui says he is confident that it will make a profit as the production scales. Once it reaches its full potential, it is expected to handle 6 tons of organic waste each month and yield $970 worth of fly byproducts, according to Akiba Mashinani Trust. That will enable the farm to cover its operating costs while providing much-needed income for local youth who have grappled with Kenya’s double-digit unemployment rate.
If all goes as planned, Mukuru’s fly farms might also be able to avoid the fate of many other adaptation projects, which end once initial funding dries up for lack of a sustainable business model.
“This is just the beginning of the journey,” says Patrick Verkooijen, chief executive officer of the Global Center on Adaptation. The group is considering replicating the Mukuru model elsewhere. Globally, more than 1 billion people — about one in four urban dwellers — live in informal settlements facing similar struggles. Mukuru’s success, or failure, will “provide very important lessons, not just for Nairobi or Kenya but for the Global South in its totality to reap the benefits of working with nature, as opposed to working against it,” Verkooijen says.

Feeding fly larvae with trash doesn’t come without its issues, however. For instance, if someone mistakes a lead-acid battery as organic waste, the resulting contamination could potentially enter the human food chain through fly-based fertilizer and animal feed, says Benjamin Wilde, a researcher at Cornell University who studies waste management in Africa.
“There is some uncertainty around this,” Wilde says.
To ensure that only “clean trash” becomes fly food, Akiba Mashinani Trust and its NGO partners host workshops teaching Mukuru residents how to properly separate their waste. The farm operators also re-examine collected waste and remove unwanted items before placing everything into the blender.
Yet other hurdles stand in the way of wider adoption. For one, the buildout of a single fly farm costs nearly $7,000 — a considerable upfront investment in a country where the per capita gross domestic product was less than $1,950 in 2023. While black soldier fly larvae are known for their insatiable appetites, they respond to different organic contents differently, which, in turn, affects the rate of their waste processing.
“It can be difficult to identify and source the waste that’s necessary [for an efficient operation,]” Wilde says. “This is a limiting factor.”
Mukuru currently has four fly farms in operation and is on course to add eight more by the end of September, according to Njoroge of Akiba Mashinani Trust. Once all the farms are put into use, they could handle as much as 72 tons of organic waste per month — a major improvement from today, yet still less than 5% of all the trash the neighborhood produces, Njoroge says.
It also remains to be seen to what extent reduced waste can translate into reduced flooding. But there are early signs of positive changes.


On a sunny afternoon in August, Janet Mutungi, 25, was frying potatoes at her food stand when a fly farm operator visited. She handed over a bag full of potato peels, which she says she would have otherwise dumped into a drainage ditch.
While the main advantage to Mutungi is not having to dispose of the scraps herself, she says there could be other benefits, too. With less waste piled up near her stand, she hopes that floodwater will disappear faster than ever, allowing her to cater to customers shortly after it rains. By contrast, the knee-deep water in May put her out of business for an entire week.