Your Spotify - zbrewer/homelab GitHub Wiki
Your Spotify is a self-hosted dashboard for Spotify that shows listening statistics.
Installation
The GitHub page for this project includes installation instructions as well, but this is a brief overview and includes instructions for operating behind a reverse proxy (Caddy).
Spotify Application
You'll want to start by creating a new application through the Spotify developer dashboard. Make sure that the redirect URI
is set to what the address of the Your Spotify backend will be on your network, with /oauth/spotify/callback
appended to the end. For me, this is https://yourspotify-backend.brew.foo/oauth/spotify/callback
since I'm passing the traffic through a reverse proxy. See the Your Spotify documentation for more information about setting up this application.
Once the application has been created, open it from the Spotify developer dashboard and then click Settings
. You should see the Client ID
at the top of this page, and a button to show the Client Secret
. Copy both of these values for the next section. While here, click User Management
at the top and add any additional users that you would like to be able to use this Your Spotify instance (you'll need the email address associated with their account).
Docker Compose
Next, deploy Your Spotify using Docker Compose. I use this Docker Compose file and set it up directly through Portainer. Make sure that you set the Client ID
and Client Secret
to the values copied in the previous section. Also make sure that the API/client endpoints are set to the reverse proxy URIs that you will be using.
Note a couple of differences between my configuration and the configuration from the GitHub page:
- I'm using Mongo 4.4 (instead of 6) for compatibility. This was suggested by the project page.
- I have the Spotify client ID and client secret defined as environment variables. These will need to be set in a
.env
file for Docker Compose, or in theEnvironment Variables
section of Portainer. - I'm using a volume, rather than a bind mount, for the database data.
- I'm using internal URIs, defined with my reverse proxy, rather than localhost for the backend/frontend addresses. This lets me access the application from computers other than the one where Docker is running.
After deploying the application, make sure that the API/client endpoints you set are defined with your reverse proxy and that they point to these newly deployed containers. See my Caddyfile for an example.
At this point, you should be able to visit your new install and log in. You'll need to follow the instructions from the project GitHub page to import past history.