Career
Anderson entered the Bombay Civil Service in 1806. He was responsible for drawing up the Bombay Civil Code of 1827 and served as a judge in the Sadr Diwani and Sadr Faujdari courts. In 1838, he was named to the Indian Law Commission.
He was knighted in 1849.
He was 7th Governor of Mauritius from 8 June 1849 until 19 October 1850, when he was appointed governor of Ceylon, following the harsh suppression of the 1848 civil uprising by the previous office holder, Viscount Torrington. He resigned in 1855.