Anyone who happened to pass along the northern slope of the Missouri river valley on US Route 2 in 2008, at the start of the global economic recession, would have seen a small city, suffering from the same malaise that was afflicting every other ranching-and-farming community scattered about the immense expanse of the US great plains.

Young people were leaving Williston, North Dakota. The remaining residents were aging and dying off. No new industries wanted to move to an obscure corner of what was already one of the most obscure US states, plagued by a midcontinental climate where the average January night dips down to -18C and the normal July highs are 29C.

If you'd stopped to ask her then, lifelong resident Rena Greaves would have said she dreamed of leaving. "It was so quiet, so boring," she said.

The constant rumble of Ford F-350 pickups and 18-wheelers means there is very rarely any quiet any more. "I'm not used to the noise. I have a lot of mixed feelings," said Greaves. "There are new restaurants and places to shop. There are new people from all over and a lot of them are nice.

"But I don't go out any more. I don't do anything. You can't walk into a bar. It's so overcrowded and you don't know anyone."

Today's Williston is unrecognisable to its former self. Thanks to the shale-oil boom, what was once an isolated city in the emptiest corner of the continent is now the fastest-growing small centre in North America. It has the highest average wages in the US and the worst housing shortage. It is the most expensive place in the US in which to rent new housing. And it is wracked with cultural conflict between about 12,000 long-time Williston residents and at least 21,000 newcomers who've arrived over the past five-odd years.

The Boomtown Babes Espresso drive through coffee hut in Williston, North Dakota.
The Boomtown Babes Espresso drive through coffee hut in Williston, North Dakota. Photograph: Ken Cedeno/Corbis

"I remember learning about the gold rush. I grew up reading the stories," said Gary Smith, a Janesville, Wisconsin native who made his way to Williston in search of work and now helps run a pair of restaurants. "This boom is like the Klondike."

The Klondike, a region of the Yukon Territory in Canada, was the setting for the most spectacular resource boom-and-bust cycle North America has ever seen. In 1896, after pair of prospectors discovered gold along a tributary of the Klondike River, an estimated 100,000 Americans and Canadians tried to climb over the Coast mountains of Alaska and British Columbia and boat down the Yukon river in an effort to find a fortune of their own.

At least 30,000 made it to Dawson City, which mushroomed from a small encampment to a city of 16,000 in two years. But only a small fraction of the migrants significantly profited from the arduous journey before the gold ran out and the rush ended in 1899.

There are 1,319 people living in Dawson City today. The Klondike goldrush is remembered as a cautionary tale about the fleeting nature of boomtown success.

As long-time Willistonians and newcomers alike are quick to point out, however, the amount of oil sitting below the surface of North Dakota is enormous compared to the rivulets of gold once found in the Klondike. There may be 20bn barrels of oil yet to recover from the Williston basin, a sedimentary deposit spanning parts of three US states and two Canadian provinces.

As well, most of the thousands who have so far flocked to this region are earning good money, either through direct oil-industry employment or working in supporting services. The average annual wage in Williston and surrounding Williams County in the final quarter of 2013 was $77,636, or 41% higher than the US national average.

In their own words: Valery Lyman's audio tour of Williston

What's made all this possible is a pair oil-industry innovations: horizontal drilling, which allows wells to be inserted down and then sideways through shallow and otherwise-inaccessible oil deposits; and hydraulic fracturing, or fracking, which uses millions of litres of water as well as sand or ceramic beads to prop open cracks in the rock and release the light sweet crude.

Since 2006, thousands of these wells have been drilled into the Bakken and Three Forks shale formations located about three kilometres below the surface of the US great plains and the Canadian prairies. The amount of oil pumped out on the US side alone, mostly in western North Dakota and eastern Montana, stands at 1bn barrels and counting.

No less than 189 rigs are continuing to drill about 2,100 new wells per year on the US side. The most conservative estimates suggest this will continue for another 25 years, provided the price of oil doesn't bottom out and the US government doesn't ban fracking.

That means more people will be needed in western North Dakota every day, because each frack requires a small army of workers to erect a rig, oversee the drilling and haul immense quantities of pipe, water, propellant and other supplies to the well site.

Depending on your perspective, Williston has benefitted or suffered the most from the influx of people. When fracking took off in earnest, in about 2010, tent cities sprang up practically overnight. The small inventory of hotels, vacant homes and apartment spaces couldn't handle the new arrivals.

Rows of trailers used as housing for oil workers in Williston, North Dakota.
Rows of trailers used as housing for oil workers in Williston, North Dakota. Photograph: Reuters

"Williston was the refugee camp for the guys who went bust in 2008. A lot of people didn't have a pot to piss in when they came out here. Not a lot was happening in the rest of the country," said Joel Lundeen, a Minnesota native who ran a series of chemical companies in South Carolina before impulse-buying a century-old lodge in 2011 and setting up shop as an entrepreneur.

