Oakes was commissioned into the 33rd Regiment of Foot in 1767 and served in the American War of Independence under Lord Cornwallis. He became deputy quartermaster-general in Corsica in May 1794, quartermaster-general in the Mediterranean in June 1794 and quartermaster-general in Portugal in December 1796. He served in the Egyptian Campaign in 1800 as second-in-command under Sir John Moore. He went on to be brigadier-general at Malta in October 1802, Lieutenant-Governor of Portsmouth and General Officer Commanding South-West District in November 1804 and a commissioner of military inquiry in June 1805. After that he became quartermaster-general in the Mediterranean in July 1806, commander of the Malta garrison in March 1808 and Civil Commissioner of Malta in May 1810.