Dunyvaig Castle, (Scottish Gaelic: Dùn Naomhaig, Anglicised Fort of the galleys, also known as Dunnyveg) is located on the south side of Islay, in Argyll, Scotland, on the shore of Lagavulin Bay, 4 kilometres (2.5 mi) from Port Ellen. The castle was once a naval base of the Lord of the Isles, chiefs of Clan Donald. It was held by the chiefs of the Clan MacDonald of Dunnyveg.
A castle was built on top of a fort or dun. Somerled used the castle as a base for his galleys.
Forfeited in 1493, the castle passed to the MacIans of Ardnamurchan. Afterwards the castle was leased to the MacDonalds, then the Campbells and back to the MacDonalds.
Surrendered to Andrew Stuart, 3rd Lord Ochiltree and a royal force in 1608 by Angus MacDonald, 8th of Dunnyveg and garrisoned with royal troops with the constable Andrew Knox. In 1614, the castle was taken by Ranald Og MacDonald, however was retaken by Angus Og MacDonald, who attempted to bargain the castle's surrender. Knox attempted to retake the castle and was defeated and compelled to retreat. Knox left his son Thomas and his nephew John Knox of Ranfurly as hostages for his good faith. The hostages were freed by John Graham and on 6 January 1615, Sir John Campbell of Calder, with the assistance of Sir Oliver Lambart, retook the castle.