Foster, John Gray was born on May 27, 1823 in Whitefield, New Hampshire, United States. Son of Perley and Mary (Gray) Foster.
Graduated from the United States Military Academy, 1846.
Commissioned Second lieutenant C.E., served in Mexican War. Assistant professor engineering United States Military Academy, 1855-1857. Captain Engineers, July 1, 1860.
At Fort Sumter when bombarded by Confederates, April 1861. Brigadier general Volumes, October 23, 1861. Colonel United States Army in command brigade under General Burnside at Roanoke Island, February 1862, at Newbern, March, 1862.
In command Department North Carolina, July 1, 1862. Major general Volumes, July 18, 1862. In command Department of South, 1864.
Brevetted major general United States Army, March 13, 1865. In command Department Florida, 1865-1867. Lieutenant colonel C.E., March 7, 1867.
Assistant to chief Engineers, 1871-1874.
Married Mary Moale, January 21, 1851. Married second, Nannie Davis, January 9, 1872.