Educated at Marlborough Grammar School and at Lewis Lochée's military academy in Chelsea, Whitelocke entered the army in 1778 and served in Jamaica and in San Domingo. He was appointed Lieutenant-Governor of Portsmouth and General Officer Commanding South-West District on 25 June 1799, commanding the garrison during the height of invasion scares in Britain. On 10 November 1804 he was made a lieutenant-general and inspector-general of recruiting, during a period of significant expansion of the British Army. In 1807 he was appointed to command an expedition to seize Buenos Aires from the Spanish Empire, which was in disarray due to events in Europe. The attack failed and the British surrendered after suffering heavy losses. Whitelocke undertook negotiations with the opposing general, Santiago de Liniers, and having decided that the British position was untenable, signed the surrender and ordered the British forces to abandon Montevideo and return home later that year.