Self-hosted trading journal and analytics: broker imports, P&L, charts, and AI insights.
100K+
Self-host TradeTally with Docker Compose. The stack is two containers: the app (frontend + API) and PostgreSQL 16.
| Tag | Purpose |
|---|---|
latest | Stable release (recommended) |
X.Y.Z | Pinned version that never changes |
nightly | Untested development build |
docker compose)mkdir tradetally
cd tradetally
curl -O https://raw.githubusercontent.com/GeneBO98/tradetally/refs/heads/main/docker-compose.yaml
curl -O https://raw.githubusercontent.com/GeneBO98/tradetally/main/.env.example
mv .env.example .env
Edit .env and set at least these values:
| Variable | What to set |
|---|---|
DB_PASSWORD | A strong database password |
JWT_SECRET | A long random string, e.g. output of openssl rand -hex 32 |
FRONTEND_URL | The exact URL you will open in your browser, e.g. http://localhost:8080, http://192.168.1.50:8080, or https://trades.example.com. Requests from any other origin are rejected. |
BROKER_ENCRYPTION_KEY | Required only for broker sync (Schwab, IBKR, etc.). Generate with openssl rand -hex 32 |
Set DB_PASSWORD before the first start. PostgreSQL only applies it when the database volume is first created.
Everything else is optional. See Optional Configuration.
docker compose up -d
docker compose ps
docker compose logs -f app
Database migrations run automatically on startup (RUN_MIGRATIONS=true). No manual schema step is needed.
Open http://localhost:8080 (or your FRONTEND_URL) and register. The first account registered becomes the admin. If email is not configured, accounts are active immediately without email verification.
Use REGISTRATION_MODE to control sign-ups after that: open (default), approval (admin approves new users), or disabled.
Market data and AI:
| Variable | Used for | Get a key |
|---|---|---|
FINNHUB_API_KEY | Quotes, company data, CUSIP resolution | https://finnhub.io/dashboard |
ALPHA_VANTAGE_API_KEY | Trade charts (daily candles on the free tier) | https://www.alphavantage.co/support/#api-key |
OPENFIGI_API_KEY | CUSIP to ticker resolution | https://www.openfigi.com/api |
GEMINI_API_KEY | Server-wide default AI key (users can also add their own in Settings) | https://aistudio.google.com/apikey |
Email (SMTP): set EMAIL_HOST, EMAIL_PORT, EMAIL_USER, EMAIL_PASS, and EMAIL_FROM. All of host, user, and pass must be set or email stays disabled.
Mobile app / extra origins: add comma-separated origins to CORS_ORIGINS.
Background services: each scheduler can be turned off with its ENABLE_* flag (for example ENABLE_PRICE_MONITORING=false) to reduce resource usage.
After changing .env, apply it with docker compose up -d.
docker compose pull
docker compose up -d
docker compose logs -f app
docker compose logs -f postgres
docker exec tradetally-db pg_dump -U trader tradetally > tradetally_backup_$(date +%Y%m%d).sql
Restore into an empty database (for example, a fresh install before registering any account):
docker exec -i tradetally-db psql -U trader tradetally < tradetally_backup.sql
# Stop containers (data is kept)
docker compose down
# Stop and delete the database volume (WARNING: deletes all data)
docker compose down -v
tradetally/
├── docker-compose.yaml
├── .env
└── backend/ (created on first start)
├── src/logs/ application logs
├── src/data/ app data files
└── uploads/ uploaded images and attachments
The database is stored in the postgres_data Docker volume.
"Origin is not allowed" / login or registration fails: FRONTEND_URL does not match the URL in your browser's address bar (scheme, host, and port must all match). Fix it in .env and run docker compose up -d.
App won't start:
docker compose logs app
docker compose ps postgres
docker exec tradetally-db pg_isready -U trader -d tradetally
DB_PASSWORD must be set / JWT_SECRET must be set: the variable is missing from .env, or .env is not in the same directory as docker-compose.yaml.
Database authentication failed after changing DB_PASSWORD: the password is fixed when the volume is created. Change it back, or change it inside PostgreSQL with ALTER USER.
DB_PASSWORD and JWT_SECRET from the template values.FRONTEND_URL to the HTTPS URL.Content type
Image
Digest
sha256:60e883157…
Size
131.8 MB
Last updated
1 day ago
docker pull potentialmidas/tradetally