Factories (i.e. your own space stations) are THE way to make money in the game.  They're built and sold at the Teladi Shipyard - go there and take a look.  They're expensive!
Besides the cost of the factory itself, you'll also need credits to
   pay the Albatross transporter and some operating capital.
To build a factory, first figure out where you want it.  Seizewell
   is fine for a starter.  To get your factory:
1. Find the Teladi Albatross and hire him.  He's hanging around in Seizewell, and appears as a rectangular blip on your radar.
2. Go to the Shipyard and buy your factory.  (They won't sell it to you unless you've already hired the Albatross.)
3. Exit and fly to where you want the factory.  The Albatross will follow you.
4. 'C'ommunicate with the Albatross and tell him to unload.  A really neat video sequence shows your factory being built.
5. Dock and set up whatever your particular factory needs.