The castle was formerly a Premonstratensians Cloister, founded in 1144-1145 by the wife of Vladislav II, Duchess Gertruda. The cloister church originally looked like a Romanesque basilica. Soon after the fire of 1200 the cloister and the church were rebuilt. But 100 years later they were hit by another fire. During the Hussite Wars the cloister was set on fire by the Prague Hussite Army in 1421 and it was badly damaged. The same happened again in 1778 during the war with Prussia. The biggest development of Doksany started at the end of the 17th century and lasted until the mid 18th century. Buildings were rebuilt in the Baroque style and many of them were extended. During the reign of Joseph II the cloister was abolished in 1782. Terezie Poniatowská had the prelature rebuilt into a castle which was used by the Aehrenthals until 1945.