Elon Musk reigns over an entrepreneurial landscape of epic proportions: With Tesla Motors, the cherub-faced CEO wants to wean us off fossil fuels with electric cars for the masses. With SolarCity, he envisions panels blooming on a million rooftops. And even as the fortunes of these two firms soared on the SV150, this newspaper’s latest index of Silicon Valley’s top public tech companies, Musk was laying the groundwork for the world’s biggest battery factory.

Yet this 42-year-old planet-saving, big-dreaming engineer has his sights on a celestial prize:

Mars.

With SpaceX, the rocket company he founded in 2002, Musk hopes to employ recyclable rockets to save humanity, blasting earthlings into space to one day build settlements on the Red Planet.

“Mars is what drives him,” said Louis Friedman, an astronautics engineer who has known Musk for a decade. “From a psychological point of view, if you’re stuck on Earth, humankind has limits — and Elon isn’t the kind of guy who likes to live with limits.”

Don’t bet against him. Silicon Valley’s most intrepid CEO already has employed his potent combination of vision, determination and attention to detail to accomplish two tasks widely thought impossible: creating a viable new American car company with Palo Alto-based Tesla, and a successful private space venture with Hawthorne-based SpaceX. His vision springs from a childhood in South Africa, where he devoured comics and science fiction and flew with his swashbuckling dad in a small plane over the African bush. Now, thanks to the fortune he amassed co-founding PayPal and the risk he took on rockets, Musk has a shot at opening up the universe.

“The moment he was out of PayPal and could do something else, it was ‘Let’s see if we can launch a rocket,’ ” said Errol Musk, Elon’s 68-year-old father, in a rare interview. “The cars and solar power are side issues really — though big ones! I have no doubt that he will get man to Mars in his lifetime.”

Alexandra Musk, Elon’s 20-year-old half sister, says he sees Mars as humanity’s only viable refuge.

“With all the environmental problems on Earth, the next step is to move to a planet that we can live on,” she said. “He wants to go up into space himself, but with his own kids being so young, he can’t really do that. He’d be gone for a quite a while.”

While he declined to comment for this story, Elon Musk has described Mars as a “fixer-upper” planet that over time could sustain human life. Mercury is too close to the sun; Venus is too hot.

But even to Friedman, Musk’s initial proposal to launch his own rocket seemed ludicrous. “I said ‘Are you crazy? Everybody who tries to get into the rocket business quickly learns that it costs a lot more money than they thought.’ He said to me, ‘I know, but I can do it.’ “

Now Musk has proved that he can. Next month, the National Space Society, a nonprofit dedicated to creating a spacefaring civilization, will present Musk with its prestigious Robert A. Heinlein Memorial Award. It is honoring Musk for “doing the very hard task which no one else in the world has been willing and able to tackle: working to create a family of commercially successful and reusable rocket boosters and reusable spacecraft.”

SpaceX’s Falcon 9 rocket, carrying its Dragon cargo spacecraft, is scheduled to launch Monday from Cape Canaveral for a fourth trip to the International Space Station.

African roots

Musk was born in June 1971 in Pretoria, South Africa, to Maye and Errol Musk, the oldest of three children. Maye’s father, Joshua Haldeman, was born in Minnesota, grew up in Canada and emigrated to South Africa with his young family about 1950. A chiropractor and amateur archeologist, he took his family on extended trips to search for the lost city of the Kalahari in what is now Botswana.

Errol was born in South Africa to a British mother and a South African father. An avid pilot and sailor as well as an electrical and mechanical engineer, he made his money consulting and developing properties, then retired early.

After Maye and Errol divorced in 1980, Elon mostly lived with his father, who says he owned thoroughbred horses, a yacht, several houses and a Cessna. One of their homes was in Waterkloof, a leafy suburb of Pretoria that was popular with foreign diplomats.

Wanderlust ran on both sides of the family. On holidays, Errol and his kids would travel, he said: to Europe, Hong Kong, throughout the United States. Or they’d take the plane to Lake Tanganyika, where Errol had a stake in an emerald mine. Elon would later get his own pilot’s license, but he no longer has time to fly.

While wealthy South Africans typically hired maids and gardeners, Errol decided that his children would do chores and cook their own food, taking shifts.

“I guess I was a bit of an autocratic father — do this, do that,” said Errol, who says he has been estranged from his oldest son for several years. “I was a single parent, and they simply had to help out.”

Elon showed an early interest in computers, owning in sequence a Commodore Vic 20, a Spectravideo and an IBM. At the prestigious Pretoria Boys High School, where teachers wore black gowns, he played chess on the high school team but stopped when he concluded that humans were no match for the computers that had begun playing the game.