"We hadn't had an apartment built here in 20 years," said the mayor of Williston, Howard Klug, referring to the long period of stagnation before the boom.

Along with pitching tents in parks, some of the first economic migrants lived out of their pickup trucks or motorhomes. Others paid whatever rent enterprising locals saw fit to charge. The city of Williston was forced to ban the tents and banish larger vehicles from city streets and private property.

"When I first came up here three years ago, the Walmart parking lot was full of RVs," said James Downing, an electronic technician from Fort Worth, Texas, who spends two out of three weeks in the Williston area. "They've cleaned it up since then."

The short-term solution to the housing shortage was the creation of temporary housing in vast modular complexes, known officially as "crew camps" and to everyone else as "man camps".

One housing firm, Target Logistics, operates space for 5,000 oil-industry workers across North Dakota. The guests, who stay anywhere from a few weeks to several years, are provided with three meals a day, unlimited snacks and can come and go as they please, provided they follow three rules: no drugs or alcohol on site, no firearms or other weapons, and no guests – even if they happen to be spouses.

Jeremiah Constant, a drill equipment salesman originally from Colorado, flirts with Brittany Paige, originally from California at a bar in Williston.
A bar in Williston. Photograph: Andrew Burton/Getty Images

"It keeps the nuttiness out," said Nick Nelsen, a former soldier who serves as the assistant manager of Bear Paw Lodge, a Target Logistics facility on a hill north of Williston. The housing at Bear Paw is made of modular units, with squeaky-clean hallways and spartan living quarters. It has the same sanitised feel as the corridors of a scientific research station.

"This isn't what most people think of when they think of a man camp," Nelsen said. "When I came up here, I expected Animal House."

Not all crew camps, however, boast impervious security. During the first few years of the Bakken boom, the massive influx of predominantly male workers had some inevitable consequences.

"Every girl I know has fallen out of a window in a man camp," said Tammie Brown, a native of Spokane, Washington who worked as a Williston bartender for three years before opening a coffee shack downtown. "You know how many times I'd get a call from girlfriends saying, 'I just got kicked out of a camp, come pick me up?'"

In the US press, the gender imbalance in Williston initially attracted as much attention as the population boom, with apocryphal tales of strippers earning $2,500 a night in tips (though the $500 per night reputed to be more accurate is nothing to sniff at). There were more believable stories about women suffering from unwanted attention during the day and of regular fights between men at night.

"The guys were here working, they were away from home and they were out getting hammered on their days off. So they fought. All these little bars were just awful. You could guarantee there was going to be a fight or two every night," said Lundeen, who recently opened the decidedly upscale Bakken Club, a members-only facility aimed at oil-industry executives and other businesspeople.

The Brooks Hotel and a Fuddruckers restaurant in Williston.
A hotel and restaurant in Williston. Photograph: Josh Wood/AP

Willistonians say the mood across the oilpatch reached a nadir in January 2012, when a school teacher out for a pre-dawn jog in Sidney, Montana was abducted, killed and buried by the side of a highway. Two Colorado men searching for work in the oil-patch were later charged with her murder.

The region suffered another jolt this month when a White House national drug control strategy report singled out the Bakken region as requiring more law enforcement to combat organised crime.

"This influx of highly paid oil field workers into an area with limited opportunities for spending their income has created a market for drugs and contributed to an overall increase in crime," read the report by Michael Botticelli, acting director of drug-control policy for the Obama administration.

Willistonians acknowledge the problems but insist the fears are overblown. While most women say they would not walk alone downtown at night, they also note that this is a precaution commonly taken by women in many US communities. Brown, the former bartender, said she never felt unsafe leaving work in the early morning, ­and blamed the bad behaviour on overserving of booze.

Although the gender imbalance in Williston is becoming less extreme, the ratio of single men to single women remains lopsided. Bars and lounges are packed with men of all ages dressed in the unofficial uniform of the off-duty oil-field roughneck: jeans, T-shirts and baseball caps. Most of the women they meet, they say, are already married. Prostitutes, often dressed down in T-shirt and jeans, ply their trade more or less in public, in bars or the lounges of Williston's less-than-luxurious hotels – one of which, on the very next night, housed a wedding reception. There simply isn't enough available real estate in Williston right now to afford separate venues for everything.

At the same time, the city is making serious efforts to be more appealing to women and ensure families with young children are not just comfortable, but happy. A $70m, 22,000 sq m recreation centre has been erected on the east edge of town, with indoor tennis and basketball courts, a 200m running track and a waterpark, including a surfing simulator. Along with new restaurants and retail stores throughout the city, the aim is to entice more spouses to join their husbands, said Tom Rolfstad, president and CEO of Williston Economic Development.

