We've seen that Chepstow Castle was still considered a fitting accomodation during the Tudor times, albeit with some added comfort. It also continued to be of strategially importance in controlling the crossing of the Severn.
While changes in Tudor times involved the living quarters, later alterations served to adapt the fortifications to modern warfare, like those made to the battlements in order to accomodate cannons.
Chepstow was still in possession of the earls of Worcester at the outbreak of the Civil War in 1642. At the time it was held by Henry Somerset, the fifth earl (later created 1st Marquess of Worcester) who had converted to Catholicism and declared for King Charles. Henry supported the king - not at least thanks to his enormous wealth by rising regiments and such - while holding a low profile himself, but when King Charles escaped the battle of Naseby and sought shelter in Raglan, another Worcester castle and the earl's main seat, Henry Somerset got actively involved in the war.
(right: Interior of the south-west tower)
The Welshman Sir Thomas Morgan, one of Cromwell's commanders and governor of Gloucester since 1645, untertook to flush out the Royalist resistance pockets in Wales. He laid siege to Chepstow Castle - something another general, Sir William Waller, had tried in vain two years before. Morgan, who had brought some 900 men along, put up heavy artillery on the hill opposite the castle and managed to blow a breach into the curtain wall, though it took him three days of constant fire. The commander of the castle, Irishman Colonel Edmond Fitzmorris, and his garrison of about hundred men surrendered. Morgan likely welcomed the booty of 18 cannons, the barrels of gunpowder and other supplies in the castle storage.
Morgan then moved on to lay siege to Raglan Castle where he was joined by forces under general Fairfax. Henry Somerset Marquess of Worcester stayed at Raglan which he had refortified, but the additions were of no use against the artillery power Fairfax could mount up, so Henry surrendered. The garrison got away, but Henry himself was taken prisoner and died at Windsor shortly thereafter. The castle was partly dismantled and the library, containing some rare Welsh texts, destroyed.
King Charles meanwhile had escaped to Scotand, but he finally surrendered to a Presbyterian Scottish army besieging his last refuge in Newark in May 1646. The Scots unfortunately sold him out to Cromwell; King Charles was tried by a parliament cleansed of everyone not on Cromwell's side, and was executed in January 1649.
Henry's son, Edward Somerset 2nd Marquess of Worcester (also known as Lord Herbert, and as Earl of Glamorgan) was involved in Charles' unfortunate treaty with the Irish and later had to flee to France. His estates were forfeited. Edward returned to England in 1652 and was kept under arrest for some time, but the whole episode is pretty muddled (1). Obviously, he got off lightly albeit financially ruined. All during those events, Edward occupied himself as an inventor who developed a primitive version of a steam engine, among other engineering projects.
King Charles' capture led to another series of Royalist uprisings. We get another obscure bit of history in Sir Nicholas Kemeys, the 'Captor and Defender of Chepstow Castle,' as an epic poem by Dafydd Morgan (1881) styles him. Obviously, Kemeys managed to retake the castle from the Parlamentarians in May 1648 and held if for some months until Cromwell marched west to put an end to the resistance in south Wales centered at Pembroke. He left Colonel Isaac Ewer behind to deal with Chepstow. Ewer must have used the same tactics as Fitzmorris, bombarding the castle from the opposite hillock until he managed to breach a wall. The garrison surrendered and Kemeys was killed. The circumstances of his death are not clear (3).
After the war, Chepstow Castle came into Cromwell's possession. Parliament granted him £ 300 to repair the castle. It was converted into a military barracks and a prison for political dissidents. Despite two successful sieges, the castle obviously was still deemed a worthy bulwark to spend money on repairs and additional fortifications.
(left: Hall in the Great Tower with the niches probably built by William the Conqueror and remains of the arcades separating the hall (at the wall to the right) which were added under the Marshal sons; see first post)
Lordship and town of Chepstow were returned to the marquess of Worcester upon the restoration of King Charles II in 1660. But the castle remained in possession of the king who kept it as fort. The garrison was raised and commanded by the marquess' son, Henry Lord Herbert (he would succeed to the titles of his father in 1667, and in 1682 became the first Duke of Beaufort). Henry spent an additonal £ 500 on improving the fortifications. The south-west tower and one of the middle bailey towers were filled with earth so they could support cannons. Cannon platforms were also built on the main gatehouse; the southern curtain wall was lowered and thickened and equipped with lines of musketloops. An inventory from the time lists several hundred muskets, but not all of them were in working shape.
Chepstow Castle continued to serve as prison. The most famous of those was Henry Marten († 1680) one of the men who signed King Charles' death warrant, who got away lighly with lifelong imprisonment; most of the other men on the list were executed. Marten lived in the tower that would take his name quite comfortably with his mistress and servants, and he was allowed to visit the local gentry.
Duke Henry did not live in Chepstow, though, he prefered town houses and modern country manors like Badminton House. His wife liked Chepstow even less. The garrison was finally disbandend in 1685; everything of value, including floors and fittings, removed to Duke Henry's other places.
It was the end of the castle as castle and fort, as well as living quarters for a lord, but not the end of the use of the buildings in Chepstow Castle. Some of those were used as industrial estates in the 18th century. We can find a glass blower' retort to make wine bottles in the great hall, and a nail manufactory in the middle tower. The baileys were cluttered up with timber buildings for the workers; there were a malting kiln and dog kennels, and I suspect some not fully legal use of the sea gate to the Wye river.
The late 18th century saw an increasing interest in the historical aspect of old castles. Visitors started taking tours of the remains of Chepstow Castle (the Marten Tower was still intact then and could be climbed to get nice view, though the parts of the castle not longer in use were overgrown) and nearby Tintern Abbey.
The 8th Duke of Beaufort († 1899) cleared out the industrial works and the shrubs and ivy, and turned the baileys into some sort of picturesque park with trees and rustic seats. The Beaufort Estate also began with the conservation of the remaining substance in the late 19th century. Chepstow Castle became the meeting place for Mediaeval pageants and set for films (the 1913 version of Ivanhoe, fe.). The last owner, the Lysagh family, gave the castle into guardianship of Cadw, the historic division of the Welsh Assembly Government, in 1953. Cadw maintains the place until today.
1) I only did a brief research but found some contradictory information about Edward having spent time as prisoner in England either after a capture in Ireland 1646 (well, if he was commander of the Confederate forces in Ireland that date would not work at all, dear Wikipedia) or 1648, or from 1652-54 upon his return from exile in France. Some websites don't mention the captivity at all. The 1652 date seems the most likely though I wonder why he would return, with his lands confiscated and Cromwell still in power.
2) There is an ebook edition of the poem, and a book about Keymes from 1923, which also mentions a poem by one R. D. Morgan in the title, but I could not find out more about that obscure poet.
3) The memorial plaque in the castle says he 'was slain'. The Cadw guidebook has 'shot peremptorily'. Considering the fact Colonel Ewer was among the men to sign King Charles' death warrant, I won't put it beneath him to accept the surrender of Kemeys and then have him shot peremptorily.