In this Tuesday, Sept. 27, 2016 file photo, SpaceX founder Elon Musk speaks during the 67th International Astronautical Congress in Guadalajara, Mexico. Starting with the dream of growing a rose on Mars, Musk's vision morphed into a shake-up of the old space industry, and a fleet of new private rockets. In 2020, those rockets are scheduled to launch NASA astronauts from Florida to the International Space Station—the first time a for-profit company will carry astronauts into the cosmos. (AP Photo/Refugio Ruiz)

It all started with the dream of growing a rose on Mars.

That vision, Elon Musk's vision, morphed into a shake-up of the old space industry, and a fleet of new private rockets. Now, those rockets will launch NASA astronauts from Florida to the International Space Station—the first time a for-profit company will carry astronauts into the cosmos.

It's a milestone in the effort to commercialize space. But for Musk's company, SpaceX, it's also the latest milestone in a wild ride that began with epic failures and the threat of bankruptcy.

If the company's eccentric founder and CEO has his way, this is just the beginning: He's planning to build a city on the red planet, and live there.

"What I really want to achieve here is to make Mars seem possible, make it seem as though it's something that we can do in our lifetimes and that you can go," Musk told a cheering congress of space professionals in Mexico in 2016.

Musk "is a revolutionary change" in the space world, says Harvard University astrophysicist Jonathan McDowell, whose Jonathan's Space Report has tracked launches and failures for decades.

In this Tuesday, Feb. 6, 2018 file photo, a Falcon 9 SpaceX heavy rocket lifts off from pad 39A at the Kennedy Space Center in Cape Canaveral, Fla. The Falcon Heavy, has three first-stage boosters, strapped together with 27 engines in all. (AP Photo/John Raoux)

Ex-astronaut and former Commercial Spaceflight Federation chief Michael Lopez-Alegria says, "I think history will look back at him like a da Vinci figure."

Musk has become best known for Tesla, his audacious effort to build an electric vehicle company. But SpaceX predates it.

At 30, Musk was already wildly rich from selling his internet financial company PayPal and its predecessor Zip2. He arranged a series of lunches in Silicon Valley in 2001 with G. Scott Hubbard, who had been NASA's Mars czar and was then running the agency's Ames Research Center.

Musk wanted to somehow grow a rose on the red planet, show it to the world and inspire , recalls Hubbard.

"His real focus was having life on Mars," says Hubbard, a Stanford University professor who now chairs SpaceX's crew safety advisory panel.

In this Thursday, April 11, 2019 file photo, SpaceX lands two of the first-stage boosters side by side, eight minutes after liftoff at the Kennedy Space Center in Cape Canaveral, Fla. (AP Photo/John Raoux)

The big problem, Hubbard told him, was building a rocket affordable enough to go to Mars. Less than a year later Space Exploration Technologies, called SpaceX, was born.

There are many space companies and like all of them, SpaceX is designed for profit. But what's different is that behind that profit motive is a goal, which is simply to "Get Elon to Mars," McDowell says. "By having that longer-term vision, that's pushed them to be more ambitious and really changed things."

Everyone at SpaceX, from senior vice presidents to the barista who offers its in-house cappuccinos and FroYo, "will tell you they are working to make humans multi-planetary," says former SpaceX Director of Space Operations Garrett Reisman, an ex-astronaut now at the University of Southern California.

Musk founded the company just before NASA ramped up the notion of commercial space.

In this Tuesday, Aug. 27, 2019 file photo, SpaceX tests their StarHopper, successfully hovering 500 feet above the launch site and safely landing at the company's facility in Brownsville, Texas. (Miguel Roberts/The Brownsville Herald via AP)

Traditionally, built things or provided services for NASA, which remained the boss and owned the equipment. The idea of bigger roles for has been around for more than 50 years, but the market and technology weren't yet right.

NASA's two deadly space shuttle accidents—Challenger in 1986 and Columbia in 2003—were pivotal, says W. Henry Lambright, a professor of public policy at Syracuse University.

When Columbia disintegrated, NASA had to contemplate a post-space shuttle world. That's where private companies came in, Lambright says.

