A worker walks over stockpiles of coal at the PT Exploitasi Energi Indonesia operations in Asam-Asam, South Kalimantan, Indonesia.The country is the world’s biggest exporter of power-station coal, nickel, tin and palm oil. (Dadang Tri/DADANG TRI/BLOOMBERG)

Malaysian airline entrepreneur Tony Fernandes says he has two adopted homes. There’s London, where he owns the Queens Park Rangers soccer club and the Caterham Formula One auto racing team based in nearby Oxfordshire. And there’s Jakarta, a thriving, congested Southeast Asian mega-city in the world’s fourth-most-populous nation.

Last year, Fernandes, founder and group chief executive of Asia’s biggest budget airline, Kuala Lumpur-based AirAsia, moved his office to Indonesia’s capital, beating traffic gridlock by living in an apartment that’s walking distance from work.

Although AirAsia’s official headquarters remains in Malaysia, Fernandes, 49, says his relocation with a team of executives will help him focus on a market that’s eight times the size of his homeland.

“Indonesia is the jewel in our crown,” says Fernandes, whose airline connects some 20 other countries, including Australia, China, India and Japan. “It’s a booming, vibrant, young economy. The opportunities are enormous.”

Just how enormous is evident from the wealth being created in this nation of 249 million people, where a newly enriched middle class is taking to the skies.

After contracting 13 percent during the late-1990s Asian financial crash, Indonesia’s consumption-driven, resource-rich economy has enjoyed 13 years of uninterrupted growth — even during the global banking crisis — surging an average of 6.3 percent annually since 2010. The country’s stock market has performed even more spectacularly.

As of June 12, the benchmark Jakarta Composite Index had leapt almost 350 percent from its October 2008 nadir, making it the second-best performer during that period out of 94 markets tracked by Bloomberg.

In 2011, Indonesia overtook its former colonial master, the Netherlands, to become the world’s 16th-largest economy. In 2012, output rose another 6.23 percent to almost $900 billion and foreign direct investment jumped 26 percent to a record $23 billion.

And if it maintains a growth rate of about 6 percent, by 2030 it will have leapfrogged Germany and Britain to rank seventh, the consulting firm McKinsey predicts. Much sooner than that, by 2020, the number of middle-class and affluent Indonesians may double to more than 141 million, Boston Consulting Group said in a March report.

Betting on that growth isn’t for the fainthearted. Foreign investors are spooked by a combination of falling commodities prices and an outpouring of nationalist sentiment in the run-up to next year’s presidential election.

Indonesia is the world’s biggest exporter of power-station coal, nickel, tin and palm oil. It ranks No. 3 in liquefied natural gas and boasts the world’s largest gold mine and single biggest recoverable copper reserve.

Lower earnings from those exports resulted in a $1.6 billion trade deficit in April, which in turn helped drag the currency, the rupiah, to a three-year low.

Inflation rose 5.5 percent in May from a year earlier, putting pressure on the central bank to raise the benchmark interest rate, which it has held steady for 15 months.

Although the trade balance returned to surplus in March, gross domestic product growth of 6.02 percent in the first quarter of 2013 was the slowest in more than two years.

President Susilo Bambang Yudhoyono is also facing resistance to his efforts to reduce fuel price subsidies that could cost the nation $21.5 billion this year.

In April, Standard & Poor’s cited failure to tackle the subsidies as one reason it hasn’t followed the example of Moody’s Investors Service and Fitch Ratings, which in the space of five weeks in December 2011 and January 2012 lifted Indonesia’s credit rating to an investment-grade level.

Investor Mark Mobius says he’s treading carefully in Indonesia, even though the Jakarta Composite Index surged 6.79 percent this year through June 11.

He’s enthusiastic enough about the consumer story to stake almost 6 percent of his $18.45 billion Templeton Asian Growth Fund on shares of PT Astra International, the country’s biggest automotive retailer, which sells Toyota cars and Honda motorbikes. Still, he says that many Indonesian consumer stocks are no longer cheap and that others aren’t transparent enough.

“It’s not easy pickings,” Mobius says. “And you have corporate governance and corruption problems.”

Indonesia has long been plagued by graft. Suharto, the dictator who was overthrown in 1998 after 31 years in power and died in 2008, may have embezzled as much as $35 billion, according to Berlin-based Transparency International.

Four officials in Yudhoyono’s Democrat Party have resigned in the past two years after being linked to bribery allegations; two were convicted and sent to prison, while the other two, who deny wrongdoing, have been named as suspects.

