For this you will need to find the galleon, find the key items and repair the ship. 1. Galleon location
The galleon spawns randomly on the map, but usually it will be around the center of the map. The location of the galleon will be revealed after you get the first key item in one of the labyrinths, so you won't have to sail across the whole map looking for it.2. Repairing the galleon
The galleon has 7 of stages of repair that you will need to go through:
Stage 1: 80 wooden slats + 30 metal nails
Stage 2: 10 wooden slats + 2 metal hinges + 5 metal nails
Stage 3: 30 wooden slats + 15 golden nails
Stage 4: 5 wooden rods + 5 metal nails + 3 makeshift sails
Stage 5: 8 wooden rods + 5 metal nails + 4 makeshift sails
Stage 6: 8 wooden rods + 5 metal nails + 4 makeshift sails
Stage 7: 45 ropes
In total you'll need:
During the repairs of the ship you will be able to have every monkey working on the repairs at the same time (all of the monkeys working will require a multitool), you can also chip in yourself to make it even faster. I had 5 monkeys and myself working on it and a stage of repairs was done in a couple of minutes.
I built a teleport (2x1 tile building) on wooden rods/floor tiles right next to the ship to cut out the travel time between your base and the galleon. 3. Key items
You have to collect the key items you will need from the labyrinths scattered over your map. To access the labyrinths you need a key that you can buy of the shopkeeper (Mysterious Stranger) for 5,000 gold each, but you don't have to worry too much about money. After you purchase a key you will get access to that labyrinth, the labyrinth will be revealed on the map at the same time. When you are fighting your way to the key item in the labyrinth it's likely you will find around 5,000 gold, so you can buy the next key (almost) immediately after clearing a labyrinth.
The key items you need are:
Figurehead, Galleon’s Wheel, Compass, Storm Map. 4. Escape
After these steps you will be able to escape.