Working out how to sell ships in Starfield can be a little troublesome, especially if it's a vessel that you forcibly liberated from its previous occupants. As you've probably surmised from the endless contraband scans when you visit planets, the powers-that-be take a dim view of space crime, and that includes being a space pirate.
If your cargo hold is also backed up with loot, you might want to know the best places you can sell items. Otherwise, here's how to sell ships in Starfield, whether they be gifts from quests, or vessels you've stolen and want to get rid of for cold hard cash.
How to sell ships in Starfield
To sell a ship in Starfield, you need to go to the Ship Services Technician in your nearest major spaceport. These vendors hang around near where your ship lands, and not only sell ships, but will buy any spares you have. The only real condition is that you can't sell your home ship, though you can change your home ship by selecting the dialogue option to change and modify and then pressing H on your chosen vessel. This will work fine for any ships you're given as part of quests.
It's a bit more complicated and costly to sell a stolen ship, however. You can get these during ship combat by disabling engines using the Targeting Control Systems skill, before boarding and eliminating the crew. Of course, if you've been invited aboard another ship under friendly pretences, you can also kill the owner and take it that way. Once the previous occupants are dead, sit down in the cockpit, and pilot your new ship to the nearest spaceport.
To sell your new vessel, you're going to have to pay a registration fee. You can do this by selecting the ship in the sell screen and pressing Enter. Since getting a ship registered is often quite expensive, make sure the cost isn't going to exceed the actual sale value before you do it. With that, you should have all the knowledge you need to sell your ships.