La Llacuna is a small municipality in l'Anoia comarca in Barcelona Province. In 2022 it had 942 inhabitants.
The first documentary reference to the castle of Vilademàger is from 987. It was part of the defensive line of castles (with Pontons, Miralles, Montagut, Querol, Pinyana, Orpí, Queralt, etc.) at this end of the Penedès. Over time, it lost its defensive function, and the population gradually settled in the valley.