Endurain: A Self-Hosted Strava Alternative You Can Run with Docker Compose

Endurain is a self-hosted fitness tracker that imports GPX, TCX and FIT files and keeps your data in your own PostgreSQL database. A pinned Docker Compose setup for v0.20.2, tested on a fresh Ubuntu 24.04 VM.

Share
Endurain dashboard showing an imported run with a route map
Endurain v0.20.2 running on our test VM (demo data). Map data © OpenStreetMap contributors. Screenshot: uptime.bet

Most people who track their runs and rides end up feeding that data to a company they never chose. Endurain is a small, self-hosted alternative: you upload GPX, TCX or FIT files (or sync from Garmin Connect or Strava), and the app turns them into activity pages with maps, laps, pace and elevation. Everything lives in your own PostgreSQL database.

It came onto my radar through the 16 October issue of Self-Host Weekly, which noted that the project had moved back to GitHub, and then through a burst of releases: v0.20.0 and v0.20.1 landed on 21 October and v0.20.2 followed on 27 October. This guide walks through a pinned Docker Compose setup, which I ran on a fresh Ubuntu 24.04 VM before writing any of it down.

What Endurain does

Endurain describes itself as a self-hosted fitness tracking service, similar to Strava but built around privacy and control. The frontend is Vue 3, the backend is Python with FastAPI, and PostgreSQL is the only database in the official Compose file.

Day to day, you get an activity feed, per-activity pages with a map, pace and elevation, laps, gear tracking, a health section, and a statistics panel on the dashboard. Activities come in through manual upload of .gpx, .tcx and .fit files, through bulk import (a ZIP upload, including a Strava export), or through the Garmin Connect and Strava integrations. Importing the same data twice is safe, because the app checks for duplicates by provider id or by file content plus start time.

Other users can follow you, but only by request, and profiles are never public. Only single activities can be shared, and you can hide details such as location, map or heart rate on the ones others can see.

What you need

A Linux machine with Docker and the Compose plugin, a domain name if you want to reach it from outside (this guide uses endurain.example.com), and a reverse proxy for HTTPS. Resource needs are small. On my test VM (2 vCPU, 1.8 GB RAM, no GPU) the app container used about 250 MiB and PostgreSQL about 63 MiB according to docker stats, measured after importing one activity.

The project is licensed under AGPL-3.0, and the API endpoint /api/v1/about reports the more precise identifier AGPL-3.0-or-later. The current release at the time of writing is v0.20.2.

Install Endurain with Docker Compose

1. Create the directories

The container runs as a non-root user with UID and GID 1000, so the data folders must exist beforehand and belong to that user. The official default location is /var/opt/endurain. The Compose files go in a separate working directory.

sudo mkdir -p /var/opt/endurain/backend/{data,logs}
sudo chown -R 1000:1000 /var/opt/endurain/backend
sudo mkdir -p /opt/endurain
cd /opt/endurain

If your own user is not UID 1000, the docs suggest adding user: "UID:GID" to the service and matching the chown.

2. Get the compose file and the .env template

Both files are published in the repository. I fetch them from the tag instead of master, so that the files match the version we are about to run.

curl -fsSL -o docker-compose.yml https://raw.githubusercontent.com/endurain-project/endurain/v0.20.2/docker-compose.yml.example
curl -fsSL -o .env https://raw.githubusercontent.com/endurain-project/endurain/v0.20.2/.env.example

The example file uses :latest for the app image. Replace it with the pinned tag, and bind the port to localhost so that only your reverse proxy can reach it.

sed -i 's|endurain:latest|endurain:v0.20.2|; s|"8080:8080"|"127.0.0.1:8080:8080"|' docker-compose.yml

The result looks like this (comments removed):

services:
  endurain:
    container_name: endurain-app
    image: ghcr.io/endurain-project/endurain:v0.20.2
    env_file:
      - .env
    volumes:
      - ${LOCAL_PATH:-/var/opt/endurain}/backend/data:/app/backend/data:Z
      - ${LOCAL_PATH:-/var/opt/endurain}/backend/logs:/app/backend/logs:Z
    ports:
      - "127.0.0.1:8080:8080"
    depends_on:
      postgres:
        condition: service_healthy
    restart: unless-stopped

  postgres:
    image: docker.io/postgres:18@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336
    container_name: endurain-postgres
    env_file:
      - .env
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U endurain"]
      interval: 5s
      timeout: 5s
      retries: 5
    volumes:
      - ${LOCAL_PATH:-/var/opt/endurain}/postgres:/var/lib/postgresql/data:Z
    restart: unless-stopped

The PostgreSQL image is pinned by digest in the official file, and I left it that way.

3. Generate secrets and edit .env

Four values are mandatory and ship as changeme: the database password (which must be identical in DB_PASSWORD and POSTGRES_PASSWORD), SECRET_KEY and FERNET_KEY. The docs generate them with openssl rand -hex 32 and openssl rand -base64 32.

DBPASS=$(openssl rand -hex 32)
sed -i "s|^DB_PASSWORD=.*|DB_PASSWORD=$DBPASS|; s|^POSTGRES_PASSWORD=.*|POSTGRES_PASSWORD=$DBPASS|" .env
sed -i "s|^SECRET_KEY=.*|SECRET_KEY=$(openssl rand -hex 32)|" .env
sed -i "s|^FERNET_KEY=.*|FERNET_KEY=$(openssl rand -base64 32)|" .env
sed -i "s|^TZ=.*|TZ=Europe/Berlin|" .env

