Image caption Charcoal-powered coffee machine - living in a recovering failed state like Somalia means being innovative

At The Village Restaurant, a popular open-air hangout for Mogadishu's returning diaspora community, a charcoal-powered Italian espresso machine brews Somalia's best cappuccino.

Wi-fi internet beams throughout the cafe, as patrons check email, download music videos, and keep tabs on Somalia's latest news.

As Mogadishu shifts from two decades of civil war to a quivering democracy, opportunities for business - from hotels to off-grid espresso makers to cafes like the Village - are flourishing. And so too are the opportunities for bringing them online.

Perched between the tattered ruins of a flattened landscape, the glow of wireless receiver antennas has gradually replaced the orange glow of stray bullets, bringing a new era of global connectivity and freedom of information to the city's estimated one million residents.

In 2000, Somalia was one of the last African nations to get online. Since then, the internet industry here has seen as much turbulence and turnover as the country itself.

Image caption Many Somalis and people of Somali descent who have been living outside the country as part of the global diaspora community are returning to the troubled state to open new businesses

According to Abdulkadir Hassan Ahmed, general manager of Global Internet Company, Somalia's largest internet provider, at least 17 internet companies in Somalia have gone under in the past decade.

It's a tough job. All the time, companies are coming in and going out Abdulkadir Hassan Ahmed, Global Internet Company

"It's a tough job," Mr Ahmed says. "All the time, companies are coming in and going out."

Global Internet Company, founded in 2003 by a consortium of Somalia's leading telecom companies including Hormuud and NationLink, provides dial-up, DSL and some point-to-point wireless.

Yet even Mr Ahmed admits his own company's connections can be slow and expensive. After nearly 10 years in business, Global Internet is almost profitable, he says, but is more of a loss leader for telecoms.

Unlike Somalia's thriving telecoms sector, where two decades of lawlessness, lack of regulation, and cut-throat competition for an increasingly mobile market have driven services up and prices to rock bottom (less than one cent per minute), internet in Mogadishu has been archaic.

Dial-up is the cheapest option, at around $30 (£18) a month per computer, but is painfully slow - less than 56kbs - and highly oversubscribed, according to many.

Image caption Internet penetration in Somalia still stands at just 1.14% of the population - but as the infrastructure improves that is expected to rise sharply

Direct satellite subscriptions cost as much as USD$3,000 per month for one-megabyte connections, and can be unreliable.

'Top dollar'

Yet with increased security, things are turning around.

"People used to complain that 'Mogadishu has no internet'," says Liban Egal, an American-Somali and founder of Somalia Wireless, Mogadishu's newest wireless internet provider.

"It's not that there wasn't internet," Mr Egal explains, "It's that you couldn't get what you wanted out of it."

Somalia Wireless, which launched in April, hopes to find the middle ground in this Mogadishu market, by offering both pooled (shared) and dedicated connections.

"We are trying to build an infrastructure for internet connectivity in Mogadishu," says Omar Osman, Somalia Wireless' chief executive, by first "focusing on organisations and institutions that can pay top dollar" and eventually moving down the pyramid to offer a broader base of customers cheaper, faster and better internet.

Image caption Mustafa Yare and his brother Ali Hassan's business is doing well - welcoming around 40 customers per day

According to Mr Osman, Somalia Wireless' hotspots now cover nearly 40% of the city, connecting universities, NGOs, hotels, news agencies and cafes. The company broke even last month.

Internet penetration in Somalia still stands at just 1.14% of the population - on par with Afghanistan - but demand in Mogadishu is growing rapidly.

"Demand is increasing by the day," says Mr Ahmed. In today's Mogadishu, he says you need internet "like you need food".

For the burgeoning private sector and a youth finding themselves free from the social constraints of al-Shabab, connecting the city is key for growth. Local entrepreneurs are already taking advantage of Mogadishu's new broadband access.

