Running Your Own Music Streaming Platform

The steps I took to run my own open-source music server

Share
A blue-green gradient with the title "running your own music streaming platform" written next to assorted music notes

For almost two years I've been experimenting with running my own music streaming service because I wanted to get away from endless Spotify subscription increases. In the last 6 months I finally reached a point where my system was stable enough to truly rely on it and use it to its full potential.

⚠️
DISCLAIMER! This is intended only for you to run your own music server for yourself and maybe a small number of family members/loved ones. It would be illegal to run a streaming service for the public if you don't have a license to be streaming music, even if you bought the music files properly.

If you are tired of paying higher and higher prices, or are tired of subscription streaming services for any reason then you should consider self-hosting your own.

I've broken the process down into four main categories to make it as simple and non-technical as possible:

  1. Obtaining Music
  2. Managing the Music Library
  3. Hardware Needs
  4. Running the Software

Obtaining Music

When you use a streaming service like Spotify or Apple Music this step is barely a consideration, the entire world's music is at your fingertips.

In order to run your own streaming service you will need to obtain your music directly and intentionally. I'm not going to endorse torrenting or any illegal methods of downloading music, but there are ways to download music for free that don't break the law.

My favourite way to get new music growing up was to regularly visit my local library and check out any CDs that seemed interesting, because it is (usually) very simple to copy songs off a CD onto your computer. If you don't have a computer with a CD drive there are very cheap ones that you can buy online or at your local tech store and plug into any computer with a USB cable.

You should also ask around for family and friends to loan you any CDs they might have lying around in order to build up your library.

There is also lots of great music available for free on sites like Soundcloud, including some mainstream artists that release their music for free on there after a few years. And of course buying music from online stores like iTunes or buying the physical copies in-store is available.

If you want to have a music library that rivals Spotify and are not going to torrent your music, self-hosting your own music streaming server is probably not for you. For myself, I found that while it was at times useful to be able to immediately find obscure music that I'd never heard of, most days of the year I never strayed from my few hundred songs that I had in my "main" playlists.

You can still use a free Spotify account to check out new music before you decide to buy it or hunt for a free way to download it, but paying upwards of $15 per month to listen to the same set of songs over and over did not make sense to me.

Managing the Music Library

Once you have obtained your music, you need a system to keep it organized – and I don't mean in playlists. The actual music files (song-name.mp3 for example) themselves need to be stored in a manner that makes sense. Most streaming services expect your music to be stored in the following folder hierarchy:

Artist > Album > Song

Each artist gets a folder, and inside each artist's folder would be a folder for every album/EP that you have downloaded. Then inside the album folder is where the actual MP3 files live. There are some edge cases like what should happen with singles or remix versions that didn't release with an album, but usually as long as you are consistent then you won't run into any issues.

Personally, I have the following folders in every artists folder in addition to any album folders:

  • Singles
  • Remixes
  • Live

However you decide to organize the storage of your music library files files is only the first step, and also the simpler one. The bigger issue to tackle is handling the metadata or tags for your music files. Every music file, as well as some video files, support a universal system for adding tags called ID3 tags.

These tags hold information about a song from the artist and album names to year of release, genre, and country of origin. There is also the ability to create your own custom tags which can be used to help you further customize the sorting of your library.

One of the best tools for managing tags that works on most operating systems (Windows, Mac, Linux, etc.) is Picard, which is published by MusicBrainz. It uses the free MusicBrainz online encyclopedia to help you identify and categorize all of the songs in your library.

This is only something you need to worry about if you are downloading music from unofficial sources or from older CDs. If you buy music from iTunes or download from newer CDs the audio files will already have the basic tags like artist name and album name setup properly.

Hardware

In order to get started with any of this, you will need a computer or device that will store the music files and run the software that powers the streaming service. Luckily the programs don't need super powerful computers to run so your biggest problem is going to be paying the modern inflated prices for storage devices once your library starts to reach into the tens of thousands of songs.

As a benchmark, I have a mix of high quality (FLAC) and standard quality (MP3) music files for my music and with just under 15,000 total songs in my library I require just under 500GB of space. As of writing, you are looking at a cost of around $200 to get that amount of storage new from the store.

Hard drives are not usually sold in smaller capacity than 2TB, and a new one costs about $250 with tax band new at the time of writing. When it comes to Solid State Drives, which are faster at storing/moving files than hard drives but definitely not necessary for a music server, these do come in 500GB easily and cost between $150 and $200 brand new.

I would recommend getting at least 1TB of storage unless you know for sure you don't want to have a large selection of music. The reason I recommend this is because it can quickly grow when you want to download one song off a CD or album and decide you may as well download the whole album in case you end up liking the rest of it too.

