Slash describes Nightrain as "an anthem that we came up with on the spot". The original idea for the song came when Slash and rhythm guitarist Izzy Stradlin wrote the main riff whilst they were sitting on the floor of the band's practice room. The next day, Slash was ill so Stradlin finished writing the music with Duff McKagen; however they did not write any lyrics. The song remained incomplete until one night when the band was walking down Palm Avenue whilst sharing a bottle of Night Train. Someone started singing 'I'm on the night train!' and the whole band joined in, with Axl Rose improvising the lines in between: "Bottoms up!" "Fill my cup!" etc. "Nightrain" was born. After this initial inspiration, the band finished the song within a day.
Slash describes in his autobiography how Nightrain is his favourite song to perform live: "That song has a rhythm to it in the verses that from the start always made me go crazy. The first time we played it, even, I started jumping up and down - I couldn't help it. When we had our huge stage later on, I'd run the length of it, jump off the amplifiers, and lose it just about every single time we played it. I'm not sure why, but no other song we've ever played live made me move like that."