Estimated reading time: 9 minutes

Have you ever found yourself eagerly awaiting your „Spotify Wrapped“ in December? That one moment a year when Spotify holds up a mirror to you and shows you that you've actually been listening to way too much 80s synth-pop?

What if I told you that you didn't have to wait until the end of the year? Imagine having your own private dashboard that tracks every single second of your music tastes - in real time, on your own server and with full data control.

Here comes YourSpotify into the game. In this guide, I'll show you how to install this ingenious self-hosted tool and why it's the ultimate upgrade for any music nerd.

For detailed instructions and explanations of all configuration options, I recommend watching the YouTube video linked below. This video goes into detail about each individual setting, providing you with comprehensive instructions on how to set everything up correctly. Any code from the video can be found in this article, so you can use it directly without having to type it out.

This blog post, including video, is part of a series in which we build and set up our own home server. We start with the basics, such as installing Ubuntu VM with Docker, and then move on to configuring our own domain, security measures, and, above all, lots of cool and useful self-hosted services. Whether it's media servers like Plex or Jellyfin or document management like Paperless-NGX, we'll work together to build the setup you want to see. We'll even tackle topics like single sign-on (SSO) together.

What is Your Spotify actually?

„Your Spotify“ is an open source application developed by the developer Yooooomi was brought to life. At its core, it is a duo consisting of a web server and a smart web interface. The server queries the Spotify API at regular intervals to see what you are currently listening to. This data is stored in a database and visualized for you.

The highlight: unlike the official Spotify Wrapped, which only shows a fraction of your data (and only for a limited period of time), here everything is yours. You can see your top artists, albums and songs over weeks, months or years - without Spotify deciding what is „relevant“.

The most important features at a glance:

  • Playlist generator: Create playlists based on your most-listened songs directly from the dashboard.
  • Real-time statistics: See how your taste changes immediately.
  • Historical data: Import your entire Spotify history since account creation.
  • Multi-user support: Host the dashboard for yourself, your family or friends.
  • Data protection: Your data is stored on your server, not in some cloud.
YourSpotify
YourSpotify Dashboard

Why should you host it yourself?

You might be asking yourself: „Aren't the standard stats enough for me?“ Well, there are three key reasons for self-hosting:

  1. Completeness: Spotify Wrapped often ignores the time after October. Your Spotify tracks 365 days a year, 24/7.
  2. Transparency: You can see the exact number of streams. Not just „You are in the top 1%“, but „You have listened to this song 452 times“.
  3. Learning effect: It's a fantastic project to familiarize yourself with Docker, APIs and databases.

The technical foundation: Why MongoDB and Node.js?

To understand why YourSpotify is so high-performance, we need to take a look under the hood. The application uses the so-called MERN stack (but with a focus on the backend).

  • MongoDB: Since music data (JSON metadata from Spotify) is often unstructured or the API responses can easily change, a NoSQL database like MongoDB is ideal. It stores your streams as documents, which allows for extremely fast queries when filtering for „top songs in summer 2021“.
  • Node.js & React: The backend is written in Node.js, which is perfect for Spotify's asynchronous API calls. The frontend (React) ensures that the diagrams are animated smoothly.

Why not just use an Excel list?

Some people use export tools to push their data into Excel. But here's the problem: Spotify data is „alive“. A song you listen to today may have a different album cover tomorrow or the artist ID may change. Your Spotify keeps the links consistent and allows you to navigate through the data as if it were a native Spotify app.

Step-by-step: How to install YourSpotify

Installation is surprisingly easy thanks to Docker-Compose. Here is the roadmap on how to go from „no idea“ to „data pro“.

1. create conditions

Before you start, you need:

  • A server (e.g. a Raspberry Pi, a NAS such as Synology or an inexpensive VPS).
  • Installed Docker and Docker Compose.
  • A Spotify account (of course!).

2. create the Spotify API app

To allow your server to talk to Spotify, you must „introduce“ it:

  1. Go to the Spotify Developer Dashboard.
  2. Create a new app („Create App“).
  3. Give it a name (e.g. „My Stats Dashboard“).
  4. Very important: Set the Redirect URI. If you test locally, this is usually: http://localhost:8080/api/oauth/spotify/callback.
  5. Copy the Client ID and the Client Secret. We need these right away.

3. configure Docker-Compose

Create a file called docker-compose-yourspotify.yml. Here is a proven template based on the official repository:

