1732-79. He was the son of John Farmer, an Englishman living at Youghal in Ireland, and was related to the Earl off Pomfret.
Farmer s early career was spent in the merchant service before he joined the Dreadnought 60, Captain Maurice Suckling, in the West Indies as a midshipman during 1756. He was later employed in home waters aboard the Achilles 60, Captain Hon. Samuel Barrington, and on 23 May 1759 he was commissioned lieutenant of the frigate Aurora 36, Captain Samuel Scott, remaining with her on the home station until she was paid off in January 1761.
He afterwards settled into domestic life in Norfolk with his new wife, and in 1766 assisted in suppressing the Norwich Riot, following which, on 26 May 1768, he was promoted commander on the recommendation of the city s magistrates.
In September 1769 Farmer recommissioned the sloop Swift 14 at Deptford, going out to the Falkland Islands in November and arriving in the following March to find that the Spanish had ordered the closure of the British settlement at Port Egmont. When the senior officer on the station, Captain Anthony Hunt of the Tamar 16, decided to return to England to seek further instructions he left Farmer in command. A few days the Swift was wrecked off Port Desire, Patagonia, having been driven there in a gale, with three men losing their lives. A cutter was despatched to seek assistance, and once the crew were rescued they returned to Port Egmont on 16 April aboard the sloop Favourite, Commander William Maltby.
On 4 June Farmer was forced to surrender to a superior Spanish squadron, but not without resolutely firing his guns in defiance of their overwhelming superiority. In September he reached England aboard the Favourite, and after being acquitted for the loss of the Swift he was appointed to the Tamar, which he recommissioned in October at Deptford.
On 10 January 1771 he was posted captain, and in August 1773 commissioned the frigate Seahorse 24 in which he sailed for the East Indies in November, Horatio Nelson and Thomas Troubridge being amongst his junior officers. Here he captured Hyder Ali s armed ketch off Anjengo on 19 February 1775.
After returning home Farmer recommissioned the Quebec 32 for the North Sea at Woolwich in March 1778. During the following year he was based at Guernsey, from where he sent intelligence of the approach of the allied armada in August 1779, but also fell afoul of the authorities for refusing to release into custody a man who had been accused of murder. During this posting the Quebec in company with the Unicorn 20, Captain John Ford, and Cabot 14, Commander Henry Cromwell, destroyed the greater part of forty-nine enemy vessels after driving ashore a French convoy which was trying to reach Morlaix on 5 July. The Quebec herself went aground during the attack, but after her guns had been thrown overboard she was successfully re-floated and taken to Portsmouth for repairs. Unfortunately no twelve pounder cannon could be found to replace those lost, and Farmer was forced to accept nine-pounders instead, a mishap that would have dire consequences in due course. Even so this did not prevent him capturing the privateer Epervier on 15 September.
On 6 October 1779 the under-gunned Quebec fell in with the Surveillante 40 off Ushant. In an engagement lasting nearly four hours both ships were dismasted, and when the sails of the Quebec fell on the gun deck s hot cannon they caught fire. Within a further five hours the fire reached the magazine and she blew up. From a crew of one hundred and ninety-five men only sixty-eight were to be rescued by their opponent and other ships that arrived on the scene, including a Russian vessel and a British cutter. Farmer, who had been injured during early stages of the engagement sat on the anchor fluke as his ship went down. His gallant conduct was rewarded by the bestowal of a baronetcy on his eldest son, Lieutenant Sir George Farmer, and pensions of two thousand guineas to his widow, as well as twenty-five guineas to each of his living eight children and a ninth soon to be born
Farmer was married Rebecca, daughter of Captain William Fleming. His address in his will was given as Mount Pleasant, Sussex.
He was regarded as a sound and courageous officer, but renowned for being a savage flogger who was also imposed a strict disciplinary code on his officers.