Then open .env and check two lines. ENDURAIN_HOST must be the exact URL you will open in the browser, and BEHIND_PROXY should be true when a reverse proxy sits in front. The template already contains https://endurain.example.com and true, so replace the domain with your own. Keep this file out of version control and back it up somewhere safe, since it contains all your secrets.

4. Start the stack

docker compose up -d
docker compose ps
curl -s http://127.0.0.1:8080/api/v1/health

On my test VM both containers were healthy about 30 seconds after docker compose up, with the app image already pulled. The health endpoint answered {"status":"ok"}. This endpoint is new in v0.20.2 according to the release notes, and unlike /about it actually runs a query against the database, so it is the better target for a monitoring check.

5. First login

The default account is admin with password admin. Change it right away. The docs warn that you cannot log in until ENDURAIN_HOST matches the URL in your browser, so if login fails, check that variable first.

A note on how I tested this: because the VM was not reachable through a domain, I set ENDURAIN_HOST to the local URL of the test instance and BEHIND_PROXY to false, and I drove the browser from a headless Chromium on the same machine. Login with admin/admin worked and I was not forced to change the password on first sign in. The docs say production mode sets the Secure flag on auth cookies and therefore expects HTTPS, so I would not rely on plain HTTP anywhere beyond loopback.

Endurain dashboard showing one imported run with a map, distance, time and pace
The dashboard after importing a demo run. Endurain v0.20.2 on our test VM (demo data). Map data © OpenStreetMap contributors. Screenshot: uptime.bet

Import your first activity

To check the core flow, I generated a synthetic GPX file (a loop of roughly six kilometres in Munich, 28 minutes) and uploaded it through the Add activity button on the dashboard. A few seconds later the activity showed up in the feed with distance, time, average pace and elevation gain, and the city name had been filled in automatically. The activity page adds a zoomable map, a lap table and elevation loss.

Endurain activity detail page with distance, time, pace, elevation and a route map
An activity page with route map. Endurain v0.20.2 on our test VM (demo data). Map data © OpenStreetMap contributors. Screenshot: uptime.bet

Two observations from that test. First, the city name means the server made an outbound request to a reverse geocoding provider. The default is Nominatim on nominatim.openstreetmap.org, and the docs list Photon and geocode.maps.co as alternatives, including self-hosted Photon or Nominatim, through REVERSE_GEO_PROVIDER. If your coordinates should never leave your network, change that setting. Second, my uploaded activity was labelled Public in the feed. The docs explain that this alone does not expose anything, because anonymous access additionally requires an administrator to enable public links in the server settings, and that switch is off by default. I did not test anonymous access, so check Settings, My profile, Privacy and set the default activity visibility to what you actually want before importing years of history.

Put it behind HTTPS

The official docs describe Caddy and Nginx Proxy Manager setups in their reverse proxy guide. If you already run Caddy, the whole configuration is short. I did not test this snippet myself, since the test instance was not exposed to the internet:

endurain.example.com {
    reverse_proxy 127.0.0.1:8080
}

Tips

Prefer .fit files when you have them. The maintainer points out that the FIT to GPX conversion done by Strava and Garmin Connect adds small errors to distance and elevation. For a bulk import, use the import page in the settings menu and upload a ZIP (the docs give 500 MiB and 20,000 files as limits), or import from a folder on the server for very large exports. Take a database backup first, because there is currently no way to undo an import.

Updating is a matter of changing the image tag, then running docker compose pull and docker compose up -d. Read the release notes before you do, and bump PostgreSQL only deliberately: minor versions are generally safe, but major versions need a dump and restore.

For backups, copy /var/opt/endurain/backend/data and take a real database dump. The docs explicitly warn that copying the live PostgreSQL directory can produce a corrupted backup.

Gadgetbridge and RunnerUp can sync into Endurain as well. For Gadgetbridge an administrator has to add gadgetbridge to ALLOWED_REDIRECT_SCHEMES, and RunnerUp does not support logging in with MFA.

Limits and security

The project is on a declared feature freeze. The README says it is not paused, but the focus is on strengthening the foundations instead of adding features, so do not expect big new functionality in the coming months. Related to that, the integration docs warn that the Strava integration will change in a future release because of Strava API changes.

The Garmin Connect integration asks for your Garmin credentials. They are not stored, only the resulting tokens, but the credentials travel from the browser to the backend in plain text, so the docs insist on HTTPS. The Strava integration needs your instance to be reachable from the internet, which is a trade-off for a privacy-first tool.

Keep the default admin password for exactly as long as it takes to change it, and keep the port bound to localhost behind a proxy. Finally, the README states that you may self-host and use the name and logo for personal or community use, while offering paid hosting under the Endurain name requires written permission.

How it compares

The obvious reference point is Strava itself, which is a hosted service with a social network attached. Endurain gives up the network effect in exchange for keeping the data on your own hardware. Among self-hosted projects, FitTrackee is a close relative: an AGPL-3.0 licensed, self-hosted outdoor activity tracker. Workout Tracker is a web app for personal use aimed at running and other GPX based activities. I only ran Endurain for this article, so I will not rank them. Compare their feature lists against what you need, for example Garmin Connect or Strava sync, before you commit.

Verdict

Endurain installs cleanly: two containers, one env file, a few minutes. The interface is tidy, the import worked on the first attempt, and the resource usage fits comfortably on a small VM. The caveats are the feature freeze, the shifting Strava integration, and some privacy defaults that you should review before you load real data. If you want a quiet, private home for your own activity files, it is worth an evening.

Sources