He entered the Navy on 6 September 1799 as a first-class volunteer aboard the sloop , employed in home waters under Commander John Watts. From December 1800 he served in the Mediterranean, as midshipman, master's mate, and for a short time as acting-lieutenant; firstly aboard the frigate , under Captains George Johnstone Hope and Robert Honyman, seeing action in the Egyptian campaign under the former. He then followed Captain Hope into the 74s , taking part in the battle of Trafalgar on 21 October 1805, and . Finally, he served aboard , under Captain Peter Parker, from where he was promoted to lieutenant on 20 August 1806.