In 1808, during the Gunboat War, he was given the rank of Second Lieutenant in the Royal Danish-Norwegian Navy. He was stationed on the brig "Kiel" from 1811, and became second-in-command there in 1812. In the same year he participated in the Battle of Lyngør. He took over the command of "Kiel" in 1814.