Boston was founded by Puritain colonists from England in 1630. A mere four years later, one of the first things new Governor of the Massachusetts Bay Colony Thomas Dudley (1576-1653) did was order the fortification of Castle Island, upon which an earthwork with two platforms and three cannon was built in the interest of protecting Boston Harbor. Warning shots were regularly fired from the fort to alert ships that were not following harbor regulations: A ship's passenger was killed in 1637 when one of these shots went astray (or did it!?).
A pine log fort was built there in 1644, then replaced with a more substantial structure in 1653. In 1655 the fort's commander, Captain Davenport, was struck and killed by lighting. Perhaps this source of combustion was why Fort #3 burned down in 1673 and was swiftly replaced with Fort #4. Each of these fortifications were known as "The Castle," due to their being situated on Castle Island.
In 1689, William of Orange (1650-1702) ascended to the throne of England. He sent William Wolfgang Romer (1640-1713), a military engineer, to the American colonies, to build stuff. Romer began work on Boston Harbor's most serious fortification on Castle Island yet in 1701, completing four-bastioned Fort William out of brick in 1703, mounting 72 guns.
The 14th and 29th British regiments were withdrawn from Boston following the Boston Massacre (March 5 1770), and moved to Fort William for safety from bloodthirsty anti-massacre extremists.
Fort William's only true military action took place in March of 1776, during the American War for Independence (1775-1783). Garrisoned by British troops, Fort William fired upon Patriots who had mounted cannon on Dorchester Heights to fire at British ships in the harbor. The Patriots and British were too far separated to do one another any damage, but one of the British guns did explode, wounding seven British soldiers.
Fortunately those soldiers recuperated enough to destroy most of Fort William as the British evacuated Boston in 1777. Lieutenant Colonel Paul Revere (1735-1818) oversaw the fort's reconstruction shortly thereafter, which shortly housed some 400 British POWs captured at the battle of Bennington (August 16 1777). Revere ordered shots fired from the fort at American Privateer ships that were assisting some of his troops to desert.
In 1778 the fort was "renewed" by Colonel Richard Gridley (1710-1796), Chief Engineer of the New England Provincial Army. Following a happy outcome to the war, Castle Island became the property of the United States in 1798. John Adams (1735-1826), second US President, came to Boston in 1799 to dedicate the Castle, or Fort William, as Fort Independence.
An undeclared naval war with France that ran from 1799 to 1801 brought some French prisoners to Fort Independence. By my count, this brings us to Fort #8, but I'm wrong, because Fort #7 was built from 1801 to 1803, now with five bastions. The War of 1812 (1812-1814) saw US troops training at Fort Independence. The British Navy controlled Massachusetts Bay and raided to the north and south at will, but Fort #7 kept them away from Boston.
US writer Edgar Allen Poe (1809-1849) served at Fort Independence for five months under the name of Perry when he joined the US Army in 1827: He wrote some of his (completely ignored) first published collection of poetry there.
Fort Independence's final iteration was completed in 1851, replacing brick with granite from quarries in Rockport, Massachusetts.
During the US Civil War (1861-1865), Fort Independence was again used as a training ground, preparing soldiers for service in the Army of the Potomac. The fort was also used as a prison for US deserters. In 1863, troops stationed at Fort Independence were sent into Boston to quell a draft riot.
Fort Independence was deactivated in 1879, but brought back into service during the Spanish-American War (1898) to serve as a torpedo and mine station. Might I humbly suggest that the torpedoes and mines weren't handled particularly well, since an accidental explosion killed four men and destroyed part of the fort's walls that year.
During the First World War (1914-1918) the fort was used as a coastal observation and artillery post. During World War II (1939-1945), Fort Independence saw service as a magnetism detection station: Germany had developed a magnetic mine (where these mines were lurking was anybody's guess), so if a ship's magnetism reading was too high, it was determined to be at risk for a mine sticking to it and, presumably, exploding. The magnetic ship would have to report to the nearby navy yard to be demagnitized before it was permitted to proceed.
Today, Fort Independence is open for a few hours each day during the summer for free tours. The Children's Magical Halloween Castle is held the last Saturday and Sunday of each October, no doubt featuring random bolts of lighting, wild-eyed anti-massacre zealots, and magnetic mines creeping up behind you.