After Columbia, the agency focused on returning astronauts to the moon, but still had to get cargo and astronauts to the , says Sean O'Keefe, who was NASA's administrator at the time. A 2005 helped private companies develop ships to bring cargo to the station.

In this March 4, 2019 photo made available by NASA, the uncrewed SpaceX Crew Dragon spacecraft, with its nose cone open to expose the docking mechanism, approaches the International Space Station's Harmony module. It was the first Commercial Crew vehicle to visit the ISS. (NASA via AP)

SpaceX got some of that initial funding. The company's first three launches failed. The company could have just as easily failed too, but NASA stuck by SpaceX and it started to pay off, Lambright says.

"You can't explain SpaceX without really understanding how NASA really kind of nurtured it in the early days," Lambright says. "In a way, SpaceX is kind of a child of NASA."

Since 2010, NASA has spent $6 billion to help private companies get people into orbit, with SpaceX and Boeing the biggest recipients, says Phil McAlister, NASA's commercial spaceflight director.

NASA plans to spend another $2.5 billion to purchase 48 astronaut seats to the space station in 12 different flights, he says. At a little more than $50 million a ride, it's much cheaper than what NASA has paid Russia for flights to the station.

In this Thursday, May 29, 2014 file photo, Elon Musk, CEO and CTO of SpaceX, walks down the steps during the introduction of the SpaceX Dragon V2 spaceship at the headquarters in Hawthorne, Calif., designed to ferry astronauts to low-Earth orbit. (AP Photo/Jae C. Hong)

Starting from scratch has given SpaceX an advantage over older firms and NASA that are stuck using legacy technology and infrastructure, O'Keefe says.

And SpaceX tries to build everything itself, giving the firm more control, Reisman says. The company saves money by reusing rockets, and it has customers aside from NASA.

The California company now has 6,000 employees. Its workers are young, highly caffeinated and put in 60- to 90-hour weeks, Hubbard and Reisman say. They also embrace risk more than their NASA counterparts.

Decisions that can take a year at NASA can be made in one or two meetings at SpaceX, says Reisman, who still advises the firm.

In 2010, a Falcon 9 rocket on the launch pad had a cracked nozzle extension on an engine. Normally that would mean rolling the rocket off the pad and a fix that would delay launch more than a month.

  • This artist's rendering made available by Elon Musk on Friday, Sept. 29, 2017, depicts a SpaceX rocket design on the Earth's moon. (SpaceX via AP, File)

  • In this Saturday, Sep. 28, 2019 file photo, SpaceX's Starship Mk 1 is illuminated against the night sky at the South Texas Ground Control Station in Brownsville, Texas. Starting with the dream of growing a rose on Mars, Elon Musk's vision morphed into a shake-up of the old space industry, and a fleet of new private rockets. Now, those rockets will launch NASA astronauts from Florida to the International Space Station—the first time a for-profit company will carry astronauts into the cosmos. (Miguel Roberts/The Brownsville Herald via AP)

  • In this Monday, Sept. 17, 2018 file photo, Japanese billionaire Yusaku Maezawa speaks after SpaceX founder and chief executive Elon Musk announced him as the person who would be the first private passenger on a trip around the moon in Hawthorne, Calif. (AP Photo/Chris Carlson)

But with NASA's permission, SpaceX engineer Florence Li was hoisted into the rocket nozzle with a crane and harness. Then, using what were essentially garden shears, she "cut the thing, we launched the next day and it worked," Reisman says.

Musk is SpaceX's public and unconventional face—smoking marijuana on a popular podcast, feuding with local officials about opening his Tesla plant during the pandemic, naming his newborn child "X Æ A-12." But insiders say aerospace industry veteran Gwynne Shotwell, the president and , is also key to the 's success.

"The SpaceX way is actually a combination of Musk's imagination and creativity and drive and Shotwell's sound management and responsible engineering," McDowell says.

But it all comes back to Musk's dream. Former NASA chief O'Keefe says Musk has his eccentricities, huge doses of self-confidence and persistence, and that last part is key: "You have the capacity to get through a setback and look ... toward where you're trying to go."

For Musk, it's Mars.