Ghostfolio
Open source wealth management software for tracking stocks, ETFs, and crypto
Alternative to: personal capital, empower, sharesight, kubera
Ghostfolio is an open source wealth management application built with web technology. It empowers busy people to keep track of stocks, ETFs, and cryptocurrencies across multiple platforms and make solid, data-driven investment decisions. The software is designed for personal use in continuous operation and can be self-hosted to keep full ownership of your financial data.
Ghostfolio Docker Compose example
Self-host Ghostfolio on your own server, homelab, or VPS starting from this Docker Compose example.
It runs Ghostfolio in Docker containers using the official ghostfolio/ghostfolio:latest, postgres:15-alpine, redis:alpine images, with persistent volumes and automatic restarts preconfigured.
Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.
services:
ghostfolio:
image: ghostfolio/ghostfolio:latest
restart: unless-stopped
init: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
# PostgreSQL connection string Ghostfolio uses to reach its database.
DATABASE_URL: "postgresql://user:changeme@postgres:5432/ghostfolio-db?connect_timeout=300"
# Hostname of the Redis service on the compose network.
REDIS_HOST: "redis"
# Port of the Redis service.
REDIS_PORT: "6379"
# Password for the Redis service. Must match the redis service password.
REDIS_PASSWORD: "changeme"
# Random string used to hash security access tokens.
ACCESS_TOKEN_SALT: "changeme"
# Random secret used to sign JSON Web Tokens.
JWT_SECRET_KEY: "changeme"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:3333/api/v1/health']
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:15-alpine
restart: unless-stopped
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_READ_SEARCH
- FOWNER
- SETGID
- SETUID
security_opt:
- no-new-privileges:true
environment:
# Database user Ghostfolio connects as.
POSTGRES_USER: "user"
# Password for the database user.
POSTGRES_PASSWORD: "changeme"
# Name of the Ghostfolio database.
POSTGRES_DB: "ghostfolio-db"
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d "$${POSTGRES_DB}" -U $${POSTGRES_USER}']
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres:/var/lib/postgresql/data
redis:
image: redis:alpine
restart: unless-stopped
user: '999:1000'
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
# Password required to authenticate with Redis. Must match REDIS_PASSWORD above.
REDIS_PASSWORD: "changeme"
command:
- /bin/sh
- -c
- redis-server --requirepass "$${REDIS_PASSWORD}"
healthcheck:
test: ['CMD-SHELL', 'redis-cli --pass "$${REDIS_PASSWORD}" ping | grep PONG']
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres:
Values set to changeme are required — replace them with your own
values before starting Ghostfolio.
Prefer a managed setup? WinterFlow installs, configures, and updates Ghostfolio for you using this same Docker Compose configuration.