John Baker was born around 1837. By the early 1860s, he was probably living in Pennsylvania. He enlisted in the Union army on August 1, 1861, and he mustered in as a corporal in Company D of the 31st Pennsylvania Infantry. The regiment later became the 82nd Pennsylvania Infantry. It took part in the Peninsula campaign, the Battle of Seven Pines, the Seven Days’ Battles, the Battle of Antietam, and the Battle of Fredericksburg. He deserted on December 11, 1862.