He studied medicine at Edinburgh University, graduating MB ChB in 1908. He then obtained a post as an assistant surgeon in 1808, being appointed to Mill Prison hospital for French prisoners at Plymouth. In 1809 he was in Lord Gambier's flagship in Basque roads, when Lord Dundonald tried to burn the French fleet. He then served in the Baltic, and afterwards in the West Indies, in the and the , besides boat service in the attempt on New Orleans. At the peace of 1815 with the United States he went on half-pay, having received a medal with two clasps.