Ayers was born at Portsea, Hampshire, England. He moved to Australia in 1840 with his wife, Elizabeth. He worked in the mining industry. His copper mine became very important to the economy of South Australia. Ayers later went into politics. He was elected to the South Australian parliament on 9 March 1857. He stayed a member for more than 36 years. Ayers first became premier on 15 July 1863.