The 40-year-old entrepreneur reiterated his vision to graduates at the California Institute of Technology, a private university 10 miles northeast of Los Angeles known for its science and engineering programs.
Musk said he hoped some of the newly minted graduates would work toward Mars colonization, either at SpaceX or another outfit.
"You guys are the magicians of the 21st century. Don't let anything hold you back," he said. "Imagination is the limit ... go out there and create some magic."
Musk made headlines last month when SpaceX became the first private company to make a roundtrip supply run to the space station — a task that had been dominated by governments. With NASA's space shuttle fleet retired, the space agency is outsourcing the job to private industry.
SpaceX's unmanned Dragon capsule splashed into the Pacific on May 31 after a virtually flawless nine-day test flight that included docking with the multibillion-dollar orbiting outpost and delivering a load of food, clothing and equipment to the astronauts aboard.
Earlier this week, Musk accompanied NASA Administrator Charles Bolden on a tour of the Dragon capsule that was plucked from the ocean and trucked to SpaceX's factory in Texas. Save for a few scorch marks from the fiery re-entry, the bell-shaped capsule weathered its maiden journey.
Caltech board of trustees chair Kent Kresa called Musk an "inventor, entrepreneur, visionary and relentless dreamer."
Musk jokingly replied: "I'd like to thank you for leaving crazy person out of the description."
The audience cheered when Musk recounted the historic flight, which he called a "white knuckle event."
"It's a huge relief. I still can't quite believe it actually happened," he said.
SpaceX aimed to launch the next supply mission in September under a contract with NASA and has predicted that astronauts could hitch rides to the space station in as little as three or four years. SpaceX planned to test the next version of the Dragon — designed to carry crews — later this year.
The South African-born Musk, who made his fortune at PayPal Inc., founded Space Exploration Technologies Corp. a decade ago and has poured millions of his own wealth into the rocket startup. The company suffered three rocket failures before finally succeeding. Besides SpaceX, Musk also runs the electric car company Tesla Motors.
Musk's ultimate goal is beyond Earth orbit. To achieve that, the company needs a reusable spaceship capable of making the long trip to the red planet and complete with life support systems.
Musk called the feat "right on the borderline of impossible" but one that's on SpaceX's to-do list.
AP Science Writer Alicia Chang can be followed at http://www.twitter.com/SciWriAlicia