For the rest of the computer, any old PC from the last 5 - 10 years should be good enough to run it. I started running my music server on an old Lenovo that had an Intel i5 (7th generation) processor and only 4GB of RAM. It worked perfectly fine and I only moved it to a more modern Lenovo mini PC because I wanted it to take up less space on my shelf.

If you want to buy things brand new and are also in Canada, I've always used Canada Computers and have had no issues. I know their website was hacked earlier in 2026 but I always go in person anyway because I don't ever feel like I can trust expensive technology to be shipped safely.

Running the Software

The final step is the actual software that runs the music server. I have used Airsonic-Advanced from the start and I really like it, but it does have a very old-school internet interface that some people may not find easy to use. The version I use is maintained by the Linux Server project here: https://docs.linuxserver.io/images/docker-airsonic-advanced/

If you do want one that has a more modern feel, I have only heard great things about Navidrome. I just personally don't like the look of it (though I know it could be customized) and Airsonic already fits exactly what I wanted.

Either way, I recommend going the docker compose route because it is the simplest way to guarantee it works no matter what computer you're running it on. I always recommend learning Linux because it does end up making things easier in the end, and it has gotten so user friendly in recent years, but you can still use docker on Windows or Mac if you're too nervous to make the jump.

If you want to be able to access your music server from other devices, I use Tailscale with the caddy web server to enable this and I recommend it due to its simplicity. I wrote a whole blog post about how my homelab servers use Tailscale and caddy to access my services if you want the whole background: Self-Hosting Docker Containers with Tailscale and Caddy

If you just want to see my setup files for my airsonic server though, I've included them below. And if you are going the Navidrome route, their documentation can be found here: https://www.navidrome.org/docs/installation/docker/

compose.yaml

The Docker Compose file for the containers running airsonic, caddy, and tailscale:

services:
  tailscale:
    image: tailscale/tailscale
    container_name: airsonic-ts
    hostname: airsonic
    environment:
      # create authkey in your Tailscale web admin console
      # make sure its the Auth Key not an OAuth Key or API key
      - TS_AUTHKEY=tailscale-auth-key-here 
      - TS_STATE_DIR=/var/lib/tailscale
    volumes:
      - ts-data:/var/lib/tailscale
      - sock_vol:/tmp
    devices:
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - net_admin
      - sys_module
    restart: unless-stopped
  caddy:
    image: caddy
    container_name: airsonic-caddy
    cap_add:
      - net_admin
    network_mode: service:tailscale
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./site:/srv
      - caddy_data:/data
      - caddy_config:/config
      - sock_vol:/var/run/tailscale
  airsonic:
    image: lscr.io/linuxserver/airsonic-advanced:latest
    container_name: airsonic
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - JAVA_OPTS=-Dserver.use-forward-headers=true
    volumes:
      - ./airsonic-advanced/config:/config
      - ./playlists:/airsonic/playlists
      - /home/d3jar/Music:/airsonic/music
      - ./data:/airsonic/data
    network_mode: service:tailscale
    devices:
      - /dev/snd:/dev/snd #optional
    restart: unless-stopped
volumes:
  caddy_data:
  caddy_config:
  sock_vol:
  ts-data:

Caddyfile

The Caddyfile that would be saved in the same directory as the compose.yaml file shown above. You would replace the "tailnet-address-here" with the unique address that you get from Tailscale for your tailnet. This line will end up being the URL you type into your browser to reach the streaming service, like typing in spotify.com.

You could also change the "airsonic" part in the first line to be something like "music" but then you need to change the 5th line in the above compose.yaml file that starts with "hostname" so that it matches. So to change the URL to be music.tailnet123.ts.net your 5th line in the compose.yaml file would have to say "hostname: music".

airsonic.tailnet-address-here.ts.net {
	reverse_proxy airsonic:4040
}

Wrap Up

If you do choose to embark on this journey, I wish you luck. It is very rewarding but not because it is easy. I personally enjoy the feeling of solving problems and putting in a bit of extra work to know that I have accomplished something cool.

I also like to know that should things change drastically overnight, say a certain country decides to escalate a silly trade war and cut us off from digital services like Spotify or even just a regular internet outage, I'd have my own music server running on open-source software that would still work.

It can be frustrating at times like when a major new update releases and you have to tweak some code or configurations to make sure things continue to work, but I find it to be more than worth it.

I can't promise I'll be able to help with anything or that I'll be available to, but if you reach out to my email I'm always happy to try at least. You can email me at [email protected] and you can find some of the social media I sometimes use on my main website: www.davidjardine.ca