Venture Capitalists can invest in Space X. You will need to be an accredited investor with an annual income of more than $200K and at least a $1 million net worth.
The firm has two trusts that own SpaceX stock. The first is Scottish Mortgage Investment Trust and the second is US Growth Trust. SMT is publicaly-traded on the London Stock Exchange. The USA mainly owns stock options.
Owning shares of Alphabet (GOOG or GOOGL) is an indirect way to invest in SpaceX. Google invested $900 million in SpaceX in 2015. This is nearly 10% of SpaceX shares.
Given that SpaceX doesn't have. a problem raising capital, it's unlikely they'll have an IPO anytime soon. The company has raised money 56 times bringing in about $7.7 billion.
Buying individual stocks is risky. No one knows where commercial space travel is going but it has enormous growth potential. Do your homework and make the best decision for you. Just keep in mind it could be expensive and you could lose it all.