The original version of "Ghosts 'n' Stuff" was made in 2004, and Joel Zimmerman said that it "ended up going through at least 10 revisions". Zimmerman and Rob Swire had been coincidentally meeting each other backstage at various festivals and agreed to collaborate. The song was made originally specifically for Pete Tong's BBC Radio 1 Essential Selection show on 10 October 2008. deadmau5 was a guest on the show along with Steve Angello (the two, with Tong, were playing a live set in Manchester, England on that night). In the week leading up to the show, Tong requested that deadmau5 create something new for his appearance for Tong's show. At the 81:03 mark of the broadcast, deadmau5 stated that the song was originally titled "Hotel" because he made it for Tong's show while staying in his hotel. He also stated that the song was only "just now" finished and that he was now calling it "Ghosts 'n' Stuff". deadmau5 later debuted this song to a live audience at the HARD Haunted Mansion 2008 in Los Angeles, CA.
The "hard intro" version of one B-side of the single, "Moar Ghosts 'n' Stuff" (which appears on the continuous mix version of For Lack of a Better Name) contains a vocal sample from the 1957 film The Brain from Planet Arous; "After I'm gone, your Earth will be free to live out its miserable span of existence, as one of my satellites, and that's how it's going to be...". It also contains a sample from the funeral march by Chopin. The unmixed version released on 20 October 2009 replaces this version with the original mix, which excludes the vocal sample and the funeral march intro.
A music video promoting the single was released in August 2009 and was directed by Colin O'Toole. It was shot in Toronto, Ontario, Canada. The video begins with Joel Zimmerman being rushed into a hospital, before dying within minutes of arrival. He is then revived as a ghost, and attempts to pass through the walls but cannot. He leaves the hospital and wanders around town, getting a tattoo of a Space Invader alien and running into a gang of other ghosts. After an unpleasant trip to a restaurant and a laundromat, Joel attends a rave with several people also dressed in costumes. At the party, someone wearing a mau5head pulls the white sheet off, as Joel is revived back in the hospital. He finds the Space Invader tattoo which he got as a ghost remaining on his neck.
In the United States, Ghosts 'n' Stuff received exposure from use in TV shows such as America's Best Dance Crew and heavy radio airplay. In the May 15, 2010 issue of Billboard, the track reached number one on the magazine's Hot Dance Airplay chart after 24 weeks of charting, thus making the single the longest climb to number one ever on the chart, as well as the first single to reach the top spot after it had dropped off, then returned to the chart.