He was the second son of landowner John Foley of Ridgeway, the Foley family's ancestral estate in the parish of Llawhaden near Narberth, Pembrokeshire, and the nephew of Captain Thomas Foley, who accompanied George Anson, 1st Baron Anson on his voyage around the world.
He entered the Royal Navy in 1770, and, during his time as midshipman, saw a good deal of active service in the West Indies against American privateers. Promoted lieutenant in 1778, he served under Admiral Keppel (afterwards Viscount) and Sir Charles Hardy in the Channel, and with Rodney's squadron was present at the defeat of De Langara off Cape St Vincent in 1780, and at the relief of Gibraltar. Still under Rodney's command, he went out to the West Indies, and took his part in the operations which culminated in the victory of 12 April 1782.
In the French Revolutionary War he was engaged from the first. As flag-captain to Admiral John Gell, and afterwards to Sir Hyde Parker, Foley took part in the siege of Toulon in 1793, the action of Golfe Jouan in 1794, and the two fights off Toulon on the 13th of April and the 13th of July 1795. At St Vincent he was flag-captain to the second in command on Britannia. After the battle he was transferred to the Goliath (74), in which he was sent out in the following year to reinforce Nelson's fleet in the Mediterranean.
The part played by the Goliath in the Battle of the Nile was brilliant. She led the squadron round the French van, and this manoeuvre contributed not a little to the result of the day. Whether this was done by Foley's own initiative, or intended by Horatio Nelson, has been a matter of controversy.
His next important service was with Nelson in the Baltic. At the beginning of 1801, Nelson was promoted to Vice Admiral of the Blue and after a few months, he took part as the second in command in the Battle of Copenhagen. The Elephant carried Nelson's flag and Foley acted as his chief-of-staff. During the action Nelson's commander, Sir Hyde Parker, who believed that the Danish fire was too strong, signaled for him to break off the action. Nelson ordered that the signal be acknowledged but not repeated. Legend has it that Nelson turned to his flag captain and said:
"You know, Foley, I only have one eye - I have the right to be blind sometimes" and then holding his telescope to his blind eye said "I really do not see the signal!"
Nelson's action was approved in retrospect.
Foley was one of Nelson's "Band of Brothers". Nelson himself was a sea-officer par excellence. Yet there were many who struggled, suffered and were wounded as often as he. This could not help but develop a close relationship among the men. Nelson himself was very aware of the brotherhood which had arisen. In his biography of Nelson, David Howarth makes this clear:
"...Nelson's famous phrase, "I had the happiness to command a band of brothers'...After his first great victory, Nelson called his captains 'my darling children', and none was the least embarrassed by that. Under Jervis, the captains of the Mediterranean fleet were becoming a brotherhood, bonded by skill, experience, mutual respect and a common cause. Maybe they had not thought of it in that way before; but from about this time they all did, and Nelson most of all. And the concept - so suitable to his nature - became an important, conscious element in his conduct of the war."
An amusing illustration of the affection Nelson inspired in his captains, and of the half maternal care they exercised over the fragile and stunted body of their famous leader, is supplied by a letter from Nelson himself to Ball, written from Kioge Bay in 1801. He was racked with the Baltic cold, and wroth, as was common with him, with the still chillier winds which blew from the Admiralty Board:
"But," he says, "all in the fleet are so truly kind to me that I should be a wretch not to cheer up. Foley has put me under a regimen of milk at four in the morning; Murray has given me lozenges; Hardy is as good as ever, and all have proved their desire to keep my mind easy."
That picture of one sea veteran administering warm milk to his admiral at four o'clock in the morning is amusing enough; but it shows more effectively than graver things could do the feeling Nelson inspired in his captains.
Ill-health obliged Foley to decline Nelson's offer (made when on the point of starting for the Battle of Trafalgar) of the post of Captain of the Fleet. Therefore it was Foley's fellow "brother" Thomas Hardy who was present at Nelson's death.
From 1811 to 1815, Foley commanded in the Downs from his flagship Monmouth, and at the peace was made KCB. Sir Thomas Foley rose to be full admiral and GCB. He died while serving as Commander-in-Chief, Portsmouth in 1833.
He was married on 31 Jul 1802 to Lady Lucy Anne FitzGerald (1771–1851). She was the youngest surviving daughter of James FitzGerald, 1st Duke of Leinster and Lady Emily Lennox. Her mother was the great-granddaughter of Charles II, King of England, Scotland and Ireland and his mistress Louise de Kérouaille, Duchess of Portsmouth.
Lucy was the favourite sister of Lord Edward FitzGerald, one of the ill-fated leaders of the Irish Rebellion of 1798, and was herself an active participant in the rebellion. She worked as a conduit, clandestinely transmitting letters between the Revolutionary Committee in Dublin and their agents in Paris. A biographer of Lord Edward wrote of Lucy that she “most closely resembled him (Edward) in her strong sense of the ludicrous and her passionate love for justice.”
She wrote in 1798 of her hope for Irish liberation in an address to the Irish nation that wasn’t published until many years later:
Irishmen, Countrymen, it is Edward FitzGerald's sister who addresses you: it is a woman but that woman is his sister: she would therefore die for you as he did...Yes, this is the moment, the precious moment which must either stamp with Infamy, the name of Irishmen and denote you forever wretched, enslaved to the power of England, or raise the Paddies to the consequence which they deserve and which England shall no longer withhold, to happiness, freedom, glory...
The couple's principal residence was Admiral Foley's country estate, Abermarlais, near Llansadwrn in Carmarthenshire, which he had purchased from Sir Cornwallis Maude, 1st Viscount Hawarden in 1795 with his share of the booty resulting from the capture of a Spanish treasure ship, the St Jago, in 1793. They also had a house at Manchester Square in London. After Sir Thomas' death the widowed Lady Lucy lived at Arundel in Sussex until 1841 when she moved abroad and settled in the south of France, where she spent the remainder of her life. The Foleys had no children. After Lady Lucy's death in 1851 the Abermarlais estate passed according to the terms of Sir Thomas' will to his great-nephew Henry Foley (1824-1871), a grandson of Sir Thomas' elder brother John Herbert Foley. Henry Foley only inherited the estate because Sir Thomas' preferred heir, Osborne Foley, a captain in the Royal Navy, had died without issue in 1848. Abermarlais Park remained in the family until 1909, when it was sold to the Hunter family. The last known person to live in the house was the reclusive Miss Campbell-Davys, before a fire gutted the house in 1980 leading to its demolition in 1982, a terrible loss for the county on account of its long and fascinating history as well as its architectural significance, the original late-medieval manor house having been demolished in order for Admiral Foley to build his more commodious neoclassical mansion nearby. The site of Abermarlais is now used as a caravan park.