Indonesia ranked 118th out of 176 countries in Transparency International’s 2012 Corruption Perceptions Index, a fall of 18 places from the year before.

Another Mobius concern, the opaqueness surrounding many Indonesian companies, has been highlighted by the battle in London for control of Bumi, a company set up by British investor Nat Rothschild in partnership with the Indonesian Bakrie family headed by billionaire politician Aburizal Bakrie.

The Bakries injected stakes in two listed Indonesian companies into Bumi before the partnership collapsed amid Rothschild’s allegations of accounting irregularities at the Indonesian firms.

Now, investors are confronting another obstacle: nationalism. Some foreign mining companies such as Freeport-McMoRan Copper & Gold are being ordered by the government to pay higher royalties and sell bigger stakes in their companies to local partners. And starting next year, many companies will be barred from exporting raw metals, forcing them to build expensive refineries onshore or send their ore to be processed by local smelters.

Yum Brands, owner of the KFC and Pizza Hut chains, has more than 700 outlets in Indonesia. It learned in February that the government plans to limit most restaurant franchise holders to 250 branches to protect small businesses.

“There’s been a narrowing of space for foreign investment,” says James Castle, founder of CastleAsia, a Jakarta-based consulting firm.

Rudi Rubiandini, head of SKK Migas, the government regulator that oversees Indonesia’s $30 billion upstream oil and gas industry, laughs when asked why Indonesia seems increasingly unfriendly toward foreign investors.

“It’s only until the elections,” Rubiandini says. “A few politicians are doing it to try and woo voters. Be patient. When it’s over, everything will be back to normal.”

It’s unclear who will replace Yudhoyono. The best-known declared contenders are throwbacks to the Suharto era: Bakrie, the Bumi protagonist and chairman of the Golkar Party, which was founded by Suharto, and Prabowo Subianto, commander of the armed forces under Suharto.

“It’s still wide open,” Castle says.

While the economy is not growing as fast as it was two years ago, Indonesian airlines carried 70 million passengers in 2012, up from 37 million in 2008, according to the Sydney-based Capa Center for Aviation.

The boom has come at a price. Most Indonesian airports are operating way beyond capacity. Last year, Jakarta’s 28-year-old facility handled 58 million passengers, twice the number it was built to serve.

And a grim safety record taints Indonesia’s increasingly crowded skies. In 2010, a particularly bad year, the country accounted for 1.4 percent of all plane flights and 4 percent of all air accidents.

In 2007, after three fatal crashes of flights operated by Indonesian carriers killed 272 people in two years, the European Union banned budget operator PT Lion Mentari Airlines, state-owned PT Garuda Indonesia and several smaller Indonesian airlines from Europe’s airspace on safety grounds.

In 2009, the E.U. lifted the ban on Garuda and three other carriers; Lion is still barred. In April, a Lion Boeing 737-800 crash-landed in the Bali Sea. All 108 passengers and crew members survived, though the plane was a write-off. Lion declined to comment in detail.

“We do not know yet what exactly happened,” says Edward Sirait, commercial director of Lion Air.

AirAsia, which started flying in 1996, has had no fatal accidents.

Through it all, says Brendan Sobie, Capa’s Singapore-based chief analyst, “Indonesia has been the sleeping giant of aviation.”

Its awakening is good news for airlines such as AirAsia, whose shares on the Kuala Lumpur exchange more than doubled during the five years ending June 12, and a bonanza for the world’s two biggest planemakers, Chicago-based Boeing and its European rival, Airbus.

Since June 2011, AirAsia, which has a 40 percent share of Indonesia’s international market, and Lion, which has a 45 percent share of the domestic market, have become Boeing and Airbus’s biggest customers.

They placed orders so huge that President Obama, British Prime Minister David Cameron and French President Francois Hollande have all turned out, wreathed in smiles, to preside over the various contract-signing ceremonies.

In total, Lion and AirAsia have ordered 664 planes worth $64.4 billion at list prices. Closely held Lion has ordered 232 planes from Boeing and the same number from Airbus.

Like air-travel growth in the region, Fernandes’s belief in the Indonesian economy shows no sign of abating. At the Paris Air Show last summer, AirAsia ordered 200 Airbus A320neos. Fernandes says he’ll fund part of the $18 billion purchase by selling an unspecified number of shares in AirAsia’s Indonesian unit later this year.

“I’m putting my money where my mouth is,” he says.

The full version of this Bloomberg Markets article appears in the magazine’s July issue.