This is the definition of the phrase to tap the Admiral in The Sailor’s Word-Book: An Alphabetical Digest of Nautical Terms, Including Some More Especially Military and Scientific, but Useful to Seamen; As Well as Archaisms of Early Voyagers, Etc. (London: Blackie and Son, 1867), by Admiral William Henry Smyth (1788-1865) and Vice-Admiral Edward Belcher (1799-1877):
TAP THE ADMIRAL. Opprobriously applied to those who would “drink anything;” from the tale of the drunkard who stole spirits from the cask in which a dead admiral was being conveyed to England.
However, it is doubtful that the phrase originally referred to a real Admiral.
This is the definition of the phrase in The Slang Dictionary; or, The Vulgar Words, Street Phrases, and “Fast” Expressions of High and Low Society. Many with Their Etymology, and a Few with Their History Traced (London: John Camden Hotten, 1864):
“TAP THE ADMIRAL,” to suck liquor from a cask by means of a straw, said to have been first done with the rum-cask in which Lord Nelson’s body was brought to England, to such an extent as to leave the gallant Admiral high and dry.
It was in fact in a cask of brandy that the body of Admiral Horatio Nelson (1758-1805) was placed after the Battle of Trafalgar, fought on Monday 21st October 1805. In any case, to tap the Admiral cannot have originally referred to Admiral Nelson, since the earliest use of this phrase that I have found occurs fifteen years before the Battle of Trafalgar, in The Times (London, England) of Wednesday 24th March 1790:
Tapping the Admiral is still a favourite practical joke with the Jolly Tars—particularly on India ships—it first originated from the puncheon of rum in which the body of Admiral Lestock was transported from Jamaica to England—the sailors soon made an end of the rum, of which when the ship cast anchor, there was literally not any remains.
However, to tap the Admiral cannot have originally referred to the British Admiral Richard Lestock (1679-1746), since he died in England on his return from an expedition against the port of Lorient, in north-western France.
What is certain is that to tap the Admiral had become a piece of nautical folklore by the late 18th century—as illustrated by the following from The Connecticut Courant (Hartford, Connecticut) of Monday 24th September 1792:
THE BARREL TAPPED.
An Admiral died on a voyage, whose corpse was put into a puncheon of rum, to preserve it for interment in England. A seaman on board the ship was remarkable, and frequently punished for inebriety; the Captain at length thought the most efficacious method to prevent this growing evil would be to stop his grog. Jack however was not found to be more abstemious, and being again brought to the gangway, the Captain assured him that if he would confess where he got his liquor, for once, he should be forgiven. “Well, please your honor,” says the Tar, “to own God’s truth, I broacked the Admiral.” “Broached the Admiral!” exclaimed the Captain. “Yes, Sir, (says he) and stuck by him till it was low water.” The master of the ship was ordered to see into the circumstance, who reported to the Captain that the old gentleman was really aground! Jack in consequence saved a flogging, and the thirsty Admiral was replenished.
The above-mentioned “favourite practical joke with the Jolly Tars” occurs again in the description of the obsequies of a pongyi (i.e., a Buddhist priest), at Rangoon, in Burma, reprinted from the Calcutta Gazette by several British and Irish newspapers in October 1826—for example by The Constitution; or, Cork Advertiser (Cork, County Cork, Ireland) of Thursday the 5th (the corpse of the pongyi was lying in honey):
The joke of tapping the Admiral, we presume, is familiar to our readers.—Had honey been used, as in the preservation of the Poonghee, the Admiral’s cask would never have been tapped.
The phrase then occurs in the following story from The Scotsman (Edinburgh, Midlothian, Scotland) of Saturday 20th June 1829:
Curious Case of Somnambulism.—The following singular instance of sleep-walking occurred on board of a ship lately returned from a foreign voyage. The captain, besides taking in a general cargo, forgot not to store his cabin with a good sea stock of excellent brandy, for the use of himself and crew. Now it so happened, that in whatever state the case bottle was left at night, it was always minus an inch or two in the morning. The captain complained of this, telling the men that if they were not satisfied with their daily allowance, to state it and they would get more. The crew however, to a man, denied having touched the cabin bottle at all. No more notice was taken of the affair for a day or two, till the captain, convinced all was not right, filled the bottle quite full before going to bed, and in the morning found it at least two tumblers down! Here was a mystery differing entirely from the story of tapping the Admiral, for there some one was always drunk and no grog away; while here every one was sober and lots of grog amissing! The crew finding their honour and character thus at stake, determined on watching the tippling invisible; and accordingly, when the captain “turned in,” two of them took their station near the cabin door. Nothing occurred for the first two hours; the steersman was singing on deck, and the captain snoring in the cabin, all else was silence. At length, about the mid watch, a noise was heard in the cabin—the men seized a light and entered, half in terror—when, lo! the captain was stalking through the cabin in his sleep, steering fair, however, to the haunted bottle, when, just as he was about swallowing a huge cawker *, the men wakened him, to his no small amazement and wonder. The thief having been discovered in the unfortunate captain who professed total ignorance of his nocturnal tippling by way of curing him from the habit, he piped all hands and made them finish the bottle, declaring that if he rose again he would find nothing but a dead marine (empty bottle) for his trouble.
* Here, cawker (i.e., caulker) denotes a drop of liquor, perhaps from the image of something to keep out the wet.
The earliest non-nautical use of the phrase that I have found occurs in the account of the Spring Assizes, held at Maidstone, in Kent, published in The Times (London, England) of Thursday 15th March 1832:
John Quin, aged 17, a labourer, was indicted for stealing a gallon of gin on the 6th of January last, the property of William Compton, a publican at Deptford. Prisoner came to the house of prosecutor, of whom he was in the habit of buying bottles. The prosecutor was obliged to leave him in the cellar for a few minutes. When he came up stairs with the bottles he was in a state of intoxication, and was accused of “tapping the admiral.” He replied, he had not “tapped the admiral;” and departed with five dozen of bottles. He shortly returned again to the public house, saying he had left his great coat behind him. Suspicion being raised, he and the bottles were searched, and it was found that five or six of them were filled with gin, which he had stolen from a cask in the cellar, during the absence of the prosecutor. He was found guilty, and sentenced to three month’s hard labour.