Ayres was born at East Creek, New York, along the Mohawk River in Montgomery County.
Between the wars, Ayres was stationed at various posts on the frontier and served at the Fort Monroe Artillery School from 1859 to 1861.