The central character and narrator is 17-year-old David Balfour. (Balfour is Stevenson's mother's maiden name.) His parents have recently died, and he is out to make his way in the world. He is given a letter by the minister of Essendean, Mr. Campbell, to be delivered to the House of Shaws in Cramond, where David's uncle, Ebenezer Balfour, lives.
David arrives at the ominous House of Shaws and is confronted by his paranoid Uncle Ebenezer, who is armed with a blunderbuss. His uncle is also miserly, living on "parritch" and small ale, and the House of Shaws itself is partially unfinished and somewhat ruinous. David is allowed to stay and soon discovers evidence that his father may have been older than his uncle, thus making David the rightful heir to the estate. Ebenezer asks David to get a chest from the top of a tower in the house but refuses to provide a lamp or candle. David is forced to scale the stairs in the dark and realises that not only is the tower unfinished in some places, but the steps simply end abruptly and fall into an abyss. David concludes that his uncle intended for him to have an "accident" so as not to have to give over his nephew's inheritance.
David confronts his uncle, who promises to tell David the whole story of his father the next morning. A ship's cabin boy, Ransome, arrives the next day and tells Ebenezer that Captain Hoseason of the brig Covenant needs to meet him to discuss business. Ebenezer takes David to a pier on the Firth of Forth, where Hoseason awaits, and David makes the mistake of leaving his uncle alone with the captain while he visits the shore with Ransome. Hoseason later offers to take them on board the brig briefly, and David complies, only to see his uncle returning to shore alone in a skiff. David is then immediately struck senseless.
David awakens, bound hand and foot, in the hold of the ship, and learns that the captain plans to sell him into slavery in the Carolinas. But the ship encounters contrary winds, which drive her back toward Scotland. Fog-bound near the Hebrides, they strike a small boat. All of the small boat's crew are killed except one man, Alan Breck Stewart, who is brought on board and offers Hoseason a large sum of money to drop him off on the mainland. David later overhears the crew plotting to kill Alan and take all his money. David and Alan barricade themselves in the round house, where Alan kills the murderous Shuan, and David wounds Hoseason. Five of the crew members are killed outright, and the rest refuse to continue fighting.