“I would see him frequently in or around the library,” recalled Ewyn van den Aardweg, a former geography teacher at the school. “Elon had an above-average interest in matters outside the normal curriculum, and the library — these were pre-Internet years — was the place to gain further knowledge.”

The former teacher noticed something else: The boys wore school uniforms, and Musk’s was always neat. To van den Aardweg, this suggested that “despite his superior intellect, entrepreneurial mind set and obvious ‘out-the-box thinking,’ he respected the benefits of discipline and hard work.”

Path to Silicon Valley

By the late 1980s, South Africa was in political turmoil over its apartheid system of racial segregation, and many of the nation’s whites were fleeing the country for opportunities in Australia, England and North America. Musk briefly studied at the University of Pretoria in early 1989, then moved to Canada, where he studied at Queen’s School of Business in Kingston, Ontario. His brother Kimbal soon followed.

Dominic Thompson, who met the Musk brothers at Queen’s, was struck by Musk’s breadth of knowledge.

“It’s rare to have the mix of business knowledge with the understanding of physics and science, along with raw intelligence, and focus,” Thompson said. “He’s always known what he wanted to do.”

Musk then transferred to the University of Pennsylvania, where he studied finance and entrepreneurial management at the Wharton School as well as physics before heading to Silicon Valley in 1995. He had a summer internship at Pinnacle Research, a Los Gatos energy storage startup. He planned to pursue graduate work in applied physics at Stanford University but instead joined the Internet boom.

Entrepreneurial successes soon followed. Musk co-founded Zip2, which was sold to Compaq in 1999, then launched financial-services startup X.com, which morphed into PayPal.

The pay dirt from selling PayPal to eBay for $1.5 billion in 2002 enabled a now-wealthy Musk to embrace his true love — space travel. He left Silicon Valley for Los Angeles, long an epicenter of the aerospace industry, and started SpaceX, where he is both CEO and chief technology officer. He now shuttles back and forth between SpaceX and Tesla.

Aerospace engineer Robert Zubrin, president of Pioneer Astronautics, has watched Musk’s passion for Mars grow since first meeting him in 2001 during a Mars Society fundraiser. Zubrin said that Musk’s most striking qualities are a self-deprecating sense of humor and an uncanny ability to master arcane and complex subjects that accomplished aeronautical engineers have required decades to learn.

“When I first met him, he knew absolutely nothing about rockets, though he clearly had a scientific mind,” Zubrin said. “By 2004, he had learned a fair amount, and by 2007 he knew everything. This guy had gone and educated himself in this entire art. If you sat down with him and asked a bunch of technical questions about rocket engineering, he could answer them all.”

Risks pay off

But Musk didn’t stop with rockets. As an early investor in Tesla Motors, which last year saw a 387 percent increase in sales, he risked his newly acquired fortune to keep the company afloat. As CEO and product architect (his signature is on the sun visors of the first Model S sedans), Musk oversees more than 6,000 employees.

Next up was San Mateo-based SolarCity, a solar installation and financing company that Musk dreamed up with his cousins on a road trip to Burning Man in 2004. Musk is chairman of the company, whose market valuation soared 303 percent last year.

As Musk’s success has grown, so has his philanthropy. He joined Warren Buffett and other billionaires in signing The Giving Pledge, a commitment to give away most of their wealth. And even before he was rich, he promised an uncle that he would pay for the educational costs of the man’s three children.

“He said that he would keep an amount aside for this purpose even if he lost the bulk of his money,” Mike Musk, a dermatologist in South Africa, said in an email from South Africa. “He has gambled his entire fortune on SpaceX and Tesla and at times has almost lost it. He’s a generous, kind individual, but ruthlessly determined in business.”

The Musk Foundation awards grants for renewable energy, human space exploration, pediatric research, and science and engineering education. Among the grantees: the SETI Institute in Mountain View, which seeks evidence of life on other planets, and the Chabot Space & Science Center in Oakland.

The Musk Foundation also gave $10,000 to SafetyBeltSafe U.S.A., a nonprofit dedicated to child passenger safety. Stephanie Tombrello, the group’s executive director, came to know Musk through their overlapping efforts to make Tesla vehicles safer for children. Musk, who’s married to British actress Talulah Riley, has five young sons — a set of twins and a set of triplets — from his first marriage.

Tombrello thinks Musk is driven in part by the loss of his first child, a baby boy who died unexpectedly at 10 weeks.

“Once you’ve lost a child, you sort of want to protect all people from whatever danger is out there,” she said. “If we don’t come up with brilliant ideas, like the electric car or reliable and affordable solar energy, we may lose it all. He really does believe that we’ll go to space eventually, and he wants to make it easier. More than anything, he cares what happens to humanity. He wants to make sure it carries on.”

Contact Dana Hull at 408-920-2706. Follow her at Twitter.com/danahull.