Lidify
Stack
Self-hosted, on-demand audio streaming platform that brings the Spotify experience to your personal music library. Features music streaming, podcast subscriptions, audiobook integration, playlist generation, and Lidarr integration for music discovery.
Services
lidify-backend
Configuration
Imagechevron7locked/lidify:latest${BACKEND_PORT:-3006}:3006/music : ${MUSIC_PATH}/app/cache : /portainer/Files/AppData/Config/lidify/backend-cache/app/logs : /portainer/Files/AppData/Config/lidify/backend-logsDATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}POSTGRES_USER=${POSTGRES_USER:-lidifydb}POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme}POSTGRES_DB=${POSTGRES_DB:-lidify}REDIS_URL=redis://lidify-redis:6379PORT=3006NODE_ENV=${NODE_ENV:-production}SESSION_SECRET=${SESSION_SECRET:-changeme-generate-secure-key}SETTINGS_ENCRYPTION_KEY=${SETTINGS_ENCRYPTION_KEY:-}MUSIC_PATH=/musicTRANSCODE_CACHE_PATH=/app/cache/transcodesTRANSCODE_CACHE_MAX_GB=${TRANSCODE_CACHE_MAX_GB:-10}ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:3030}INTERNAL_API_SECRET=${INTERNAL_API_SECRET:-lidify-internal-secret-change-me}LIDIFY_CALLBACK_URL=${LIDIFY_CALLBACK_URL:-http://lidify-backend:3006}PODCAST_DEBUG=${PODCAST_DEBUG:-0}unless-stoppedImage details
lidify-frontend
Configuration
Imagechevron7locked/lidify-frontend:latest${FRONTEND_PORT:-3030}:3030NODE_ENV=${NODE_ENV:-production}BACKEND_URL=${BACKEND_URL:-http://lidify-backend:3006}NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-}NEXT_PUBLIC_BUILD_TYPE=${NEXT_PUBLIC_BUILD_TYPE:-nightly}unless-stoppedlidify-postgres
Configuration
Imagepgvector/pgvector:pg16/var/lib/postgresql/data : /portainer/Files/AppData/Config/lidify/postgresPOSTGRES_USER=${POSTGRES_USER:-lidifydb}POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme}POSTGRES_DB=${POSTGRES_DB:-lidify}unless-stoppedImage details
lidify-redis
Configuration
Imageredis:7-alpine/data : /portainer/Files/AppData/Config/lidify/redisunless-stoppedImage details
lidify-audio-analyzer
Configuration
Imagechevron7locked/lidify-audio-analyzer:latest/music : ${MUSIC_PATH}REDIS_URL=redis://lidify-redis:6379DATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}MUSIC_PATH=/musicBATCH_SIZE=${AUDIO_ANALYSIS_BATCH_SIZE:-10}SLEEP_INTERVAL=${AUDIO_ANALYSIS_INTERVAL:-5}BRPOP_TIMEOUT=${AUDIO_BRPOP_TIMEOUT:-30}MODEL_IDLE_TIMEOUT=${AUDIO_MODEL_IDLE_TIMEOUT:-300}NUM_WORKERS=${AUDIO_ANALYSIS_WORKERS:-2}THREADS_PER_WORKER=${AUDIO_ANALYSIS_THREADS_PER_WORKER:-1}unless-stoppedlidify-audio-analyzer-clap
Configuration
Imagechevron7locked/lidify-audio-analyzer-clap:latest/music : ${MUSIC_PATH}REDIS_URL=redis://lidify-redis:6379DATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}BACKEND_URL=http://lidify-backend:3006MUSIC_PATH=/musicSLEEP_INTERVAL=${CLAP_SLEEP_INTERVAL:-5}NUM_WORKERS=${CLAP_WORKERS:-2}THREADS_PER_WORKER=${CLAP_THREADS_PER_WORKER:-1}MODEL_IDLE_TIMEOUT=${CLAP_MODEL_IDLE_TIMEOUT:-300}INTERNAL_API_SECRET=${INTERNAL_API_SECRET:-lidify-internal-secret-change-me}unless-stoppedStandalone Install
Select an install method, to see config/commands for deploying Lidify
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Lidify, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
version: '3.9'
services:
lidify-backend:
image: chevron7locked/lidify:latest
container_name: lidify_backend
restart: unless-stopped
ports:
- ${BACKEND_PORT:-3006}:3006
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}
- POSTGRES_USER=${POSTGRES_USER:-lidifydb}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme}
- POSTGRES_DB=${POSTGRES_DB:-lidify}
- REDIS_URL=redis://lidify-redis:6379
- PORT=3006
- NODE_ENV=${NODE_ENV:-production}
- SESSION_SECRET=${SESSION_SECRET:-changeme-generate-secure-key}
- SETTINGS_ENCRYPTION_KEY=${SETTINGS_ENCRYPTION_KEY:-}
- MUSIC_PATH=/music
- TRANSCODE_CACHE_PATH=/app/cache/transcodes
- TRANSCODE_CACHE_MAX_GB=${TRANSCODE_CACHE_MAX_GB:-10}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:3030}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET:-lidify-internal-secret-change-me}
- LIDIFY_CALLBACK_URL=${LIDIFY_CALLBACK_URL:-http://lidify-backend:3006}
- PODCAST_DEBUG=${PODCAST_DEBUG:-0}
volumes:
- ${MUSIC_PATH}:/music
- /portainer/Files/AppData/Config/lidify/backend-cache:/app/cache
- /portainer/Files/AppData/Config/lidify/backend-logs:/app/logs
depends_on:
lidify-postgres:
condition: service_healthy
lidify-redis:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 10s
retries: 3
networks:
- lidify-network
lidify-frontend:
image: chevron7locked/lidify-frontend:latest
container_name: lidify_frontend
restart: unless-stopped
ports:
- ${FRONTEND_PORT:-3030}:3030
environment:
- NODE_ENV=${NODE_ENV:-production}
- BACKEND_URL=${BACKEND_URL:-http://lidify-backend:3006}
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-}
- NEXT_PUBLIC_BUILD_TYPE=${NEXT_PUBLIC_BUILD_TYPE:-nightly}
depends_on:
- lidify-backend
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 10s
retries: 3
networks:
- lidify-network
lidify-postgres:
image: pgvector/pgvector:pg16
container_name: lidify_db
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER:-lidifydb}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme}
- POSTGRES_DB=${POSTGRES_DB:-lidify}
volumes:
- /portainer/Files/AppData/Config/lidify/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lidifydb} -d ${POSTGRES_DB:-lidify}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- lidify-network
lidify-redis:
image: redis:7-alpine
container_name: lidify_redis
restart: unless-stopped
volumes:
- /portainer/Files/AppData/Config/lidify/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- lidify-network
lidify-audio-analyzer:
image: chevron7locked/lidify-audio-analyzer:latest
container_name: lidify_audio_analyzer
restart: unless-stopped
environment:
- REDIS_URL=redis://lidify-redis:6379
- DATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}
- MUSIC_PATH=/music
- BATCH_SIZE=${AUDIO_ANALYSIS_BATCH_SIZE:-10}
- SLEEP_INTERVAL=${AUDIO_ANALYSIS_INTERVAL:-5}
- BRPOP_TIMEOUT=${AUDIO_BRPOP_TIMEOUT:-30}
- MODEL_IDLE_TIMEOUT=${AUDIO_MODEL_IDLE_TIMEOUT:-300}
- NUM_WORKERS=${AUDIO_ANALYSIS_WORKERS:-2}
- THREADS_PER_WORKER=${AUDIO_ANALYSIS_THREADS_PER_WORKER:-1}
volumes:
- ${MUSIC_PATH}:/music:ro
depends_on:
lidify-postgres:
condition: service_healthy
lidify-redis:
condition: service_healthy
deploy:
resources:
limits:
memory: 6G
cpus: '4'
reservations:
memory: 2G
healthcheck:
test: ["CMD", "pgrep", "-f", "python.*analyzer"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- lidify-network
lidify-audio-analyzer-clap:
image: chevron7locked/lidify-audio-analyzer-clap:latest
container_name: lidify_audio_analyzer_clap
restart: unless-stopped
environment:
- REDIS_URL=redis://lidify-redis:6379
- DATABASE_URL=postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@lidify-postgres:5432/${POSTGRES_DB:-lidify}
- BACKEND_URL=http://lidify-backend:3006
- MUSIC_PATH=/music
- SLEEP_INTERVAL=${CLAP_SLEEP_INTERVAL:-5}
- NUM_WORKERS=${CLAP_WORKERS:-2}
- THREADS_PER_WORKER=${CLAP_THREADS_PER_WORKER:-1}
- MODEL_IDLE_TIMEOUT=${CLAP_MODEL_IDLE_TIMEOUT:-300}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET:-lidify-internal-secret-change-me}
volumes:
- ${MUSIC_PATH}:/music:ro
depends_on:
lidify-postgres:
condition: service_healthy
lidify-redis:
condition: service_healthy
lidify-backend:
condition: service_healthy
deploy:
resources:
limits:
memory: 3G
cpus: '4'
reservations:
memory: 1G
networks:
- lidify-network
networks:
lidify-network:
driver: bridge
Or deploy it directly from the source:
git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/lidify.yml up -dMore install options in our documentation.
Container Documentation
lidify-postgres Documentation
Open-source vector similarity search for Postgres
lidify-redis Documentation
Redis is the world’s fastest data platform for caching, vector search, and NoSQL databases.
Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Permission denied on volumes
If the logs show "permission denied", the app can't write to its data folder on the host.
- Fix the ownership:
sudo chown -R 1000:1000 /portainer/Files/AppData/Config/lidify/backend-cache(and the same for the other mapped folders)
Image won't pull
Test the pull directly on the host: docker pull chevron7locked/lidify:latest
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue within lidify's repo
- Template not working: Open an issue on xneo1/portainer_templates
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
Lidify is a Compose stack, a set of containers (6 of them) defined in one file and brought up together by Portainer, then started and stopped as a single app.
The services
This stack is built from 6 containers that run side by side. Here's each one, with the image it runs and anything it waits for first:
lidify-backendrunschevron7locked/lidify:latest, starts after lidify-postgres, lidify-redislidify-frontendrunschevron7locked/lidify-frontend:latest, starts after lidify-backendlidify-postgresrunspgvector/pgvector:pg16lidify-redisrunsredis:7-alpinelidify-audio-analyzerrunschevron7locked/lidify-audio-analyzer:latest, starts after lidify-postgres, lidify-redislidify-audio-analyzer-claprunschevron7locked/lidify-audio-analyzer-clap:latest, starts after lidify-postgres, lidify-redis, lidify-backend
Volumes
A volume is where Lidify keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/musickept in the${MUSIC_PATH}volume Docker manages/app/cachefrom/portainer/Files/AppData/Config/lidify/backend-cacheon the host/app/logsfrom/portainer/Files/AppData/Config/lidify/backend-logson the host/var/lib/postgresql/datafrom/portainer/Files/AppData/Config/lidify/postgreson the host/datafrom/portainer/Files/AppData/Config/lidify/redison the host
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Lidify takes 25 of them, all with defaults you can leave alone or tweak:
DATABASE_URL, defaults topostgresql://lidifydb:changeme@lidify-postgres:5432/lidifyPOSTGRES_USER, defaults tolidifydbPOSTGRES_PASSWORD, defaults tochangemePOSTGRES_DB, defaults tolidifyREDIS_URL, defaults toredis://lidify-redis:6379PORT, defaults to3006NODE_ENV, defaults toproductionSESSION_SECRET, defaults tochangeme-generate-secure-keySETTINGS_ENCRYPTION_KEY, pulled from your own environmentMUSIC_PATH, defaults to/musicTRANSCODE_CACHE_PATH, defaults to/app/cache/transcodesTRANSCODE_CACHE_MAX_GB, defaults to10ALLOWED_ORIGINS, defaults tohttp://localhost:3000,http://localhost:3030INTERNAL_API_SECRET, defaults tolidify-internal-secret-change-meLIDIFY_CALLBACK_URL, defaults tohttp://lidify-backend:3006PODCAST_DEBUG, defaults to0BACKEND_URL, defaults tohttp://lidify-backend:3006NEXT_PUBLIC_API_URL, pulled from your own environmentNEXT_PUBLIC_BUILD_TYPE, defaults tonightlyBATCH_SIZE, defaults to10SLEEP_INTERVAL, defaults to5BRPOP_TIMEOUT, defaults to30MODEL_IDLE_TIMEOUT, defaults to300NUM_WORKERS, defaults to2THREADS_PER_WORKER, defaults to1
Restart policy
The restart policy here is unless-stopped, so Docker restarts Lidify after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Portainer puts these services on one shared private network, so they can find each other by name (like lidify-backend) while only the ports above are open to you.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Lidify up. Add the template list to Portainer once, then deploying Lidify is a click rather than a wall of config.