For centuries, the rich nocturnal environment of the starry sky could be modelled only by analogue tools such as paper planispheres, atlases, globes and numerical tables. The immersive sky simulator of the twentieth century, the optomechanical planetarium, provided new ways for representing and teaching about the sky, but the high construction and running costs meant that they have not become common. However, in recent decades, "desktop planetarium programs" running on personal computers have gained wide attention. Modern incarnations are immensely versatile tools, mostly targeted towards the community of amateur astronomers and for knowledge transfer in transdisciplinary research. Cultural astronomers also value the possibilities they give of simulating the skies of past times or other cultures. With this paper, we provide an extended presentation of the open-source project Stellarium, which in the last few years has been enriched with capabilities for cultural astronomy research not found in similar, commercial alternatives.