PHOENIX - When you think of technology companies, you probably think of California. But more and more, they're leaving Silicon Valley for the Valley of the Sun and in particular, downtown Phoenix, where tech companies have quadrupled in the last five years.

Coplex and its CEO Zach Ferres are a part of that.

In the last year, Ferres relocated Coplex's headquarters from California into the Galvanize building near 7th Street and Buckeye Road. The old produce warehouse is now home to almost 80 tech companies and a school that supplies them with talent.

But it wasn't always like this.

“The joke was it was the wild, wild west when I moved here,” Ferres said. “It wasn't just the warehouse district, it was the whole Phoenix area, in terms of start-up activity."

Ferres moved to the Valley to take over Coplex, a company that helps start-ups grow, in 2011. A year later, there were just 67 tech companies in downtown Phoenix. Now, there are nearly 300 -- in a city that's revamped its rundown warehouse district and drastically morphed its economy from one that relies on real estate and retail, to tech and trade.

“It all started with light rail,” said Christine Mackay, Phoenix's Director of Community and Economic Development. “Every ounce of it doesn't happen if light rail doesn't happen. Every ounce of it doesn't happen if our universities don't move into downtown. They are really the catalyst that started all this.”

Mackay can see the result in the downtown buildings that tech companies are filling with jobs. Many of those are by millennials, who are attracted to the housing, nightlife and soon-to-be grocery store that didn't exist downtown in 2012.

At that time, there were just about 1,800 tech jobs downtown. Now there are more than 7,000.

This includes large companies, such as Uber and Quicken Loans, moving thousands of jobs to downtown Phoenix and smaller, Silicon Valley tech companies, opening second offices here.

Take company DoubleDutch, a company that creates apps for events, for example. It currently employs 16 people but is looking to hire more, including engineers, in an office that looks straight out of San Francisco.

“We actually took a look at 12 to 15 cities, so there was pretty fierce competition,” said Jackie Roberts, Phoenix’s DoubleDutch general manager. “But our founders actually came down and felt a connection with the city.”

Roberts said it was also about cost -- cost for office space and cost to pay employees. Both are significantly less in Arizona than in California.

“Something our leadership likes about Phoenix is we can pay someone a wage, save from a cost perspective, but they can also then live on it and not be living paycheck to paycheck -- they can put it back into the economy,” Roberts said.

As the light rail, downtown housing and nightlife expand, Phoenix hopes its tech business do as well, and attract the talent to make start-ups take off.