This novel is episodic, with named chapters that often focus on a self-contained incident.
In this story, a gawky and seasick Hornblower comes aboard his first ship. He immediately earns the contempt of the other midshipmen. The young Hornblower is particularly despised by a midshipman named Simpson. Simpson, at age thirty-three, had failed his examination for lieutenant too many times to ever expect promotion. He takes out his bitterness and disappointment on his juniors. Hornblower is extremely unhappy. He takes the first opportunity for death presented to him by challenging Simpson to a duel. Hornblower finds that the most mathematically sound method for the duel is to have one of the two pistols loaded and the other not, and to exchange shots at point-blank range, with neither Hornblower nor Simpson knowing which is which. The captain secretly frustrates this by having the officers of the duel load neither weapon and claiming a misfire when neither discharges. The captain later has him transferred to the frigate HMS Indefatigable.
In The Cargo of Rice , aboard Indefatigable , the newly situated Midshipman Hornblower is put in command of the French ship Marie Galante , carrying a cargo of rice from New Orleans, by order of Captain Pellew after it is taken as a prize. It is Hornblower's first time in command of a ship since joining the Royal Navy. He is instructed to take the captured French ship and her crew to a British port where he is to receive his next orders. Sailing is relatively smooth for Hornblower and his four seamen, until one of the crew (Matthews) informs him that the ship is taking on water from somewhere. Hornblower recalls that Marie Galante was struck below the hull's waterline by a cannonball from Indefatigable before her capture. They check for moisture but find none until it is pointed out that the dried rice will absorb all of it. They hastily attempt to patch the hole with a sail, but by then the rice has expanded so much that the ship is breaking apart. A massive attempt to jettison the rice comes too late and Hornblower commands all hands to abandon ship. Hornblower's crew and the French prisoners are left at sea in an open boat.
In The Penalty of Failure , Hornblower and his crew are still out at sea, between British and French ports. The captain of the recently sunk Marie Galante pleads with Hornblower to navigate to France and release him and his men, and promises safe passage for Hornblower and his crew. Hornblower promptly rejects the Captain's pleading in spite of their bleak situation and uses his pistols to prevent a mutiny. Not long afterwards, Hornblower and his crew are caught by a privateer named Pique which was converted from a slave ship. This ship is commanded by Captain Neuville. Hornblower is now a prisoner of war, but Indefatigable falls in with them and makes chase. As Pique is the faster sailer, Hornblower devises a plan to slow her down: he sets a fire, which soon spreads to the very flammable paint locker. All hands are diverted to fighting the fire, which soon breaks out on the deck and spreads to the rigging, immediately slowing the vessel. The British ship ultimately overpowers Pique , extinguishes the fire and Captain Neuville and his crew surrender. Hornblower's fears of reprimand for losing Marie Galante are quickly extinguished by the offhanded dismissal of the incident by Captain Pellew. However, instead of taking credit for the fire, Hornblower claims there was a spontaneous combustion in the paint locker, as way of punishing himself for losing Marie Galante in the first place.
Upon returning to Indefatigable , Hornblower is involved with a mission planned by Captain Pellew to take the French corvette Papillon . Hornblower is set to command Indefatigable' s jolly boat. His job in the raid is to board Papillon after the other boats do, climb the mast and loose the main topsail so Papillon can sail out to meet Indefatigable . Before setting out, Hornblower practises his task on Indefatigable to try and calm his nerves. While reviewing his men prior to shoving off, a man named Hales mentions to Hornblower that he feels "a bit queer-like." After the boat crews depart, Hales begins having an epileptic seizure. Because of the necessity of silence, Hornblower strikes Hales with the tiller of his boat. On boarding the ship Hornblower and his men are frustrated by the absence of a footrope along the yardarm. Hornblower's fear of heights and poor balance cause him to freeze, until he reminds himself that he acted decisively enough when laying out Hales; to withdraw now would be an act of extreme cowardice. Motivated by this act of emotional self-flagellation Hornblower runs unaided along the yardarm and looses the topsail. During the fighting the jolly boat is lost, with Hales still aboard, but Papillon is taken as a prize of Indefatigable . Hornblower feels bad about the loss of Hales, without whom Hornblower believes he would never have found the courage to complete his task. Jackson claims that Hales would have never made a decent seaman anyway. Given the success of their mission Hornblower realises the loss of the jolly boat will not be held against him, but still regrets the inevitable death of Hales.
When Styles, a man in Hornblower's division, appears strangely marked with "boils" all over his face, Hornblower is suspicious. He gains a clue from Finch, another of his men, who suffers from delusions and claims that "God's in the maintop, but the Devil's in the cable tier, but only in the dog watches" . After thinking about what this means, Hornblower investigates the cable-tier in the dog-watch and discovers a group of men "rat fighting". Styles, with his hands tied behind his back, has to kill as many rats with his mouth as possible within a short time, while the others bet on the result. A horrified Hornblower orders them up on deck and threatens to report them. Later, in action against a French ship, Hornblower and Finch are firing a swivel gun from the mizzen-top when the mast is hit and begins to fall. Hornblower convinces Finch to jump to safety by telling him to "get to God". The two men make a desperate jump to safety.
Hornblower takes part in attempted invasion by British and French Royalist forces at Quiberon in order to support the failed Revolt in the Vendée. Hornblower is ordered ashore with his seamen acting as gunners, and gains his first experience of land warfare and the horrors of the Revolution, including the guillotine. The expedition ends in failure and Hornblower escapes back to his ship, saddened, but philosophical. The Frogs are the French and the Lobsters are the (red-coated) British regiment landed to support them.
Hornblower's ship, Indefatigable , is in Cádiz when Spain makes peace with France. Since Spain becomes officially neutral, the British ship of war is forced to leave. Spain has completed its turnaround and joined France in an alliance by the time Indefatigable is escorting a convoy through the Straits of Gibraltar. When the ships are becalmed, two Spanish galleys attack. They are fought off by the British, and Hornblower leads the capture of one of them, which gains him promotion to Acting-Lieutenant.
After Indefatigable comes into port at Gibraltar, Acting-Lieutenant Hornblower reports to Santa Barbara where he and others are to take their examination for lieutenant. When asked a question by one of the captains conducting the examination, Hornblower freezes up and is about to be failed when an alarm of cannon fire interrupts the examination; fire ships have been sent by the enemy in an attempt to destroy the British ships at Gibraltar. Hornblower and Captain Foster, one of the examining captains, take heroic action and prevent a disaster for the British, and jump in the water. They are rescued by the crew of one the fire ships, themselves escaping in a small boat, but then a British guard boat captures them in return. Since the Spanish crew saved his and Hornblower's life, Foster orders that they be released. The examining board does not reassemble since Foster falls out with another examining captain, who had been standing by with a boat but failed to reach them before the Spanish crew. Hornblower will need to wait for a later examining board. The story ends with Foster, impressed by Hornblower's actions, telling Hornblower that, since the attack prevented him from failing the examination, he should "Be thankful for small mercies. And even more thankful for big ones."
Acting-Lieutenant Hornblower accompanies the diplomat Mr. Tapling to buy cattle and grain from the Bey of Oran to resupply the fleet. However an outbreak of the bubonic plague in the city forces Hornblower, Tapling and his boat-crew to take refuge aboard the transport ship Caroline and remain in quarantine for three weeks until they are clear of infection. Hornblower struggles with a tiny crew aboard a worn-out ship, but still manages to take a prize in the shape of an unsuspecting privateer lugger, and deliver the supply ship to the fleet's base at Gibraltar. There he is reprimanded by the Victualling Officer for having allowed his crew to feast on fresh beef over the last three weeks.
Hornblower is given command of the French prize Le Reve and ordered to return to England with despatches and, to his astonishment, a passenger– the Duchess of Wharfedale. Unfortunately, in thick fog Hornblower sails his ship directly into the middle of a Spanish fleet off Cape St. Vincent. Anticipating capture Hornblower prepares to throw his dispatches overboard, but is persuaded by the Duchess, who also reveals her true identity as apopular actress, to allow her to conceal them under her clothes, as she is sure to be repatriated immediately. This he does, and much later while in a Spanish prison at Ferrol receives a letter from her detailing her successful return to England, and another from the Admiralty confirming his promotion to Lieutenant. Later, while on parole Hornblower rescues some sailors from a Spanish ship wrecked on the cliffs below him. After the rescue he and his assistants, some Spanish fishermen, are forced out to sea by bad weather and found by another British frigate. Despite the temptations of stayingon board, Hornblower reminds the Captain that he is released on parole and is returned to Spain under a flag of truce. Several months later, in recognition of his bravery, the Spanish authorities release him, "I am to restore you under flag of truce to your fellow countrymen, in recognition of - 'your courage and self-sacrifice in saving life at the peril of your own.'"