His first service was as a midshipman on in 1899, serving at the Cape of Good Hope Station when the Second Boer War began. By February 1900, he had transferred into the Naval Brigade as he believed "this promised opportunities for bravery and distinction in action." Cunningham then saw action at Pretoria and Diamond Hill as part of the Naval Brigade. He then went back to sea, as midshipman in in December 1901. The following November he joined the protected cruiser . Beginning in 1902, Cunningham took sub-lieutenant courses at Portsmouth and Greenwich; he served as sub-lieutenant on the battleship , in the Mediterranean, for six months in 1903. In September 1903, he was transferred to to serve as second-in-command. He was promoted to lieutenant in 1904, and served on several vessels during the next four years. In 1908, he was awarded his first command, HM Torpedo Boat No. 14.