Coastal defence of colonial Chile
In Colonial times the Spanish Empire diverted significant resources to fortify the Chilean coast as consequence of Dutch and English raids.
The Spanish attempts to block the entrance of foreign ships to the eastern Pacific proved fruitless due to the failure to settle the Strait of Magellan and the discovery of the Drake Passage. As result of this the Spanish settlement at Chiloé Archipelago became a centre from where the west coast of Patagonia was protected from foreign powers. In face of the international wars that involved the Spanish Empire in the second half of the 18th century the Crown was unable to directly protect peripheral colonies like Chile leading to local government and militias assuming the increased responsibilities.

Timeline of privateer and pirate activity
The following is a list of expedition and seafarers who landed or sailed in Chile with hostile intentions towards Spain or during times the country they served was at war with Spain.  

Seven Years' War
As consequence of the Seven Years' War the Valdivian Fort System, a Spanish defensive complex in southern Chile, was updated and reinforced from 1764 onwards. Other vulnerable localities of colonial Chile such as Chiloé Archipelago, Concepción, Juan Fernández Islands and Valparaíso were also made ready for an eventual English attack.

American Revolutionary War
With Spain and Great Britain at war again in the 1770s due to the American Revolutionary War local Spanish authorities in Chile received in 1779 the warning that a British fleet commanded by Edward Hughes was heading to Chilean coasts for an imminent attack. As consequence of this the Viceroyalty of Peru send economic aid to the garrisons at Valparaíso and Valdivia. The suspected attack did however never happen. In late 1788 suspicion of British attack arose once again, this time stemming from observations of ships off the coast of Coquimbo. A defense plan where militias played a major role was hastily made up.

Spanish initiatives

Preventing entry to the Pacific Ocean

In the 16th and 17th century Spain considered the Pacific Ocean a Mare clausum – a sea closed to other naval powers. As the only known entrance from the Atlantic the Strait of Magellan was at times patrolled by fleets sent to prevent entrance of non-Spanish ships. On the western end of the Pacific Ocean the Dutch threatened the Spanish Philippines. To end navigation by rival powers in the Strait of Magellan Spanish viceroy Francisco de Toledo ordered Pedro Sarmiento de Gamboa to explore the strait and found settlements on its shores.

The Spanish failure to colonize the Strait of Magellan was so notorious that its precedent ruled out any attempt to settle the strait for centuries to come. Proposals to settle the strait were raised again in Spanish courts in 1671 in connection to John Narborough's expedition to Chile and again in 1702 by the Governor of Chile Francisco Ibáñez de Peralta. In this last proposal, the Captaincy General of Chile would itself finance the settlement with the Real Situado with the sole condition that these payments begin to arrive on time.

Building fortifications

In Colonial times the Spanish Empire diverted significant resources to fortify the Chilean coast as consequence of Dutch and English raids. This was particularly true for the expensive Valdivian Fort System built after what would be the last Dutch incursion into Chile since Dutch rule in Brazil, from where the expedition to Chile was made, collapsed in 1645. However the investments in the defense of Corral Bay validated in 1670 when a fully armed ship commanded by John Narborough's arrived to the bay rising suspicions of an imminent English attack.

A Spanish fort near Taitao Peninsula was manned for one and half year beginning in 1750 before being abandoned.

Increased local participation in the defence
Spain's international wars in the second half of the 18th century evidenced the empire's difficulties in reinforcing its colonial possessions and provide them with economic aid. This led to an increased local participation in the financing of the defense and an increased participation in the militias by the Chilean-born. Such development was at odds with the ideals of the centralized absolute monarchy. The Spanish did also formal concessions to strengthen the defense: In Chiloé Spanish authorities promised freedom from the encomienda those indigenous locals who settled near the new stronghold of Ancud (founded in 1768) and contributed to its defense. The increased local organization of the defenses would ultimately undermine metropolitan authority and bolster the independence movement.

New roads
In the last decades of the 18th century the Spanish set out to build roads between strategic places in the coast. One such road, Caicumeo, connected the "city-fort" of Ancud with Castro. Another large road was projected to connect Valdivia with the settlements at the northern shores of Chacao Channel providing a pathway for reciprocal military aid. On October 1788 the Governor of Valdivia Mariano Pusterla sent an expedition to traverse the Huilliche-ruled territories to reach Chiloé. The expedition preved successful and by February 1789 the men were back in Valdivia. Pusterla subsequently arranged to improve the path to Chiloé, in particularly to widen it at places where it was a narrow path along forests. In a parliament with local Cuncos and Huilliches Pusterla assured the opening of the path along there would not imply a reestablishment of the city of Osorno. However the transit along this road depended on the goodwill of the local tribes and on September 1792 Huilliches revolted against Spanish encroachment.

Patrolling western Patagonia

The Spanish failure at colonizing the Strait of Magellan made Chiloé Archipelago assume the role of protecting the area of western Patagonia from foreign intrusions. Valdivia, reestablished in 1645, and Chiloé acted as sentries being hubs where the Spanish collected information and rumours from all-over Patagonia.

John Narborough's 1670 expedition to Patagonia and Valdiva, despite being done in peace time, caused much suspicion among Spanish authorities. In response the Spanish organized the Jerónimo Diez de Mendoza, Bartolomé Gallardo and Antonio de Vea expeditions which ran three consecutive summers from 1674 to 1676 seeking to find out any news about English bases in western Patagonia. Following the last expedition Spanish interest in the area waned and the focus of Spanish attention to repel tentative English settlements shifted from the Pacific coast of Patagonia to the Straits of Magellan and Tierra del Fuego.

In the aftermath of the wreck of HMS Wager (1741) in Guayaneco Archipelago a series of expeditions and patrolling was done in the coasts of Patagonia by the Spanish. A book based on the Wager wreck published in 1748 in England exposed weaknesses of the Spanish rule in the Southeastern Pacific. This book together with rumors of a new British expedition made the Viceroy of Peru send expeditions to populate Juan Fernandez Islands, establish a fort in the island of Tenquehuén near Taitao Peninsula, and search for a frigate the British would supposedly have sent into the southeast Pacific.

Depopulation and scorched earth strategy
As result of the corsair and pirate menace Spanish authorities ordered to depopulate Guaitecas Archipelago to deprive enemies of any eventual support from native populations. This then led to the transfer of indigenous Chono population to Chiloé Archipelago in the north while some Chonos moved south of Taitao Peninsula effectively depopulating the territory in the 18th century.

When the Spanish learned about the impeding Dutch expedition to Valdivia in the 1640s Pedro de Toledo, Viceroy of Peru, sent letters ordering local Spanish authorities use a scorched earth strategy against the invaders.

See also
Falklands Crisis (1770)
Juan Garland
Maritime history of Chile

References

Bibliography

History of the Captaincy General of Chile
Military history of Chile