On 2 March 1880, Keogh was commissioned into the Army Medical Services as a surgeon-captain. His first posting was as a surgeon to the Royal Arsenal, Woolwich. On 6 March 1892, he was promoted to surgeon-major. With the outbreak of the Second Boer War in 1899, he was posted to South Africa. He was promoted to lieutenant-colonel on 6 March 1900, and became commander of No. 3 General Hospital near Cape Town. During the war, he served in Cape Colony, the Orange Free State, and the Transvaal Republic.