He formally retired from the Bengal army in 1887. In 1889 the Professor of Military Medicine at the army medical school at Netley Hospital fell ill, and Henry Cayley was invited to step in. He took over as Professor the next year, retiring in 1897. While at Netley his pastimes included sailing: his yacht "Kathleen", moored there, was stolen in 1895 while he was away in Scotland. In 1891, he was made Honorary Surgeon to Queen Victoria, and he retained this position when Edward VII came to the throne. In 1893 he contributed a chapter on tropical liver diseases to "Hygiene and Diseases of Warm Climates". In 1896 he wrote a pamphlet, "Guide to Travellers on the maintenance of health in unhealthy countries". On the outbreak of the Second Boer War he volunteered for service with the army. He was sent out as colonel in charge of the Scottish National Hospital at Kroonstad in the Orange Free State. While there he suffered serious injuries as a result of a fall from his horse. In 1900, he was made a Companion of the Order of St Michael and St George. He died on 19 March 1904 at Weybridge, Surrey.