What is nowadays considered a folk etymology may well be the true origin: to kick the bucket quite possibly refers to suicide by hanging after standing on an upturned bucket. For example, the following was published in Jackson’s Oxford Journal of 27th September 1788:
Last Week John Marshfield, a labouring Man, hanged himself in an Out-House in Avon Street.—He had very deliberately just before bought a Piece of Cord, which he put round his Neck, and by standing on a Bucket, fixed it to the Beam—he then kicked the Bucket to a considerable Distance from under him, and was found soon after with his Head almost severed from his Body, owing to the smallness of the Cord.—The Jury having brought in their Verdict, Felo de se, he was buried in the Cross Road leading to Charlcombe.
This origin has been dismissed on the sole ground that the first (1870) and subsequent editions of Dictionary of Phrase and Fable, originally compiled by Ebenezer Cobham Brewer (1810-97), give the following explanation:
To kick the bucket. A bucket is a pulley; and in Norfolk a beam, called in Lincolnshire a buckler. When pigs are killed, they are hung by their hind-legs on a bucket, with their heads downwards, and oxen are hauled up by a pulley. To kick the bucket is to be hung on the bulk or bucket by the heels.
Although to kick the bucket had never before been used with specific relation to Norfolk or with reference to pigs suspended by their heels, the success of the various editions of this dictionary gave currency to this explanation. For example, the review of one these editions, in the Gloucester Journal of 29th January 1881, contains the following:
How often does one use expressions very common amongst the most illiterate, the origin of which we have never heard? When we talk of “kicking the bucket,” “kettle of fish,” “eau de vie,” &c., we little think what was their meaning in the first case. For example we will take the expression “kick the bucket.” Turning to the page we find that this refers to the way of killing pigs in Norfolk, where a bucket is equivalent to a pulley; and the pigs are hung by their hind legs on the bucket with their heads downwards.
There were similar mentions of the explanation given by Brewer in other newspapers, for example in The Manchester Weekly Times of 5th April 1890 and in The Nottinghamshire Guardian of 26th May 1894. It eventually became an accepted truth and no reference to its author was any longer explicitly given. For example, in the Leamington Spa Courier of 24th February 1894, the reviewer of A Glossary of Words and Phrases used in South-East Worcestershire, regretting that “inter-comparisons with other dialects and occasional etymologies” had not been given, wrote:
“Kick the bucket” is an expression common to many dialects, but its origin only becomes obvious on a reference to the Norfolk idiom, in which bucker, or bucket, is the term applied to the gambrel, or crooked stick, from which slaughtered animals are suspended.
Similarly, the Derby Daily Telegraph of 21st March 1922 had:
What is the origin of the phrase “kicking the bucket?” The most likely answer is that which takes bucket to mean not a pail or vessel or tub, but a beam. The beam on which a pig is suspended after it has been slaughtered is called in Norfolk, even in the present day, a “bucket.” Since it is suspended by the heels, the phrase to “kick the bucket” came to signify to die. The “gruesome suggestion” that it refers to the kicking of a bucket away from beneath his feet by a suicide will “not hold water,” for suicides use chairs, chests, sofas, dressers, beds, and Gladstone bags as readily as buckets.
But there were some discordant voices. A certain Alexander Hay wrote the following in The Newcastle Weekly Courant of 1st April 1887:
I cannot state that I think much of Dr Brewer’s allusion to the fable which gave to the world this expression […]. The more rational and commonplace idea of the derivation is from the “bucket” being one of the most notorious and accommodating mediums for self-Calcrafting* mankind than any other object extant, and it is a general favourite in Her Majesty’s convict establishments and prisons for such as are intent on suicide. Thus, the poor wretch makes his own scaffold by turning “the bucket” upside down, then mounting it and adjusting the fatal noose kicks it when it rolls over and he is launched into eternity by strangulation.
(* an allusion to William Calcraft (1800-79), a 19th-century hangman)
And it is true that it is difficult to see how a specialised, technical term peculiar to Norfolk (on the east coast of England) could be the origin of a phrase, “common to many dialects”, which was, it seems, well established in the late 18th century in various places such as Bath, in Somerset (in the south-west of England), and Chester, in Cheshire (in west-central England). For example, The Bath Chronicle of 23rd January 1794 had:
Everything serious and sacred is made a jest of—to come to an untimely death is only “to go off at the drop”—and to die in one’s bed is “to kick the bucket.”
The same year, The Chester Chronicle of 7th February had:
It is worthy observation, how the most serious, sacred, and important events of life, can be sported with. To come to an ignominious end, is only “to go off at the drop,” or “at the fall of the leaf;”—and to die in bed, is “to flip your wind,” or “to kick the bucket.”
The earliest instance of to kick the bucket is found in The History of Edward and Maria, published in The London Magazine: Or, Gentleman’s Monthly Intelligencer for August 1775. (The fact that the author did not feel the need to explain it shows that it was in common usage at that time.):
As soon as I got on board my ship, I met with those rough congratulations upon my return, which agree with the element, and the persons that use them:—My old mess-mate, Tom Bowline, met me at the gangway, and with a salute as hearty as honest, damn’d his eyes, but he was glad that I had not kicked the bucket; while another swore roundly, that I had turn’d well to windward, and left death, and the devil to leeward.
And indeed, in The Universal Magazine of Knowledge and Pleasure of March 1793, an article titled On the Misapplication of Wit contains the following:
Another very fertile subject of little wit among little wits […] is Death.—It is astonishing what pains are taken, that death should never be mentioned by its proper name. […] We hear of one man who has ‘hopt the twig’— a second has ‘kick’d the bucket’— a third ‘has supt up his liquor’—a fourth has ‘gone to kingdom come’— a fifth has been ‘fetched at last’— and a sixth ‘is dead as mutton,’ or ‘gone to Davy Jones,’ &c. &c. &c. Those, who think these expressions are witty, must, however, confess that they are not new; for they have been in vulgar use as long as the present generation can remember.
An a posteriori justification of Brewer’s explanation relates to kick the bucket to the phrase to kick, or strike, the beam, dating from the early 18th century and meaning to be greatly outweighed. The word beam, in this case, denotes the transverse bar from the ends of which the scales of a balance are suspended, and the literal sense of the phrase is that one scale is so lightly loaded that it flies up and strikes the beam. But there is nothing more than a formal resemblance between these two phrases.