Wiesbaden had been a royal city since the reign of Charlemagne, first mentioned in 829 as an administrative headquarters of a Königssondergau (Imperial special district).
The first written mention of Sonnenberg dates from 1208 or 1209 in the name of the first Burgmann ("castellan") Ulbert of Idstein-Sonnenberg as Sonnenburch and Sunnenberc.
Ownership of the land was initially disputed by the Saint Martin's Domstift (cathedral endowment) of Mainz.
The dispute over Sonnenberg was settled by a treaty in 1221, in which Nassau obtained the land on which the castle is built as a fief for 30 Marks.
In 1283, Walram's son Count Adolf of Nassau rebuilt the castle (it had been heavily damaged in conflict with Eppstein).
On 29 July 1351 the King of Bohemia, and later Holy Roman Emperor, Charles IV awarded the town of Sonnenberg rights to its own jurisdiction.
As a result, houses at the foot of the castle could now be surrounded by a wall in an overall integrated complex, providing the residents some security.
Sonnenberg experienced major damage in 1625 during the Thirty Years' War, so that only a dozen houses were habitable.
In 1529, Johann von Nassau-Sporkenburg, heir to the Hut family, opened the former private chapel to the residents of Sonnenberg.