A report by Somali Telecommunication Association (STA), in 2006, stated that the country had more than 234 cyber cafes, growing at a rate of 15.6% per year. One can only guess the number in Mogadishu today.

Image caption Computer Science students at Benadir University use the web to work on learning assignments

In September, brothers Ali Hassan, 20, and Mustafa Yare, 22, opened Kobciye Internet Coffee, a sweltering tin-roofed internet cafe with eight computers, and a deal from Somalia Wireless.

They are part of a shared wireless "pool" with nearby offices, and their bandwidth increases in the afternoon when offices close.

"I wanted a business," Mr Hassan says, "and this is something that I'm good at, I have skills in computers and IT."

Youth unemployment stands at 75% in Somalia, so any job is a good job.

The cafe costs around $600 (£373) a month to run, with electricity accounting for nearly half of expenditure. Still, the brothers managed to eek out just under $1,000 (£624) from their 40 or so daily customers - enough to keep things running for another month.

Most people, Mr Hassan says, "come for Facebook".

Facebook has taken off in Somalia since Islamist militants al-Shabab fled the city several months ago, loosening social restrictions and making the streets safer.

New accounts have grown by 50% in the past six months, and there are now more Facebook users than estimated internet users in Somalia, thanks to mobile phones and computer sharing.

Safia Yasin Farah, a young Somali-American who now works with the Centre for Research and Dialogue (CRD) in Mogadishu, says Facebook allows Somalia's youth to express their opinions freely, without being afraid.

"Many are illiterate, but are actually learning through Facebook," she adds.

Image caption As in much of the world, Facebook is one of the most popular destinations for Somali web surfers visiting the Kobciye Internet Coffee cafe.

Young ambition

Dr Abdirizak Ahmed Dalmar, president of Benadir University, one of dozens of private universities in the capital, recalls his first day teaching in Mogadishu a few years ago.

"When I finished my first lecture, one student came to me and said 'can you give me your email', another one said 'which website can I go on'.

"And then I saw them playing with their mobiles, Facebook pages, etc. I know these youth have the same aspirations as any youth anywhere in the world. They just need the opportunity."

I know these youth have the same aspirations as any youth anywhere in the world. They just need the opportunity Dr Abdirizak Ahmed Dalmar, President, Benadir University

With donor funding Benadir University set up its own satellite system, with facilities for video-conferencing with partner universities abroad.

But six months on, that funding has run out, and Benadir cannot pay the $3,000 per month fee. So a deal was struck with Somalia Wireless, who have installed a receiver antenna on their roof.

'We are ready'

For Mogadishu, wireless broadband is just the beginning.

A few hundred kilometres off the coast three fibre optic cables, already fuelling Kenya's tech boom, lie waiting to be connected.

But security has been an enormous challenge. With pirates still controlling the seas, no one has been willing to cover the cost of insurance to bring the cables to Mogadishu.

Many of Somalia's telecom companies are hedging their bets on the future of fibre in Mogadishu.

"In the next six months, we'll start building the local loop for fibre," says Mr Egal. According to him, it will cost around $1,500 (£936) per kilometre in Mogadishu, an investment he's willing to make.

Mr Ahmed, of Global Internet, says his company's involvement in fibre depends on how the government regulates it.

"If there's room for private sector," he says, "we are ready."

Image caption Sam, an Kenyan engineer with Somalia Wireless, installs a wireless receiver antenna on top of Benadir University

Yet it is a risky investment.

Somalia's first real government in 22 years is now being tested, and though Mogadishu's long-time residents and returning members of the Somali diaspora alike are incredibly optimistic, the city has virtually no infrastructure, and still very little regulation.

Even without government support, however, Somali innovation, like an espresso maker designed to foil the city's power outages, will help the city lurch forward.

"The more peace we get", Somalia Wireless's Omar Osman explains, "The bigger and more advanced technology we can offer to our people."

And high-speed internet, even more than espresso, will help stimulate Mogadishu's recovery.