Upgrading and Maintaining your ship
Many planets have shipyards, where you can repair and upgrade your existing ship. You can also buy new ships, sell your current ships, and even trade ships in for new ones.
The shipyard items are in the same place as trading commodities, and are on the tabs next to it. For more information on trading and getting to a planet, see the tutorial "Your first trade".
The first option is the ability to perform repairs on an existing ship. Typically caused by battle damage, damaged components don't perform as well, if at all. You can also change the name and transponder signal for your ship.

After "Ship Maintenance", you can upgrade components of your ship. The transaction price factors in the trade in value of your current component. There is no need to repair an item that you plan on trading in. The trade in value is discounted by it's current state of repair.
For a basic explanation of how each component benefits your ship, see: The Overview

Engines, shields, and scanners all upgraded the same way.
When upgrading weapons, your ship may have more then one weapon mount. If so, then you need to select the weapon you wish to replace.
