The Doterel class were a development of the Osprey-class sloops and were of composite construction, with wooden hulls over an iron frame. The original 1874 design by the Chief Constructor, William Henry White was revised in 1877 by Sir Nathaniel Barnaby and nine were ordered. Of 1,130 tons displacement and approximately 1,100 indicated horsepower, they were capable of approximately 11 knots and were armed with two 7" muzzle-loading rifled guns on pivoting mounts, and four 64-pound guns (two on pivoting mounts, and two broadside). They had a crew of around 140 men.
Gannet was laid down at Sheerness Royal Dockyard in 1877 and launched on 31 August 1878. She was commissioned on 17 April 1879, and was classified as both a sloop of war and a colonial cruiser. She was capable of nearly 12 knots under full steam or 15 knots under sail.
The primary purpose of ships of the Gannet's class was to maintain British naval dominance through trade protection, anti-slavery, and long term surveying.
Gannet served her first commission from 17 April 1879 to 20 July 1883 on the Pacific Station under Admiral De Horsey. She sailed from Portsmouth, across the Atlantic and via Cape Horn to the port of Panama City on the Pacific coast of Central America. She spent much time shadowing the events of the War of the Pacific before embarking on a patrol around the Pacific. She returned to Sheerness to pay off in July 1883, and underwent a two-year refit.
Gannet recommissioned at Sheerness on 3 September 1885 and sailed to join the Mediterranean Fleet. She was initially used to support the forces of Major-General Sir Gerald Graham during the first Suakin Expedition in the Sudan. Anti-slavery patrols took her into the Red Sea, searching suspicious ships. On 11 September 1888, she was recalled from a mid-commission refit at Malta and ordered to relieve Dolphin at the besieged port of Suakin, Sudan. On 17 September she engaged anti-Anglo-Egyptian forces led by Osman Digna for nearly a month, firing 200 main armament shells and nearly 1,200 Nordenfelt rounds. Gannet was relieved by Starling on 15 October and paid off at Malta on 1 November 1888.
Gannet recommissioned almost immediately on 10 November 1888 and was assigned to perform surveying work throughout the Mediterranean. She paid off from her third commission in December 1891.
She recommissioned on 26 January 1892 and spent 3 years conducting survey work in both the Mediterranean and the Red Sea. She returned to Chatham and decommissioned on 16 March 1895.
After four months out of commission, in December 1895, Gannet was transferred to harbour service in Chatham where she remained until 1900, when she was placed on the list of non-effective vessels. In the autumn of 1900, Gannet was leased to the South Eastern & Chatham Railway Company as an accommodation hulk at Port Victoria railway station on the Isle of Grain.
In 1903 Gannet was ordered to relieve the original HMS President of 1829, which had served as the Royal Naval Volunteer Reserve drill ship in London Docks since 1862, and underwent major alterations to convert her into a drill ship. Renamed HMS President, she took up her new duties as the headquarters ship of the London Royal Naval Volunteer Reserve in the South West India Docks in June 1903. In 1909 the ship was renamed President II and in the spring of 1911, was relieved by HMS Buzzard, again finding herself on the list of non-effective vessels.
In 1913 Gannet was loaned to C. B. Fry, and was stationed in the River Hamble, and became a dormitory ship for the Training Ship Mercury (where she retained her name President). The school took young boys who otherwise might not have many options in life, and trained them to join the Royal Navy. The ship served in this capacity until 1968 when the school was closed.
Back in Royal Navy stewardship, the ship was turned over to the Maritime Trust so that she could be restored. In 1987 the Chatham Historic Dockyard chartered Gannet from the Maritime Trust and started a restoration programme to return the ship to its 1888 appearance — the only time she saw naval combat. In 1994 ownership of the vessel was passed to the Chatham Historic Dockyard Trust, where, listed as part of the National Historic Fleet, she remains today on display as a museum ship.
The Prime Minister of the United Kingdom, Gordon Brown, on his first visit to President Barack Obama in the White House in March 2009, gave the President a gift of a pen holder made from the wood of Gannet, reflecting her role in Victorian anti-slavery efforts. This gift was reciprocated with 25 DVDs of classic US feature films.