Dawarich¶
Self-Hosted Location History
Dawarich is a self-hosted alternative to Google Location History (Timeline). It stores GPS location data, visualises trips on a map, and gives full control over personal location history without relying on third-party cloud services.
Why Choose Dawarich¶
- Privacy first - location data stays on your own server
- Google Takeout import - migrate existing location history easily
- OwnTracks & Overland support - works with popular mobile tracking apps
- Trip detection - automatically groups location points into trips
- Statistics & heatmaps - visualise visited places over time
Install¶
Infrastructure Configuration¶
Infrastructure as Code
The canonical configuration is maintained at Benoit/OpenTofu.
The Dawarich VM is provisioned with OpenTofu. Two extra block volumes are attached: one for Docker data and one for /opt where Dawarich lives.
resource "incus_storage_volume" "dawarich_var_lib_docker" {
name = "dawarich_var_lib_docker"
pool = incus_storage_pool.default.name
content_type = "block"
config = {
"size" = "50GiB"
}
}
resource "incus_storage_volume" "dawarich_opt" {
name = "dawarich_opt"
pool = incus_storage_pool.default.name
content_type = "block"
config = {
"size" = "10GiB"
}
}
resource "incus_instance" "dawarich" {
name = "dawarich"
image = "images:ubuntu/24.04"
type = "virtual-machine"
config = {
"limits.cpu" = 2
"limits.memory" = "4GiB"
}
device {
name = "root"
type = "disk"
properties = {
size = "25GiB"
path = "/"
pool = incus_storage_pool.default.name
}
}
device {
name = "var_lib_docker"
type = "disk"
properties = {
# Mount manually inside the VM: path = "/var/lib/docker"
source = incus_storage_volume.dawarich_var_lib_docker.name
pool = incus_storage_pool.default.name
}
}
device {
name = "opt"
type = "disk"
properties = {
# Mount manually inside the VM: path = "/opt"
source = incus_storage_volume.dawarich_opt.name
pool = incus_storage_pool.default.name
}
}
}
Manual mount required
The var_lib_docker and opt block volumes are attached to the VM but not auto-mounted. After the VM first boots, format and mount them manually before installing Docker or cloning Dawarich.
Deploy Infrastructure¶
Inside the VM: Format and Mount Volumes¶
After the first boot, identify the two attached block devices and set them up:
Format and mount the volumes
Persist mounts across reboots
Inside the VM: Docker and Dawarich¶
Clone the Dawarich repository
Configure environment
cd /opt/dawarich/docker
cp .env.example .env
# Generate and set a random database password
DB_PASS=$(openssl rand -hex 16)
sed -i "s/^POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$DB_PASS/" .env
sed -i "s/^DATABASE_PASSWORD=.*/DATABASE_PASSWORD=$DB_PASS/" .env
# Generate and set the Rails secret key
sed -i "s/^SECRET_KEY_BASE=.*/SECRET_KEY_BASE=$(openssl rand -hex 64)/" .env
# Set application host (keep APPLICATION_PROTOCOL=http, TLS is terminated by HAProxy)
sed -i 's/^APPLICATION_HOSTS=.*/APPLICATION_HOSTS=dawarich.benoit.jp.net/' .env
Keep RAILS_ENV=development
The Dawarich project recommends using the development environment for self-hosted deployments. Do not switch to production.
Adjust TIME_ZONE and other settings in .env as needed.
Related Documentation:
- Infrastructure Overview - Complete self-hosting architecture