Stockholm's permanent defence consisted of fortification structures built in the Stockholm region to defend the city against hostile attacks from sea, land, and air. The oldest installations date back to the 13th century, and the last ones were built as late as the 1970s. In the 16th century, the construction of Vaxholm Fortress began. During the second half of the 17th century, the council of war Erik Dahlbergh was the prominent fortification architect. Many sconces were modernized or newly built along the Swedish Baltic Sea coast during the Russian Pillage of 1719–1721. Throughout the 19th century, the question of Stockholm's protection against attacks, mainly from the east, was debated. Proposals for fortifications in 1808 and 1826 did not yield any concrete results.

Towards the end of the 19th century, a new defence policy emerged, replacing central defence with border and coastal defence. Around the turn of the 20th century, private individuals organized themselves into the Palmqvist Foundation for Stockholm's fortification and the Association for Stockholm's Permanent Defence, donating money to construct fortifications around Stockholm, known as the "Korvlinjen."

Even before the outbreak of World War II, the importance of anti-aircraft defence was recognized, and defence measures in the Stockholm archipelago were strengthened. However, little was initially done for the defence of the capital. It wasn't until 1943 that serious concerns arose, and by 1944, around fifty anti-aircraft positions were established in and around Stockholm.

Stockholm's permanent defence also tells the story of 700 years of war or the threat of war and how attempts were made to protect Sweden's capital with often limited financial resources. Many projects remained on paper or were prematurely abandoned due to "lack of funds." During peacetime, defence works deteriorated, only to be hastily and seriously reinforced during times of unrest or war.

Today, many of Stockholm's permanent defence installations have been demolished to make way for new development, but numerous fortresses, sconces, bunkers, tank barriers, and artillery emplacements still exist. They can be found along the Baltic Sea coast, in the Stockholm archipelago, in Stockholm County municipalities, and especially within the City of Stockholm. They represent an important and tangible part of Stockholm's history. Some are protected as listed buildings, designated as cultural landmarks, or enjoy archaeological protection. Stockholm's defence remnants from the wartime preparedness years are not legally protected and will not achieve heritage status until 2044.

After the Defence Act of 2000, all ERSTA batteries along the Baltic Sea coast were dismantled except for the ERSTA Battery at Landsort (gun number 3), which is to be preserved and made accessible to the public, serving as a reminder of "the Swedish people's defence efforts during the nuclear threat of the Cold War." The ERSTA system can be considered the endpoint of the era of permanent defence in Sweden.

Medieval fortifications

The oldest permanent defence installations in Stockholm date back to the late 13th century and the early 14th century when the older inner city wall was constructed around the inner parts of Stadsholmen. It originated from the Tre Kronor Castle and formed a heart-shaped perimeter around Stadsholmen, the Stockholm of that time. The castle itself was protected by a robust wall and a central tower. Before the founding of Stockholm in 1252, there might have been a simple defence structure, a keep or something similar, on the northeastern part of Stadsholmen, possibly as early as the late 12th century.

Fortification construction in Stockholm has been influenced by the city's unique location between Lake Mälaren and the Baltic Sea, giving it a strategic key position. Therefore, it was essential for the city wall to expand with the city's growth, and in the 15th and 16th centuries, a new outer city wall was built. A likely location for the western stretch of the 15th-century wall was along the eastern side of Lilla Nygatan, while the eastern wall ran through the present-day block east of Österlånggatan. The exact location is challenging to determine because the wall was moved outward as the city expanded. Today, a visible remnant of the western outer city wall exists in the form of the foundation of the , which can be seen in the breakfast and conference room of Hotel Victory, Lilla Nygatan 5.Hotel Victory, historia. Besides parts of Stockholm's northern city wall, which can be found in the Museum of Medieval Stockholm, the foundation of the Lejon Tower is the only visible remains of Stockholm's outer city wall.

In the north and south, the city was protected by bridges equipped with windbreaks at Norreport and . Walls and towers were also constructed on Gråmunkeholmen (present-day Riddarholmen). From that era, Birger Jarls torn still remains.

During the Middle Ages, the "fortress" of Stockholm endured severe sieges, and the citizens were often called to arms. Two events have left a particular mark on Stockholm's defence and wartime history: in 1471, when King Christian I of Denmark camped at Brunkeberg but was repelled by Sten Sture the Elder's peasant army, and in 1520, when Christian II of Denmark was able to capture the city. The city's permanent defence had withstood several sieges, albeit often with heavy losses, but the Danish capture of Stockholm in 1520 was due to the city surrendering after a blockade and pressure. The city's protected island location made it difficult to conquer. Hostile attacks on Norreport or Söderport always failed. Olaus Magnus wrote: "The city gates of Stockholm inflicted greater expenses on the Kings of Denmark, expended on failed storming attempts, than the ten largest cities in their own realm."

