Coin-operated music boxes and player pianos provided automatic pay-per-tune music in fairgrounds, amusement parks and other public places in the 1800s, decades before the introduction of reliable coin-operated phonographs.
Some of these automatic musical instruments were extremely well built and have survived until now. In the long run, they could not compete commercially with the jukebox, since they were limited to the instrument (or instruments) used in their construction, and could not reproduce the human voice.
One of the early forerunners to the modern Jukebox was the Nickel-in-the-Slot machine. In 1889, Louis Glass and William S. Arnold, placed a coin-operated Edison cylinder phonograph in the Palais Royale Saloon in San Francisco.
It was fitted with a coin mechanism patented by Glass and Arnold, and collected a nickel for each play. The machine had no amplification and patrons had to listen to the music using one of four listening tubes. In its first six months of service, the Nickel-in-the-Slot earned over $1000.
During the 1890s, recordings had become popular primarily through coin-in-the-slot phonographs in public places.
Initially, manufacturers did not call them "jukeboxes." They called them Automatic Coin-Operated Phonographs (or Automatic Phonographs, or Coin-Operated Phonographs). The term "jukebox" appeared in the 1930s and originated in the southern US. The term either derived from African-American slang "jook" meaning "dance", or a name given to it by critics who said it would encourage criminal behavior, referring to the fake family name "Juke." (info from About.com and Wikipedia)