On 1 June 1999, a piece of computer software was released that changed the way we listen to music forever.

Napster didn’t exactly sound like something that would cause consternation in the boardrooms of record companies. But within a few short years it would spell the end of the gold rush record companies had enjoyed in the age of the CD, and change how music is consumed and even written.

Napster was the brainchild of Shawn Fanning, a 19-year-old US computer hacker who had worked out a way to share music for free. It was, essentially, a cataloguing system that searched your hard-drive, listed all the MP3 music files contained in it, and allowed those to be shared with and played by anyone else using the software. Together with Sean Parker, Fanning created a service that made music discovery almost instant and without cost.

“It was something that provided a better, more reliable and fun way for people to share music and see each other’s music collection,” Fanning told the BBC World Service. “For the first time this full history of recorded music was available online to everyone instantly.”

Genie in a bottle

Compared to the music streaming services we now have available at the click of a button or even a few short words directed at a smart speaker, Napster required a little more effort before you could reap the rewards. First you had to download the software. You also had to mark the directory that you stored your music files as “shared” so that other Napster users could access it. Then you connected to the internet, fired up the Napster software, then typed in the name of the song or artist you were looking for. Napster would connect you with other users who had a copy of that song, and then allow you to download it.

It was an industry-destroying genie, and Napster was the spell that released it from the bottle forever. Its initial release was unheralded – the music industry’s attention was mostly fixated on the Backstreet Boys’ album Millennium, which was released a week before and sold more than 1.13 million copies, breaking the first-week sales record in the US.

It was an industry-destroying genie, and Napster was the spell that released it from the bottle forever.

Napster came at the end of a decade of expansion and healthy profits in the global music industry. The CD had become an enormously popular format; almost one billion were sold in the US in 2000, and at around $16 an album, they weren’t exactly cheap. The 1990s gave birth to many classic albums, but not every LP was deep-pile quality from start to finish. People were paying a premium price for a CD which might contain only two or three songs they wanted.

So, the lure of free music proved just too enticing to fans, and the music industry was initially slow to respond to the looming crisis. As former Rolling Stone journalist Steve Knopper wrote in his book Appetite For Self-Destruction: The Spectacular Crash Of The Record Industry In The Digital Age, the way the music industry dealt with Napster paved the way for a series of disastrous decisions the industry made as the sheer scale of the digital threat started to become clear.

‘Sue first’

While one record label – A&M – filed the first lawsuit against Napster, it was a band’s campaign that captured the public attention. Metallica took Napster to court after finding an alternative mix to their song I Disappear on the service – a version which had never been officially released. On 13 April 2000, Metallica filed a lawsuit against Napster for copyright infringement, racketeering and unlawful use of digital audio interface devices at a district court in Northern California. Metallica then tracked down the names of 335,000 Napster users who had shared their music and asked Napster to ban them from the service (which Napster did). Metallica’s crusade created a backlash, with some of their own fans seeing it as a personal attack against them.

Knopper, now an editor-at-large for Billboard, tells BBC Music that the music industry’s sue-first response to Napster only exacerbated the negative effects – especially as Napster was joined by a raft of other file-sharing sites.

The music industry’s sue-first response to Napster only exacerbated the negative effects

“When they realised it was enabling mass piracy that could destroy their business, they dealt with file-sharing almost exclusively through lawsuits and copyright protection,” says Knopper. “This was a costly error. None of these defences worked and record executives spent four or five crucial years losing serious business to Napster before Steve Jobs came along with the iTunes Store.

“It's my contention that record companies could have avoided much of this had they been smarter about dealing with Napster – if not licensing content to it directly, then doing a better job of creating a competing, cost-effective service rather than just stonewalling and treating the Internet as a threat.”

Late embrace

Napster was the beginning, but by no means the end of the digital revolution. The music industry’s litigation worked, at least on paper – it was served with an injunction and shut down its server in July 2001. It reopened in September the same year, after paying $26m toward past and future royalties. It then tried to turn the service into a subscription model, but the lure of free music was too much. Other providers – Gnutella, Limewire, Kazaa and Grokster – took Napster’s model and ran with it. Music sales tumbled as result.

What Napster did more than anything, Knopper says, was to correctly identify that the future of music was online, and not in racks of metal and plastic. “While it was active, Napster anticipated what eventually came to pass – a combination of Apple/iTunes, YouTube, Spotify and social media, all of which dominate how we discover and consume music today, he says. “The music industry eventually figured out how to profit from these things, but it took some 10 or 15 years. That lengthy waiting period almost destroyed the business, until streaming came to the rescue years later.”

The music industry eventually figured out how to profit from these things, but it took some 10 or 15 years – Steve Knopper

Napster, weighed down with legal bills, struggled to survive; in June 2002 it filed for bankruptcy and its assets were later liquidated. The Napster name was eventually taken by music provider Rhapsody, who now trade internationally under the Napster name. But in its wake came YouTube, iTunes and Spotify, digital-only environments that changed the way we consumed music. Importantly, all of them – either through subscription, adverts or licensing – deliver money back to the music labels. The industry’s revenue is rising again, but it’s still around half of its 1999 peak.

Would the music industry have had to survive a less damaging decade if it had embraced Napster instead of seeing it as an enemy?

“Ten or even five years ago, that would have been an easy question – yes,” says Knopper. “But streaming has returned growth to the record business, and we're seeing huge expenditures again, like advances to artists, multiple millions paid out to unproven SoundCloud rappers and Tik Tok viral-video stars. Maybe the lesson here is the record business always wins in the end. But they sure made it unnecessarily hard for themselves for a long time.”

If you liked this story, sign up for the weekly bbc.com features newsletter, called The Essential List. A handpicked selection of stories from BBC Music, Culture, Capital, Future and Travel, delivered to your inbox every Friday.