services:
  yourspotify:
    image: lscr.io/linuxserver/your_spotify
    container_name: yourspotify
    restart: unless-stopped
    networks:
      - sascha
    environment:
      - TZ=Europe/Berlin
      - APP_URL=https://192.168.178.79:446
      - SPOTIFY_PUBLIC=yourSpotifyAppClientID
      - SPOTIFY_SECRET=yourSpotifyAppClientSecret
      - CORS=all
      - MONGO_ENDPOINT=mongodb://yourspotify-db:27017/your_spotify
      - PUID=99
      - PGID=100
      - UMASK=022
    ports:
      - "8585:80"
      - "446:443"
    healthcheck:
      test: ["CMD", "curl", "--fail", "http://localhost", "||", "exit", "1"]
      interval: 1m
      timeout: 10s
      retries: 3

  yourspotify-db:
    image: mongo
    container_name: yourspotify-db
    restart: unless-stopped
    networks:
      - sascha
    environment:
      - TZ=Europe/Berlin
    ports:
      - "27017:27017"
    volumes:
      - /mnt/cache/appdata/mediaserver/yourspotify-db:/data/db:rw
    tmpfs: # The tmpfs mounting is only to get rid of the empty volume
      - /data/configdb
    healthcheck:
      test: ["CMD-SHELL", "echo 'db.runCommand(\"ping\").ok' | mongosh localhost:27017/test --quiet"]
      interval: 1m
      timeout: 10s
      retries: 3

networks:
  sascha:
    external: true

This Docker Compose file sets YourSpotify together with a required database to analyze your Spotify statistics.

The services

  • YourSpotify (application): The main program that provides the web interface and logic. It is loaded via the Linux server image and restarts automatically if it has not been stopped manually.
  • YourSpotify-DB (database): One MongoDB, which serves as a storage location for your collected data. It communicates internally with the main application.

Networks and accessibility

  • Both containers communicate via the external network sasha.
  • The application is available via Port 8585 (standard) and securely via port 446 (HTTPS) can be reached.
  • The database uses the standard port 27017, to be accessible for the application.

Configuration and Spotify connection

  • For the app to work, the Spotify Client ID and the Secret which are required for communication with the Spotify interface.
  • The application knows exactly where to find the MongoDB database via an internal address.
  • The user IDs 99 and 100 are again used for the file authorizations on the server.

Safety and maintenance

  • Health check: Both containers check independently every minute to see whether they are still responding. If the application or database does not respond three times in a row, the status is marked as faulty.
  • Data storage: The database stores its information permanently on the host system in the path for media server data. Temporary configuration data is stored in the working memory (tmpfs) to keep the server clean.

4. start and enjoy

Open your terminal and you can then simply start the services with the following command (the name must of course be adapted):

docker compose -f "docker-compose-yourspotify.yml" up -d

After a few seconds you can click on https://:8585 to access your dashboard. Log in with Spotify and the tracking begins!

Advanced installation: reverse proxy and security

If you don't just want to use YourSpotify at home on your Wi-Fi, but also want to see what you're listening to on the bus, you'll need a Reverse proxy.

Accessibility via HTTPS

Nobody wants to send their Spotify access data via an unencrypted HTTP connection. This is where tools like Nginx Proxy Manager (see Installation of NGINX Proxy Manager incl. video) or Traefik into play.

  • Explain how to create a subdomain (e.g. stats.your-domain.com).
  • Go to the SSL certificate from Let's Encrypt in.
  • Important: If you change the URL, you must go back to the Spotify Developer Dashboard and change the Redirect URIs otherwise the login will fail.

The „deep dive“: import your past

If you install YourSpotify fresh, it starts from scratch. But the tool offers a powerful import function. You can request all your data from Spotify (under the privacy settings).

  • Small data set: Takes about 5 days (last year).
  • Extended history: Can take up to 30 days (all data since account creation).

As soon as you receive the JSON files from Spotify by email, simply upload them in the settings area of Your Spotify. Boom - suddenly you have years of statistics!

Then you can also see how much data Spotify collects about you and your listening behavior. Every song listened to by every user is tracked. A huge flood of data.

YouTube video implementation

Conclusion: Is it worth the effort?

Absolutely! YourSpotify is more than just a gimmick. It is a tool for music lovers who like to dig into data and want to have full control over their listening habits. Installation is done in 15 minutes (thanks to Docker) and the added value is enormous. You can discover forgotten gems in your library and see exactly how your musical tastes develop over the seasons.

The product display was implemented using the affiliate-toolkit WordPress plugin.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.