How to Self-Host Dawarich on a VPS
Run a private location-history timeline with Docker, PostGIS, Redis, background workers, HTTPS, and an off-server backup plan.
Dawarich turns location exports and ongoing mobile tracking into a private timeline and map. It is more involved than a single-container application: the supported stack includes the web application, a background worker, PostgreSQL with PostGIS, and Redis. Location history is highly sensitive, so this guide keeps the application behind HTTPS and treats database backups as confidential records.
Choose a VPS size
Dawarich's official self-hosting documentation recommends at least 2 GB of RAM. Start with gc.small for comfortable headroom during imports, map processing, and container updates. Disk use depends on location volume and retained photos or exports, so watch free space after the first full import.
1. Prepare DNS and Docker
Deploy Ubuntu or Debian, install Docker Engine and the Compose plugin from Docker's official repository, and point a record such as timeline.example.com to the server. Allow SSH from trusted addresses and public TCP 80/443; do not expose PostgreSQL or Redis.
2. Use Dawarich's current Compose file
Dawarich changes quickly and its maintainers warn that updates can include breaking changes. Download the current Compose file from the official project instead of copying an old version from a tutorial. Store it under /opt/dawarich:
mkdir -p /opt/dawarich
cd /opt/dawarich
# Save the current official docker-compose.yml here
docker compose config
Before starting, replace every example password and secret. Set APPLICATION_HOSTS to your hostname without http:// or https://, for example:
APPLICATION_HOSTS=timeline.example.com,127.0.0.1
Keep the application listener on a private Docker network or bind it to loopback if Caddy runs on the host. Database and Redis services should have no public ports entries.
3. Start all four services
docker compose up -d
docker compose ps
docker compose logs --tail=100
Confirm that the application, Sidekiq worker, PostGIS database, and Redis containers remain healthy. Dawarich documentation may include initial example credentials; change them immediately, then disable any registration behavior you do not need.
4. Put Dawarich behind Caddy
If the application is bound to 127.0.0.1:3000, use:
timeline.example.com {
encode zstd gzip
reverse_proxy 127.0.0.1:3000
}
If Caddy is another container, connect it to the shared frontend network and proxy to dawarich_app:3000, matching the official reverse-proxy guide. Reload Caddy, open the HTTPS URL, sign in, and verify that maps and background jobs load without mixed-content or rejected-host errors.
5. Import a small sample first
Before importing years of history, upload a short export and verify timestamps, time zone, duplicate handling, and map positions. Large imports exercise the worker, database, CPU, and disk together. Watch them while the import runs:
docker stats
docker compose logs -f dawarich_app dawarich_sidekiq
Use the actual service names from the current Compose file if they differ. Do not make the timeline public merely to simplify mobile uploads; use Dawarich's authenticated integrations and rotate any token that appears in a screenshot or log.
6. Back up PostGIS and application data
A copy of only the Compose file is not a backup. Schedule a PostgreSQL dump plus copies of persistent application data and configuration, encrypt them, and transfer them off the VPS. Test restoration on an isolated host. LayerOne does not take snapshots or backups of your server.
7. Update deliberately
Read Dawarich's current update and breaking-change notes first. Take a fresh database dump, then pull and recreate the stack:
cd /opt/dawarich
docker compose pull
docker compose up -d
docker compose ps
docker compose logs --tail=100
Use the official Dawarich self-hosting guide and its current maintenance documentation as the source of truth. Compare VPS sizes on the LayerOne pricing page. For a private database or worker tier, connect multiple servers with a LayerOne virtual network.