2026-11-27 · vikunja · docker · self-hosting · productivity
Self-Host Vikunja with Docker Compose: A Production Guide
Run Vikunja, the open-source to-do app, on your own server with Docker Compose, PostgreSQL, and a reverse proxy. Covers backups, updates, and pitfalls.
- Total RAM
- 76.5 MB
- Startup
- 48.2 s
- Port
- 3456
- HTTP
- 200
vikunja 50.3 MB
· db 26.2 MB
What Vikunja does and what it needs
Vikunja is an open-source task and to-do manager you host yourself. It ships as a single binary that bundles both the API and the web frontend, so one container serves the whole app. You get projects, kanban boards, lists, reminders, labels, and a REST API that the desktop and mobile clients use.
Under the hood it needs a database. SQLite is bundled and works for a single user or a small team, but for anything production-grade you want PostgreSQL, MySQL, or MariaDB. The docs recommend a currently maintained database release; the CI tests MySQL 8, MariaDB 12, PostgreSQL 18, and the bundled SQLite. MySQL 5.7 is explicitly unsupported because Vikunja relies on recursive CTEs and window functions.
The project does not publish a minimum RAM figure. Practical memory use scales with the number of active users, the size of your task database, and background jobs like reminders. An idle instance for a handful of users is light; a team with thousands of tasks and frequent API polling will need more headroom. Size the VPS based on your workload rather than a fixed number.
Vikunja refuses to start without a public URL because CORS is enabled by default. You either set VIKUNJA_SERVICE_PUBLICURL to the URL users will open, or disable CORS with VIKUNJA_CORS_ENABLE=false. In production you always set the public URL.
Prerequisites, ports, and volume constraints
You need Docker Engine and the Compose plugin on a Linux host. The container listens on port 3456 by default. That is the only port you expose; the database stays on the internal Compose network.
The container runs as UID 1000 with no group. Because Docker initializes fresh named volumes as root:root, this stack includes a one-shot vikunja_init container (busybox:1.36) that runs chown -R 1000:1000 /app/vikunja/files /db before vikunja starts. Named volumes are easier to back up than bind mounts:
vikunja_filesmounted at/app/vikunja/filesfor uploaded attachments and avatars.vikunja_dbmounted at/dbfor the SQLite database. If you use PostgreSQL, this volume is unused by Vikunja but still declared for the SQLite fallback path.vikunja_pgdatamounted at/var/lib/postgresql/datafor PostgreSQL.
If you switch to bind mounts later, run chown 1000 on the host directories before starting the container.
Production Docker Compose setup
Create a project directory and generate secrets first. Do not reuse example passwords.
mkdir -p ~/vikunja && cd ~/vikunja
openssl rand -hex 32 # use for POSTGRES_PASSWORD
openssl rand -hex 32 # use for VIKUNJA_SERVICE_SECRET
Write the environment file. Replace the placeholder values with the generated secrets and your real domain.
cat <<'EOF' > .env
TZ=UTC
DOMAIN=https://tasks.example.com
POSTGRES_DB=vikunja
POSTGRES_USER=vikunja
POSTGRES_PASSWORD=replace-with-openssl-output
VIKUNJA_SERVICE_SECRET=replace-with-openssl-output
EOF
Now the Compose file. The web port binds to 127.0.0.1:3456 so the app is not exposed unencrypted on the public IP. A reverse proxy on the same host terminates TLS and forwards to that loopback address.
cat <<'EOF' > compose.yml
services:
vikunja_init:
image: busybox:1.36
command: ["sh", "-c", "chown -R 1000:1000 /app/vikunja/files /db"]
volumes:
- vikunja_files:/app/vikunja/files
- vikunja_db:/db
vikunja:
image: vikunja/vikunja:latest
restart: unless-stopped
depends_on:
vikunja_init:
condition: service_completed_successfully
db:
condition: service_healthy
environment:
TZ: ${TZ:-UTC}
VIKUNJA_SERVICE_PUBLICURL: ${DOMAIN:-http://127.0.0.1:3456}
VIKUNJA_DATABASE_TYPE: postgres
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_DATABASE: ${POSTGRES_DB:-vikunja}
VIKUNJA_DATABASE_USER: ${POSTGRES_USER:-vikunja}
VIKUNJA_DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
VIKUNJA_SERVICE_SECRET: ${VIKUNJA_SERVICE_SECRET}
ports:
- "127.0.0.1:3456:3456"
volumes:
- vikunja_files:/app/vikunja/files
- vikunja_db:/db
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
TZ: ${TZ:-UTC}
POSTGRES_DB: ${POSTGRES_DB:-vikunja}
POSTGRES_USER: ${POSTGRES_USER:-vikunja}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- vikunja_pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-vikunja} -d $${POSTGRES_DB:-vikunja}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
vikunja_files:
vikunja_db:
vikunja_pgdata:
EOF
Start the stack and check logs.
docker compose up -d
docker compose logs -f vikunja
Once the container reports it is listening, open http://127.0.0.1:3456 through an SSH tunnel to confirm the app boots before you wire up the proxy:
ssh -L 3456:127.0.0.1:3456 user@your-server
Then visit http://localhost:3456 locally. The first account you register becomes the admin.
Reverse proxy, HTTPS, and first-run hardening
Vikunja needs a reverse proxy that forwards the original host and protocol headers. The app uses VIKUNJA_SERVICE_PUBLICURL to build links and enforce CORS, so the proxy must not rewrite the Host header to something else.
Here is a Caddyfile. Caddy handles TLS automatically. The X-Forwarded-Proto and X-Forwarded-Host headers are set by Caddy by default, but we make them explicit. Vikunja does not require WebSocket-specific configuration for the core app, but the API supports long-polling and the frontend uses standard HTTP; no special upgrade headers are needed beyond what Caddy already passes.
tasks.example.com {
encode zstd gzip
reverse_proxy 127.0.0.1:3456 {
header_up X-Forwarded-Proto {scheme}
header_up X-Forwarded-Host {host}
}
}
If you use Nginx instead, set client_max_body_size to something reasonable for attachments, for example 50m, and pass X-Forwarded-Proto $scheme and Host $host.
First-run hardening:
- Register the admin account immediately after the stack is up. The first user gets admin rights.
- If you do not want open registration, disable it after creating your account. The setting is
VIKUNJA_SERVICE_ENABLEREGISTRATION=falsein the environment. Add it to the Compose file and restart. - Keep
VIKUNJA_SERVICE_SECRETsecret. Rotating it invalidates all sessions. - Do not expose port
3456publicly. The loopback binding in Compose prevents that by default.
Updating, backups, and common pitfalls
Update by pulling the new image and recreating the container. Vikunja runs database migrations automatically on startup.
cd ~/vikunja
docker compose pull
docker compose up -d
docker compose logs -f vikunja
Back up the database and files. With PostgreSQL, dump the database and archive the files volume.
docker compose exec -T db pg_dump -U vikunja vikunja > backup-$(date +%F).sql
docker run --rm -v vikunja_vikunja_files:/data -v $(pwd):/backup alpine tar czf /backup/files-$(date +%F).tar.gz -C /data .
If you use SQLite instead of PostgreSQL, back up the vikunja_db volume the same way with tar.
Two pitfalls from the docs:
- CORS and public URL. Vikunja will not start without
VIKUNJA_SERVICE_PUBLICURLunless you disable CORS. If you see startup errors about CORS, check that the variable matches the exact URL users open, including the scheme. - Database encoding. If you use MySQL or MariaDB and plan to store non-Latin characters, the database must be UTF-8 compatible. PostgreSQL handles this by default. For accent-insensitive search on PostgreSQL, enable the
unaccentextension:CREATE EXTENSION IF NOT EXISTS unaccent;and restart Vikunja. The logs will confirm detection.
File permissions are the other common trip-up. The container runs as UID 1000. If you switch from named volumes to bind mounts, chown 1000 the host directories or Vikunja cannot write uploads.
Measured in our sandbox run: total memory 76.5 MB (sum of per-container peaks over a 30s idle window after startup) across 3 containers; largest container 50.3 MB; published port(s) 3456; HTTP probe returned 200. The run took 48.2s with the image already cached; a fresh server also has to download it. Required secret(s) POSTGRES_PASSWORD, VIKUNJA_SERVICE_SECRET were generated for the test run, as the tutorial instructs. Container breakdown: vikunja 50.3 MB, db 26.2 MB. Verified one-shot jobs: vikunja_init (exit 0).
Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.