Kingdoms and Castles is described as 'A medieval city building game where you construct castles to protect your peasants from a living and dangerous world' and is a city building game in the games category. There are more than 10 games similar to Kingdoms and Castles for a variety of platforms, including Windows, Steam, Linux, Mac and Wine apps. The best Kingdoms and Castles alternative is RimWorld. It's not free, so if you're looking for a free alternative, you could try Dwarf Fortress or Crown of the Gods. Other Kingdoms and Castles like games are Banished, Tropico, Stronghold and Frostpunk.
It is the closest to kingdoms and castles. Both focus on city building and management instead of strategy and warfare.