THE Bralima brewery in Kinshasa, the capital of the Democratic Republic of Congo (DRC), is an island of modernity in a city where chaos is the norm. Inside a building near the docks where barges begin the journey up the Congo river, conveyor belts rattle as thousands of glass bottles are washed and filled with amber liquid. A generator hums to power the new brewing machinery, creating enough booze to fill 28,000 crates every two days.

Yet the real achievement of Bralima, which is owned by Heineken, a Dutch brewer, is not making the beer. It is what happens when it leaves the factory. Congo is one of the worst-connected, most dysfunctional countries on Earth. Four times the size of France, it has almost no all-weather roads. In large parts of eastern DRC, the state is a fiction and rebels control the roads. Yet there is scarcely a village where it is impossible to get a beer.

Bralima was founded in 1923. Its main competitors, Bracongo and Brasimba, both owned by Castel, a secretive French family firm that operates across Africa, have been there almost as long. They are among the only surviving companies from the colonial era. By his fall, and the start of the first Congo war in 1997, Mobutu Sese Seko, Congo’s flamboyant post-independence dictator, had looted almost everything else. Today Congo is falling back into conflict. Can the industry survive? And what can other companies learn from it about doing business in such a trouble spot?

Almost every other processed food in Congo is imported. Milk is brought in from France. But beer is patently local. Bralima, including its sales and the production of its raw materials, accounts for 2% of GDP, reckons its boss, Rene Kruijt. That is far less than mining, which makes up 22% of output. But with about 2,500 workers, the firm claims it is the biggest private-sector employer in the country. Primus, its main brand, labelled in the light blue and gold of the national flag, is “a source of national pride”, says Mr Kruijt, not implausibly.

Castel’s operations may be as large. The two compete fiercely. David Van Reybrouck, a historian of Congo, records how just a few years after a peace agreement in 2003, Bralima was instructing its marketeers to fight a war for business.

During the worst of the fighting itself, the real war and the war for business were arguably intertwined. Some even talk about “conflict beer”, on the same lines as conflict minerals. In 2013, when M23, a new rebel movement, emerged, two academics, Jason Miklian and Peer Schouten, estimated that third-party truckers selling Bralima’s beer might have been making payments to rebel groups of as much as $1m a year.

Today, no large towns are rebel-controlled but the work is almost as difficult. In 2012 Castel opened a brewery in Beni, a small city in the north-east of the country, at a cost of $125m. A year later, Beni suffered the first of dozens of massacres that have killed up to 1,000 people over the past five years. The roads out of the city are among the least secure in the world. Nonetheless, Tembo and Skol—Castel’s brands—are sent from Beni to markets far and wide.

Even moving in the peaceful parts of the country is expensive. Travelling 1,000km can take a lorry three weeks, at a cost of thousands of dollars. Producing beer in the DRC is also pricey. Heineken estimates that the cost of water alone is five times that in neighbouring Congo-Brazzaville. Even in Kinshasa, electricity is unreliable, making the Bralima generator—big enough to power a small cruise liner—necessary. They in turn have to be fuelled with imported fuel. And then there are the taxes and shakedowns.

Yet the companies also have impressive marketing and distribution operations. Beer companies in Congo are huge sponsors of music (so too are mobile-phone companies). The most popular stars can command large sums in exchange for endorsing Primus or Tembo—so much so that it has corrupted Congolese musicians, complains Lexxus Legal, a rapper. Meanwhile, the firms’ distribution networks are unparalleled. On the Congo river, barges operated by Bralima are among the only vessels left operating a regular schedule. Outside of the big cities, distribution is outsourced—presumably to people able to limit the extortion.

Can it last? In February, Heineken declared a €286m ($353m) impairment loss for 2016 in Congo, after closing down two of its factories. In western Congo, Angolan beer in cans—less tasty but cheaper than Primus or Tembo—has flooded the market. It is not sold at cost since the smugglers’ main aim is to acquire dollars to trade on the black market in Angola. In the east, as Joseph Kabila, Congo’s president since 2001, refuses to leave office, the violence is worsening. In South Sudan, another conflict-ridden failed state, the only brewery was forced to close in 2016. The South Sudanese now drink beer imported from Uganda and Kenya.

But in all likelihood, brewing in Congo will survive. Without Primus or Tembo, Congo would hardly be the same place. Even in wartime, the music plays—and who can listen to rumba without a beer?