The site of Koknese was originally a Latgalian and Selonian settlement named Kukenois. By the late 12th century, the settlement of Koknese had fallen under the loose sovereignty of Principality of Polotsk as a tributary sub-principality. At the beginning of the 13th century, the crusadingLivonian Brothers of the Sword led by Bishop Albert of Buxhoeveden of Riga began to occupy the shores of the Gulf of Riga. By 1205 in return for protection against Lithuanians and Polotsk, the Orthodox Church prince Vyachko of Koknese gave half of his land to Albert. By 1209 Koknese had been taken over by the Order, whereupon Albert ordered the construction of a stone castle where the Daugava meets the Pērse river to replace the wooden fortification of the Latvians. The formal sovereignty of Polotsk was finally revoked in 1215. The Order then controlled the town until its transference in 1238 to the bishops of Riga. The town became the summer residence of the Archbishop of Riga in 1420 and the primary residence in the 16th century. The castle was frequently a source of dispute between the bishops and the von Tiesenhausen family, which it had been granted to as a fief in 1269. They were supported by the Teutonic Order, as noble possession of the castle weakened the power of their rivals in the bishopric. The town, known in German as Kokenhusen, received its town privileges in 1277. During the 14th century, Koknese flourished as part of the mercantile Hanseatic League. Archbishop John V of Wallenrodt was able to resolve the conflict with the Teutonic Order and restore the territory to the church in 1397. During the Livonian War, Koknese was taken by Poland in 1561, which named the town Kokenhuza. Although Russian forces captured the town, it was recovered by Polish forces. During the 17th century Polish–Swedish wars, the town was repeatedly contested. It was the site of the Battle of Kokenhausen in 1601, in which the hussars of the Polish cavalry defeated their numerically greater Swedish adversaries. However, the town became part of the Dominions of Sweden in 1629 and was refortified by the Swedes. During the Russo-Swedish War were used for the siege of Riga and later destroyed according to the Treaty of Cardis in 1661. During the Great Northern War the castle was conquered by Saxony in 1700 and destroyed by the Saxons when they were forced to retreat before the Swedes in 1701. By war's end Kokenhusen was incorporated into Russian Empire with the rest of Livonia. Although the Russians had been calling it Kukeinos from the 13th century, they chose to keep the German name. A railway line running through Koknese was completed by 1861, allowing the town to become a recreational site. The Baltic German von Löwenstern family constructed a Neo-Renaissance manor castle which was completed in 1894; however, it burned down during the 1905 Russian Revolution. After Latvian independence from Russia and Germany was declared after World War I, a hill in the town was dubbed "Professor's Hill" owing to its popularity as a meeting place for intelligentsia. By then the town was known by the Latvian name Koknese. The Plavinas Hydro Power Plant was commissioned near the town in 1966. Its construction left the foundation of the castle ruins underwater.
The Koknese Manor Park, located over parts of the medieval town and castle ruins, contains the tallest wooden sculpture in the country. The structure, built by Ģirts Burvis, was opened in 2002 to commemorate the 725th anniversary of the town's foundation.