The ensign of the United States refers to the flag of the United States when used as a maritime flag to indentify nationality. As required on entering port, a vessel would fly her own ensign at the stern, but a conventional token of respect to the host country would be to fly the flag of the host country (the United States in Boston Harbor, for example) at the foremast. See The "Britannia" Entering Boston Harbor, 1848 (inv. 49) for an example of a ship doing this. The American ensign often had the stars in the canton arranged in a circle with one large star in the center; an alternative on merchant ensigns was star-shaped constellation. In times of distress a ship would fly the ensign upside down, as can be seen in Wreck of the Roma, 1846 (inv. 250).
The use of flags on vessels is different from the use of flags on land. The importance and history of the flagpole in Fresh Water Cove in Gloucester is still being studied.
The modern meaning of the flag was forged in December 1860, when Major Robert Anderson moved the U.S. garrison from Fort Moultrie to Fort Sumter in Charleston Harbor. Adam Goodheart argues this was the opening move of the American Civil War, and the flag was used throughout northern states to symbolize American nationalism and rejection of secessionism.
Before that day, the flag had served mostly as a military ensign or a convenient marking of American territory, flown from forts, embassies, and ships, and displayed on special occasions like American Independence day. But in the weeks after Major Anderson's surprising stand, it became something different. Suddenly the Stars and Stripes flew—as it does today, and especially as it did after the September 11 attacks in 2001—from houses, from storefronts, from churches; above the village greens and college quads. For the first time American flags were mass-produced rather than individually stitched and even so, manufacturers could not keep up with demand. As the long winter of 1861 turned into spring, that old flag meant something new. The abstraction of the Union cause was transfigured into a physical thing: strips of cloth that millions of people would fight for, and many thousands die for.
– Adam Goodheart, Prologue of 1861: The Civil War Awakening (2011).