Kozakowice is a village in Gmina Goleszów, Cieszyn County, Silesian Voivodeship, southern Poland, close to the border with the Czech Republic.
It lies in the Silesian Foothills and in the historical region of Cieszyn Silesia.
The village was first mentioned in a Latin document of Diocese of Wrocław called Liber fundationis episcopatus Vratislaviensis from around 1305 as item in Goschegowitz debent esse XIII) mansi.
The creation of the village was a part of a larger settlement campaign taking place in the late 13th century on the territory of what will be later known as Upper Silesia.
Politically the village belonged initially to the Duchy of Teschen, formed in 1290 in the process of feudal fragmentation of Poland and was ruled by a local branch of Piast dynasty.