The film marked Alexandre Desplat's second collaboration with Wes Anderson after the stop-motion animated film Fantastic Mr. Fox (2009). Mark Mothersbaugh, who composed for Anderson's early films had worked on one of themes. Mothersbaugh contributed to the percussion instruments for the film score.
Desplat said that "Music is never inherently funny! For me, comic scores always have to have some melancholy in the background. But for Moonrise Kingdom, I was trying more to embrace the world of fantasy of those two adolescents, and capture their sense of adventure and purity." He wrote a seven-minute suite entitled "The Heroic Weather Conditions of the Universe"; describing the title Anderson had said that "it is possible we went too far with the title—we thought it might make it sound more epic". He recalled in a 2015 interview to Vulture, on the motivation of the music, as while building the instrumentation of the suite, orchestra and choir, the score "gave the sensation where we were following the path of the two children. We follow them but they have their own space [...] They connect with their childhood to the music, but they're now heading towards their freedom. There was this sensation of freedom that was the goal, giving an excitation. Like when you're 11 or 12 and you go to camp with friends in the summer, there's the expectation that there will be adventure and fun and that you'll meet new friends and maybe make a new love. That was exactly what we were trying to achieve with the music, and I think we achieved it quite well."