 Miles was born in Maryland.He graduated from the United States Military Academy in 1824 and was commissioned a brevet second lieutenant in the 4th U.S. Infantry regiment, but was transferred immediately to the 7th U.S. Infantry, with which he served until 1847.He served on the western frontier and became adjutant of the 7th U.S.