During Gustav I of Sweden's reign, the city's fortifications were well-maintained, and he organized a national defence strategy where the enemy would be met far outside the capital. He protected Stockholm's inlet with a blockhouse (hence the name Blockhusudden) and had Vaxholm Fortress built in the 1540s as a barrier against hostile fleets. At the same time, Gripsholm and Uppsala castles were fortified. Even during the reign of John III of Sweden, work was done on the capital's fortifications.

Permanent land and coastal defence during the Great Power Era

During Gustavus Adolphus' reign, Stockholm began its transformation from a medieval small town into a modern European metropolis. The city engaged in trade and maritime activities. The city walls had served their purpose and were hindering the city's expansion, so they were demolished. The demolition of Stockholm's younger city wall was so thorough that today, there is no trace of it above ground in Gamla stan. The city's street grid was redesigned based on contemporary modern grid planning, but there were still threats to the capital. The major adversary was Denmark, but Poland and later Russia also caused concerns, leading to the construction of sconces.

During the second half of the 17th century, the council of war and Field Marshal Erik Dahlbergh was the great fortification architect of the era. He was an unconventional fortifier who often used round towers and cannons placed on multiple levels. He often had the fortification engineer by his side, responsible for the practical construction of defence installations.

During the war against Denmark in 1643–1645, known as the Torstenson War, it was decided to secure the eastern and southern land routes to and from Södermalm, near Gruindhen and Danvijken, with sconces and garrisons. At , there was a narrow strip of land between Lake Hammarby and Saltsjön (today's ). In 1644, was erected on the nearby hill, and in 1645, was built at "Grinden" between Hammarby Lake and Lake Mälaren (now Årstaviken). The latter consisted of a hornwork with a forward moat and ditch wall that cut off the land tongue between Lake Hammarby and Lake Mälaren, as well as two rearward redoubts. Due to a lack of funds, Johan Peter Kirstenius, the leader of the sconce construction, was arrested for three months at one point because, in his eagerness to complete the fortifications, he had used funds intended for cavalry needs. Danvik Sconce was demolished in the 1770s, and in its place stands 's restaurant and gazebo. The last remnants of Söder Sconce disappeared when were built in the mid-1920s.

In the Stockholm archipelago, sconces began to be established for the defence of Stockholm's coastline. These works were also led by Kirstenius. In 1623, he was given responsibility for . The reason was rumors that Sigismund of Poland was amassing an army near Danzig for an attack on Sweden (which never took place). Hörningsholm Sconces would become an important part of Stockholm's coastal defence for the fairways through and to Södertälje for nearly 300 years. In 1656, Kirstenius began the construction of Dalarö Fortress, and in 1676, fortifications were added at Baggensstäket. He had also worked as an engineer on the strengthening of Vaxholm Fortress.

For many years, Söder Sconce and Danvik Sconce were the only major defenceworks near Stockholm. Besides, there were fortified installations at Fittja Bridge, , and . In 1709, proposed fortifications around the capital. This led to the refurbishment of Söder Sconce and Danvik Sconce and the commencement of a defensive work at Hornstull. However, work was interrupted in 1713 due to a lack of funds. In 1715, a bridge was built over Stocksund "to better defend the lakefront," and in 1717, a proposal for fortifications on the northern side from Ålkistan to was drawn up, work was initiated but soon stopped again due to a lack of funds. In 1719, the existing defence works were once again restored, and sconces were also built at Baggensstäket and Fällström (the strait between Ingarö and Älgö). In connection with the Russian Pillage along the Swedish Baltic Sea coast, where the Russians aimed to force the Swedish government into peace negotiations, an incursion at Baggensstäket was repelled by Baltzar von Dahlheim in August 1719 (see the Battle of Stäket). In fear of further Russian attacks, he had built on the southern side of Baggensstäket.

For Hörningsholm Sconces and Södertälje, things did not go well. In 1719, the sconces were manned by Swedish troops, but their defencespirit was not very strong: they marched away the day before the enemy's arrival. The population on Mörkö fled after the departing troops allegedly said, "Now you're rid of us, but soon others will come who will do you more harm." Södertälje and the surrounding coastal areas were subsequently burned and ravaged by the Russians, including the destruction of all sconces and Hörningsholm Castle. But the damage could have been even greater if the Russians had continued into Lake Mälaren, where they could have freely burned and plundered irreplaceable castles and manors and attacked Stockholm "from behind." The quotes indicate that relations between the local population and the troops at the sconces were tense. Local farmers were often used as cheap labor in the construction and maintenance of the sconces. After the peace with Russia in 1721, fortification work ceased "so that the farmers would no longer be burdened."

The era of the Great Power ended, and "lack of funds" increasingly became the reason why grand plans for fortification constructions remained on paper. During peacetime, the installations deteriorated, and during times of unrest and war, they had to be hastily renovated. Söder Sconce and Danvik Sconce were last renovated in 1732, after which funds were lacking for further actions.

The capital's permanent defence during the Age of Liberty and Gustav III