A woman makes tortillas in a make-shift restaurant, constructed of plywood and two-by-fours and attached to a motorhome in Watford City, near Williston.
Making tortillas in a make-shift restaurant, constructed of plywood and two-by-fours and attached to a motorhome in Watford City, near Williston. Photograph: Andrew Burton/Getty Images

He says women now make up more than a third of the people looking for work, according to job centre data. Two primary schools that closed down a decade ago due to a shortage of students have reopened. The city plans to annex 14 hectares of land outside its western borders in order to build a $57m high school to accommodate an expected bulge of students. And in 2012, Mercy Medical Centre, the city's hospital, completed a $20m expansion that included eight new birthing suites. About 750 babies were born in Williston in 2013 and somewhere in the vicinity of 1,300 are expected this year, Rolfstad said.

"I remember when we used to have a party if there was a single baby born in town," Rolfstad said. (He says his own job suddenly changed five years ago, too: from trying to stimulate economic activity in Williston to attempting to manage the runaway growth.)

To house new families, Williston has embarked on an apartment and townhouse construction blitz, with the long-term goal of replacing the man camps with permanent housing – though right now it is barely keeping pace.

"We're not catching up. We built 400 or 500 units over the last five years. Obviously, that's not enough," said Mayor Klug.

In the mean time, the severely high demand for apartments has sent rental rates skyrocketing. In February, Apartment Guide claimed Williston boasted the highest rent in the US, citing a monthly rate of $2,394 for a 65 sq m apartment. This would make the North Dakota city a more expensive rental market than New York City, Los Angeles or the Bay Area.

Tate Cymbaluk, a Williston city commissioner and real estate agent at Basin Brokers (where he works with his father, Roger, who founded it) argues the claim is skewed because the survey was based only on vacancies – which are almost nonexistent in Williston – without taking existing rental agreements into account.

A row of new single-dwelling mobile homes in Williston.
A row of new single-dwelling mobile homes in Williston. Photograph: Bloomberg via Getty Images

But no one denies the rent is high, and rising. Since North Dakota law forbids rent control, there is a real danger that existing Williston renters will be forced to leave the city, especially if they're elderly or don't earn oil-industry wages.

In June, for example, lifelong Williston resident Greaves was told the rent for her trailer-park space was about to rise – from $300 to $850 per month.

"They gave us 30 days notice. What are we going to do? Spend $3,000 a month on an apartment?" Greaves said. She has taken a $20-an-hour job at Walmart to help make ends meet for herself and her three children.

The entire population of an assisted-living facility had to be relocated after the building was purchased, said Kristin Oxendahl, the community engagement director here for the Salvation Army.

Roger Cymbaluk, Tate's father, said one family who rent 50 units of housing are preparing to sell them, because they can't afford to continue charging only $750 a month in rent. "They don't want to be the guys that raise them to $1,200," he said.

Aside from housing costs, the biggest adjustment Willistonians have been forced to make is accepting the fact they no longer know everybody in their city.

Younger Willistonians appear to be more eager to accept the change. Countering small-town stereotypes, many express particular enthusiasm for the presence of a more diverse array of ethnic groups – especially Hispanics and African-Americans – in a city long-dominated by people of Scandinavian and German heritage.

A sign advertising rented accommodation in Williston.
A sign advertising a hardware retail outlet in Williston. Photograph: Shannon Stapleton/Reuters

"I love it. I love meeting new people," said 33-year-old Williston native Kelly Pflug, who said she was an out-of-work single mother before the boom and now owns her own cleaning business, truck, home and hot tub.

She said most of the new arrivals in the city are simply here to work hard. But there is an apprehension some will simply take their earnings elsewhere. "If you're coming here to be a resident, good. If you're coming here to make a lot of money in four months, forget it," she said.

Mayor Klug said he's concerned about a "them against us" mentality among people who lived in Williston before the boom. "The people who are moving here, they need to understand Williston always has been and will be a close-knit community," he said. "We're pretty kind to people who have a skill and can help us out. We're not very kind to people who come up with their hand out and say, 'Where's your shelter?'"

Indeed, every day, newcomers to Williston get off the bus or train and wander up Main Street to the Salvation Army, expecting to stay there while they find work or an apartment. Most are shocked to learn there is no shelter in Williston, said Oxendahl. "People will come to our doors and say, 'I spent my last dime getting here. I arrived last night. I don't have any money. I have the clothes on my back. What do I do?" she said.

"This is their hope for making it. They show up with nothing. It's very, very, very hard, because we're so limited at what we can do."

Oxendahl estimated the number of homeless in Williston at about 1,000, including people living in their cars and couch surfing. Given the severity of the North Dakota winter, the Salvation Army secured 10 beds in a man camp earlier this year for new arrivals awaiting the start of their jobs. The pilot program lasted five weeks, and could be expanded next winter if volunteers and funds can be found. But even in a county where unemployment hovers at 1%, finding a job without skills in Williston can be difficult. For those who fail, the Salvation Army has resorted to buying bus tickets home: 161 of them in 2013, Oxendahl said.

