Things to google:
"universal gravitation" for the equation for the force of gravity to apply between two planets.
"orbit velocity" the initial velocity to give an object an orbit around another.
"n body simulation" ways to simulate a bunch of objects interacting with each other by forces more efficiently.
Anyways you can do the gravity by applying a force from every object to every other object based on the distance. That would become slower as you add more planets. Maybe some space partitioning or only calculating stuff close to the screen would help. The reality of it is you'll have to scale the idea way back as you likely won't be able to do that many planets moving with physics before things slow down. Not to mention the online aspect will bottleneck things too because of bandwidth limits.
I have no useful ideas on the actual generation.