It was composed by Joseph Mohr, the local priest at Oberndorf, Austria a chilly winter of 1818. Unfortunately, the church's organ was broken and it would be impossible to have it fixed due to the terrible weather and so he collaborated with Franz Gruber using a guitar accompaniment as an alternative instrument. The two men subsequently performed the carol and they did an outstanding job as they played it on a Christmas Mass so beautifully given the short notice.
That wonderful moment left a mark in the history of festive music, carved its way into the hearts of billions, and subsequently, get translated into a hundred different languages and the song is performed all over the world during Christmas celebrations.
Know more of its background at: https://galaxymusicnotes.com/pages/the-story-behind-the-christmas-carol-silent-night