The mayor vows the city will not build a homeless shelter. He's more concerned with a $750m backlog of road, sewerage and water projects Williston needs to fund in order to keep pace with the development.

Developers are paying their fair share, he said, unlike in the 1980s, when the sudden end of an earlier oil boom saddled Williston with the tab for infrastructure built for industry that fled town.

A worker sandblasts a section of pipeline.
A worker sandblasts a section of pipeline. Photograph: Andrew Burton/Getty Images

Williston was actually bruised by two previous oil booms, said Roger Cymbaluk. He grew up 90 minutes away in Belfield and moved to Williston in 1968, at the end of the town's first oil boom. He wound up repossessing the cars of workers who fled town after the bust. He then moved into real estate, and proceeded to lose his own shirt during the second bust, in the 1980s.

"We owned a lot of buildings on the strip up and down the (Main Street) strip. We would have oil companies call us up on a Friday and say 'We'll be out of there on Monday.' We would go out there, they would meet us at the door and hand us the keys. They were already cleaned out," he recalled.

"I sold everything off that had value. I had five mortgages on my house. I owed the banks $500,000 and my wife and I had $300. I would have taken bankruptcy, but I didn't have enough money to pay the accountants and attorneys."

Like most old-timers, Cymbaluk was skeptical when the oil companies started sniffing around North Dakota again. This time, the city of Williston was prepared.

The man camps were permitted only the basis of conditional-use permits that came with sunset clauses. Developers were forced to pay for their own infrastructure and post bonds to cover the cost of removing temporary housing and returning the land back to its former agricultural state.

Williams County also had a regional plan that dictated where the crew camps and oil wells could go and what they could look like.

As a result, the development around Williston looks orderly compared with the scattered mess across the Missouri River in McKenzie County, where the once-picturesque badlands surrounding Watford City are now marred by haphazard development.

"Watford didn't have a county plan when this thing hit. That's how everything got everywhere," said Rolfstad, the economic development manager. "It's ranching country down there and those ranchers don't want anybody from the government telling them what to do. Suddenly this boom hits them and it's like, 'My god. I wish we had zoning.' It's kind of ironic."

He concedes Williston isn't out of the woods yet. Elderly residents still run the risk of being displaced by rising rents. Developers of new apartments want the man camps gone, but refuse to lower their own rates; agents out to make a quick buck have flooded into the state.

Somehow, the city and the county have to manage a transition from a boomtown economy with temporary housing to a mature community with permanent housing ­ ­– all without knowing how long the oil boom is going to last and how big Williston is going to get.

Trucks outside new homes rented by oil workers in Williston, North Dakota.
Trucks outside new homes rented by oil workers. Photograph: Andrew Burton/Getty Images

Right now, nobody knows how many people actually live in Williston, primarily because the whole concept of "residence" is challenged by 9,000 units of temporary housing in man camps, not to mention countless other trailers and recreational vehicles. The 2010 census pegged Williston's population at 14,716. North Dakota State University researchers Nancy Hodur and Dean Bangsund identified a "service population" of up to 33,547 in 2012. There may be as many as 60,000 people in Williston and the surrounding area.

From her office in Fargo, Hodur said it's impossible to know how much permanent housing Williston really needs without knowing how many spouses will join their husbands. For now, however, there's no immediate downside to building new housing.

"I don't think we're anywhere near overbuilt," she said. "We still have thousands of people living in RVs and in crew camps."

Future population projections are even more difficult, as the oil companies now believe they can drill more wells into the Bakken and Three Forks formations than was thought possible even two years ago.

The most optimistic projections place the oil play's lifespan at 75 years. Continued drilling for only another decade could nudge the total population of Williston over 100,000 people.

Given the historic emptiness of western North Dakota, this scale of the change is mind-blowing. And unlike gold in the 1890s – or even previous, conventional oil booms – there is no historic precedent for the growth stimulated by a shale-oil boom.

"We have got an economic petri dish that doesn't have any historical context. We're learning as we're going," said Bangsund. "It remains to be seen if North Dakota can catch up to this."

"We kind of assumed that the oil business, if it did come back, was going to be a short-term thing," said Rolfstad. "We didn't bet oil was going to be our saviour." He says Williston is doing well just to cope with the growth, let alone manage it. "You work on the things that are doable. Other things are dreams, I guess."

In a fuel-injected city where those dreams used to be about leaving, the most elusive commodity isn't money, an apartment or even a spouse. It's the one thing least likely to arrive any time soon – certainty.

'Dropping dead is my retirement': the gold rushers of Williston – in pictures