Create a spotizerr
user to run the application
useradd -Ms /bin/bash spotizerr
Create a new installation directory
mkdir /opt/spotizerr && cd /opt/spotizerr
Create a .env
file (author's draft)
bash -c "cat > /opt/spotizerr/.env"<< EOF
# Docker Compose environment variables# Delete all comments of this when deploying (everything that is )
# Redis connection (external or internal)
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 12 | xargs)
# Set to true to filter out explicit content
EXPLICIT_FILTER=false
# User ID for the container
PUID=$(id -u spotizerr)
# Group ID for the container
PGID=$(id -g spotizerr)
# Optional: Sets the default file permissions for newly created files within the container.
UMASK=0022
EOF
Create the Docker Compose file
bash -c "cat > /opt/spotizerr/docker-compose.yaml"<<"EOF"
name: spotizerr
services:
spotizerr:
volumes:
- ./data:/app/data
- ./downloads:/app/downloads # <-- Change this for your music library dir
- ./logs:/app/logs # <-- Volume for persistent logs
ports:
- 7171:7171
image: cooldockerizer93/spotizerr
container_name: spotizerr-app
restart: unless-stopped
environment:
- PUID=${PUID} # Replace with your desired user ID | Remove both if you want to run as root (not recommended, might result in unreadable files)
- PGID=${PGID} # Replace with your desired group ID | The user must have write permissions in the volume mapped to /app/downloads
- UMASK=${UMASK} # Optional: Sets the default file permissions for newly created files within the container.
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_DB=${REDIS_DB}
- REDIS_PASSWORD=${REDIS_PASSWORD} # Optional, Redis AUTH password. Leave empty if not using authentication
- REDIS_URL=redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}
- REDIS_BACKEND=redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}
- EXPLICIT_FILTER=${EXPLICIT_FILTER} # Set to true to filter out explicit content
depends_on:
- redis
redis:
image: redis:alpine
container_name: spotizerr-redis
restart: unless-stopped
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
volumes:
- redis-data:/data
command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes
volumes:
redis-data:
driver: local
EOF
Start the container
docker compose up -d
Once started, the Spotizerr web UI can be accessed at http://<hostname-or-ip>:7171
I will be using X windowing to launch Spotify Desktop and Google Chrome on my headless server and view the app's windows on my local machine. From there I will be able to login to the Spotify app during which librespot-auth
will obtain my account credentials to use in Spotizerr.
Download spotizerr-auth
git clone https://github.com/Xoconoch/spotizerr-auth && cd spotizerr-auth
Create a new venv
and install dependencies
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install -r requirements.txt
Launch the Spotify app (if you're logged in already, log out) and login. (Again, I'm launching these apps on the headless server via an XQuarts terminal session)
spotify
google-chrome
Run the script
python3 spotizerr-auth.py
http://localhost:7171
credentials.json
file it create. You should do so to better ensure security.