HMS Lightning was launched in 1806 as a Thais-class fireship. Like the other members of her class she was quickly converted to a sloop. She participated in the second Battle of Copenhagen, captured a number of small prizes, and was sold in 1816.
The Thais-class fireships were built to a design by John Henslow. The Admiralty converted them to sloops as the design was quite similar to that of the Cormorant-class sloops. Between 1811 and 1812 they were re-rated as 20-gun post ships.
Commander Bentinck Cavendish Doyle commissioned Lightning in March 1807 for the North Sea. In August, Lightning was with the British fleet at Copenhagen, where Doyle commanded the naval brigade on shore. With Lightning he was present at the surrender of the Danish Fleet on 7 September. Lightning also received a share, with many other ships in the British fleet at Copenhagen in August–September 1807, of the prize money for the capture of Odifiord and Benedicta (4 and 12 September).
In January and February 1808 Lightning was at Sheerness, being fitted as a sloop. Then on 7 May Doyle sailed Lightning for Brazil. There she was part of the British squadron that supported the House of Braganza, which had fled Portugal for Brazil. The station was not one that would please any British naval officer looking for glory or prize money. The Portuguese nobility discouraged the British squadron from leaving port.
On 8 October 1808, Lightning captured the Dutch armed transport Hoop, which she sent into the Cape of Good Hope. The initial prize money payment was in excess of £2000, of which Doyle would have received a quarter. The House of Braganza, which had just expatriated to Brazil from Portugal, discouraged any vessels of the British squadron attached to them from going to sea.
Lightning captured only one privateer during her career. This occurred on 20 or 21 November 1810 in the North Sea, when she captured the General D'Orsenne, of 14 guns and sixty-nine men. Lightning, Helicon, and Princess Charlotte were in company when Echo captured the privateer Confiance on 28 February 1811. Confiance carried 16 guns and had a crew of 62 men. Doyle was made post captain on 3 April 1811. Around that time Lightning was re-rated to be a post ship, which meant that he could retain command. On 2 February 1812, Lightning sailed for the Leeward Islands.
In August or September 1812, Lightning detained the American droits Republican and Greyhound. On 2 September 1812, Lightning captured the Alligator. Alligator, of Nantucket, was under the command of Captain Obed Swain and on her fifth voyage as a whaler. She had sailed for the Pacific in 1810 and was returning home with 1600 barrels of spermaceti oil.
Two more captures on the Leeward Islands station followed in October and November. On 12 October, Lightning captured the schooner Shepherdess. Then on 17 November Lightning captured the brig Brandy Wine.
Lightning, Vengeur, and Madagascar were in company on 6 March 1814 at the recapture of the Diamond. Twelve days later, on 18 March, Lightning recaptured the brig Favourite, of 126 tons and six men, which had been sailing from Waterford to Bilbao.
At about this time Lightning was escorting Spanish troops to Corruna. Doyle transferred to command Madagascar and Captain George Rennie took command of Lightning in August 1814 and sailed her for North America.
The Admiralty put Lightning up for sale 28 August 1816. She was sold at Deptford for £1,100 on the day she went on sale.