In 1632 Governor General Hendrik Brouwer started construction of a wall with bastions, to protect Batavia against an attack. The wall made of coral stone replaced the earthen wall at the east side of the city (1623) and the redoubts which were built after the sieges of 1628 and 1629. The bastions not only protected against an attack from outside, but their location opposite of the main streets also made it possible to repress a rebellion inside the city. The fear of a rebellion was also the reason that there was not only a moat at the outside of the wall but also a moat at the side of the city.
The caste protected the north east side of the city. A wall was built between the southeast bastion of the castle (Robijn) and the first bastion of the city wall (Amsterdam). The names of the bastions and main gates (Poort) at the east side of the city wall were: Amsterdam-Middelburg-Delft – Rotterdamse Poort gate (Pintu Antjol)
Rotterdam, Hoorn, Enkhuizen, Vianen – Gelderland
Nieuwpoort (Pintu Besar) and Hollandia. The last bastion, Grimbergen, protected the bridge across the Kali Besar. When in 1640 the wall along the river between Hollandia and Grimbergen was finished, the defenses of the eastern part of the city were complete.
The construction of the city wall at the west side of the city took more time. The moat was dug, but it was not before 1645 till the last part of the wall between the bastions Zeeland and Groningen was built. West of the river were the bastions Diest Poort (Pintu Kecil)
Zeeburg and Culemborg. The finishing touch was the floating beam which closed the river during the night. The castle stood at the other site of the river.
The only attack on the city took place in October 1740. Chinese rebels stormed the Diest Poort but were repulsed by the soldiers on the wall. After the rebellion a hornwork was built before this bastion. In the 18th century several proposals were made to modernize the city wall, which was old-fashioned. These were never realized because they were too expensive. At the end of the 18th century the wall offered no more protection against an attack. The only function of the gates was to control the in
and outgoing traffic. In 1803 the doors of the gates were removed. The wall and gates were demolished between 1810 and 1815.
Today only a part of the eastern wall between the (demolished) bastion Groningen and bastion Zeeburg and from there till bastion Culemborg still exists. The watch tower which was built inside bastion Culemborg around 1830 was not part of the defense works, but was built as an observation post for the weather and incoming ships. Both the bastion and the tower can still be visited.
There are no remains of the eastern wall. The Oostzijdse Pakhuizen (Eastside Warehouses), which were built between 1748 and 1759 on the square before the castle , were once part of the defense wall between the castle and bastion Amsterdam.