The film is based on Thomas Vinterberg's play of the same name, which is inspired by his colourful childhood in an academic commune north of Copenhagen.
Freja's room was a complete copy of Thomas Vinterberg's room in the commune he lived with his parents from the age of seven until he was 19.
Thomas Vinterberg wrote the part of Emma specifically for Helene Reingaard Neumann, his wife in real life. Emma is a mirror version of Anna (played by Trine Dyrholm. Vinterberg and Neumann began a relationship on the set of When a Man Comes Home (2007), when Vinterberg was married to Maria Walbom. Vinterberg told in interview with The Globe and Mail in May 2017 that he had to be fair to the women of this film, he had to be sharing with them and deliver the ugly sides of being a man.