American Indians of the Abenaki and other Algonquian languages-speaking nations, and their predecessors, inhabited the territory of coastal New Hampshire for thousands of years before European contact.
The first known European to explore and write about the area was Martin Pring in 1603. The Piscataqua River is a tidal estuary with a swift current, but forms a good natural harbor. The west bank of the harbor was settled by English colonists in 1630 and named Strawbery Banke, after the many wild strawberries growing there. The village was fortified by Fort William and Mary. Strategically located for trade between upstream industries and mercantile interests abroad, the port prospered. Fishing, lumber and shipbuilding were principal businesses of the region. Enslaved Africans were imported as laborers as early as 1645 and were integral to building the city's prosperity. Portsmouth was part of the Triangle Trade, which made significant profits from slavery.
At the town's incorporation in 1653, it was named Portsmouth in honor of the colony's founder, John Mason. He had been captain of the port of Portsmouth, England, in the county of Hampshire, for which New Hampshire is named.
When Queen Anne's War ended in 1712, the town was selected by Governor Joseph Dudley to host negotiations for the 1713 Treaty of Portsmouth, which temporarily ended hostilities between the Abenaki Indians and English settlements of the Province of Massachusetts Bay and New Hampshire.
In 1774, in the lead-up to the Revolution, Paul Revere rode to Portsmouth warning that the British were coming, with warships to subdue the port. Although the harbor was protected by Fort William and Mary, the rebel government moved the capital inland to Exeter, safe from the Royal Navy. The Navy bombarded Falmouth (now Portland, Maine) on October 18, 1775. African Americans helped defend Portsmouth and New England during the war. In 1779, 19 slaves from Portsmouth wrote a petition to the state legislature and asked that it abolish slavery, in recognition of their war contributions and in keeping with the principles of the Revolution. Their petition was not answered then, but New Hampshire later ended slavery.
Thomas Jefferson's 1807 embargo against trade with Britain withered New England's trade with Canada, and a number of local fortunes were lost. Others were gained by men who acted as privateers during the War of 1812. In 1849, Portsmouth was incorporated as a city.
Once one of the nation's busiest ports and shipbuilding cities, Portsmouth expressed its wealth in fine architecture. It contains significant examples of Colonial, Georgian, and Federal style houses, a selection of which are now museums. Portsmouth's heart contains stately brick Federalist stores and townhouses, built all-of-a-piece after devastating early 19th-century fires. The worst was in 1813 when 244 buildings burned. A fire district was created that required all new buildings within its boundaries to be built of brick with slate roofs; this created the downtown's distinctive appearance. The city was also noted for the production of boldly wood-veneered Federalist furniture, particularly by the master cabinet maker
The Industrial Revolution spurred economic growth in New Hampshire mill towns such as Dover, Keene, Laconia, Manchester, Nashua and Rochester, where rivers provided water power for the mills. It shifted growth to the new mill towns. The port of Portsmouth declined, but the city survived through Victorian-era doldrums, a time described in the works of Thomas Bailey Aldrich, particularly in his 1869 novel The Story of a Bad Boy.
In the 20th century, the city founded a Historic District Commission, which has worked to protect much of the city's irreplaceable architectural legacy. In 2008, Portsmouth was named one of the "Dozen Distinctive Destinations" by the National Trust for Historic Preservation. The compact and walkable downtown on the waterfront draws tourists and artists, who each summer throng the cafes, restaurants and shops around Market Square. Portsmouth annually celebrates the revitalization of its downtown (in particular Market Square) with Market Square Day, a celebration dating back to 1977, produced by the non-profit Pro Portsmouth, Inc.
Portsmouth shipbuilding history has had a long symbiotic relationship with Kittery, Maine, across the Piscataqua River. In 1781–1782, the naval hero John Paul Jones lived in Portsmouth while supervising construction of his ship Ranger, which was built on nearby Badger's Island in Kittery. During that time, he boarded at the Captain Gregory Purcell house, which now bears Jones' name, as it is the only surviving property in the United States associated with him. Built by the master housewright Hopestill Cheswell, an African American, it has been designated as a National Historic Landmark. It now serves as the Portsmouth Historical Society Museum.
The Portsmouth Naval Shipyard, established in 1800 as the first federal navy yard, is located on Seavey's Island in Kittery, Maine. The base is famous for being the site of the 1905 signing of the Treaty of Portsmouth which ended the Russo-Japanese War. Though US President Theodore Roosevelt orchestrated the peace conference that brought Russian and Japanese diplomats to Portsmouth and the Shipyard, he never came to Portsmouth, relying on the Navy and people of New Hampshire as the hosts. Roosevelt won the 1906 Nobel Peace Prize for his diplomacy in bringing about an end to the War.
In 2006, Portsmouth became an Eco-municipality.
The city announced construction of a 600-space garage, the city's second downtown parking garage, to begin in April or May 2017. The $1.9 million project is being built on a new street called Deer Street Extension and is expected to be completed by September 2018.
Local cultural attractions include the Portsmouth Symphony Orchestra, the Portsmouth Music and Arts Center, the West End Studio Theatre, maker spaces and craft breweries.