Miller joined the New Hampshire state militia and commanded an artillery unit, until General Benjamin Pierce noticed him and recommended that he be commissioned as a major in the regular army. Miller joined with the 4th Regiment of Infantry in 1808. In 1811, Miller's unit went to fight Indians in Vincennes, Indiana, where he was promoted to colonel. In May 1812, his regiment moved to Detroit, Michigan. He was the commander during the Battle of Maguaga. Shortly afterwards, Miller was taken prisoner following the Siege of Detroit and was later exchanged. In 1814, Miller was colonel of the 21st Regiment of Infantry and led his men in the capture of the British artillery at the Battle of Lundy's Lane. His "I will try, sir!" quote became famous and he earned the name of "Hero of Lundy's Lane". He was awarded the Congressional Gold Medal in November 1814. Miller was made a brevet brigadier-general by the United States Congress after the battle.