Cooke joined the Richmond Howitzers, a militia artillery unit, in the 1850s, earning the rank of sergeant. He accompanied the unit to Harpers Ferry in response to John Brown's raid.