The Robinson family is traveling to the German colony of New Guinea in the early 19th century to start a new life. The ship they are traveling on is chased into a storm by pirates and wrecks off the coast of an uninhabited island. The captain and crew have abandoned the ship, leaving the family of 5 alone on the shipwreck. They salvage what they can from the ship, including livestock, weapons, tools, and even the ship's organ, and head to the island. They build an elaborate treehouse, which includes several modern amenities, and set up life on the island they have christened New Switzerland. The two oldest sons, Fritz and Ernst, build a raft to sail around the island to see if anyone else is there, but they come across the pirates that chased them into the storm. The pirates have captured another ship, and is holding the captain and the cabin boy hostage. Fritz and Ernst free the cabin boy, but the captain remains behind, claiming that once he is ransomed, he will return to rescue the Robinsons.
While traveling back to the Robinson treehouse, the cabin boy is discovered to actually be Roberta, the captain's granddaughter. When they return, they inform their parents and youngest brother Francis that the pirates are on the island and looking for them. The Robinsons go to a rocky mountaintop and set up fortifications and defenses, which include digging pits, making rock and log piles, and even "grenades" by putting gunpowder into coconut shells. During this time, Fritz and Ernst begin to vie for the affections of Roberta. Even after Roberta has chosen Fritz, Ernst continues to pursue her, which eventually leads to a fight between the brothers. The father decides to give the family a break and calls for a holiday.
The holiday includes a race involving the various animals Francis has collected since they arrived on the island, which include a zebra, ostrich, donkey, and a baby elephant. When the mother shoots a gun to start the race, the pirates hear the gunshot and head for their location. Roberta sees the pirates coming and alerts the Robinsons, and they all head for the mountaintop. Using their defenses and weapons, they are able to fend off the pirates for a while, but they know that they will eventually be defeated. Just as the pirates are about to capture the Robinsons, a ship appears at the shore and fires on the pirates, making them retreat back to their ship. The ship is captained by Roberta's grandfather, who kept his word to the Robinsons.
The captain tells the Robinsons that he will take them back to Europe or to New Guinea, whichever they prefer. The captain also offers Ernst, who wanted to get an education once they arrived in New Guinea, the chance to go to England to get that education, which he accepts. The father, mother, and Francis all decide to stay on the island. This is what they wanted all along, says the father, so why should they go to New Guinea when they have already started their new life here. Finally, Fritz and Roberta have agreed to marry and start their new lives together on the island as well.