He entered the Royal Military College in 1819, and became especially adept in fortification and military surveying. In 1823 he joined the 79th Highlanders Regiment, then stationed in Ireland. During his stay there, he made a survey of Dublin and its neighbourhood, which remained in use until it was superseded by the publication of the Ordnance Survey. In 1825 he served in the Mediterranean as a lieutenant in the 7th Fusiliers. In 1826 he transferred to the 69th Regiment, and then to the 52nd Light Infantry in Nova Scotia.