LiveTracker is a lightweight web application for real-time GPS tracking. It is designed to receive location updates from the OsmAnd Android app's Online tracking feature and display the live track in a web browser. The backend is written in Go and stores location data in a SQLite database, while the frontend uses Leaflet.js for interactive map visualization.
- Receive and store GPS location updates from OsmAnd (or compatible clients)
- Live map view in the browser with real-time updates via WebSocket
- Historical track display (last 3 hours shown on first load; all data is kept in the database)
- Basic authentication for the web interface and WebSocket
- Simple, single-binary deployment (no external dependencies except SQLite)
- Go 1.24 or newer (for building from source)
- SQLite3 (installed by default on most Linux systems)
- SQLite development library (e.g.
libsqlite3-devon Debian/Ubuntu,sqlite-develon Fedora/RedHat,sqlite-devon Alpine) - OsmAnd app (for sending location updates)
The recommended way to run LiveTracker is using the prebuilt Docker image from the GitHub Container Registry:
docker run -p 8080:8080 \
-e LIVETRACKER_API_TOKEN=yourtoken \
-e LIVETRACKER_BASIC_AUTH_USER=youruser \
-e LIVETRACKER_BASIC_AUTH_PASS=yourpass \
-e LIVETRACKER_SQLITE_PATH=/data/tracker.db \
-v $(pwd)/data:/data \
ghcr.io/jlelse/livetracker:latestNote: The
-v $(pwd)/data:/dataoption mounts the entire data directory from your host system into the container. This is required because SQLite in WAL mode creates extra files (e.g.,tracker.db-wal,tracker.db-shm) that must be persisted along with the main database file. Adjust the path as needed.
You can also build the image yourself:
docker build -t livetracker .
docker run -p 8080:8080 \
-e LIVETRACKER_API_TOKEN=yourtoken \
-e LIVETRACKER_BASIC_AUTH_USER=youruser \
-e LIVETRACKER_BASIC_AUTH_PASS=yourpass \
-e LIVETRACKER_SQLITE_PATH=/data/tracker.db \
-v $(pwd)/data:/data \
livetrackerYou can use Docker Compose for easier setup:
services:
livetracker:
image: ghcr.io/jlelse/livetracker:latest
ports:
- "8080:8080"
environment:
LIVETRACKER_API_TOKEN: yourtoken
LIVETRACKER_BASIC_AUTH_USER: youruser
LIVETRACKER_BASIC_AUTH_PASS: yourpass
LIVETRACKER_SQLITE_PATH: /data/tracker.db
volumes:
- ./data:/dataStart with:
docker compose up -d- Clone the repository:
git clone https://github.com/jlelse/LiveTracker.git cd LiveTracker - Install the SQLite development library for your Linux distribution (see Prerequisites).
- Build the application using Go with build flags to use the system's SQLite3 version:
go build -tags=linux,libsqlite3,sqlite_fts5 -o livetracker
The application is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
| LIVETRACKER_PORT | 8080 | HTTP server port |
| LIVETRACKER_SQLITE_PATH | tracker.db | Path to SQLite database file |
| LIVETRACKER_API_TOKEN | default | API token for /track endpoint |
| LIVETRACKER_BASIC_AUTH_USER | admin | Username for web interface & WebSocket |
| LIVETRACKER_BASIC_AUTH_PASS | admin | Password for web interface & WebSocket |
Important: Change the default API token and credentials for production use!
-
Start the server:
LIVETRACKER_API_TOKEN=yourtoken \ LIVETRACKER_BASIC_AUTH_USER=youruser \ LIVETRACKER_BASIC_AUTH_PASS=yourpass \ ./livetracker
-
Configure OsmAnd:
- Go to Configure Trip Recording with Online tracking in OsmAnd (see docs)
- Add a new service with the following URL:
http://<your_server_ip>:8080/track?token=yourtoken&lat={0}&lon={1}×tamp={2}&hdop={3}&altitude={4}&speed={5}&bearing={6} - Replace
<your_server_ip>andyourtokenaccordingly.
-
Open the web interface:
- Visit
http://<your_server_ip>:8080/in your browser - Log in with the configured username and password
- Watch the live track update in real time!
- Visit
All received location data is stored in the SQLite database. On first load, the web interface displays the last 3 hours of history, but older data remains available in the database for future use or export.
The web interface includes datetime pickers that allow you to view location history from any custom time range. Use the "From" and "To" fields to select your desired time range, then click "Load Range" to fetch the data. Click "Load Recent" to reset to the default view.
For production deployments, it is strongly recommended to run LiveTracker behind a reverse proxy with HTTPS, such as Caddy or Nginx. This ensures secure access to your tracking data and credentials.
- Run tests:
go test -v ./... - The project includes a Dockerfile with a test stage for CI/CD.
This project is licensed under the MIT License. See LICENSE for details.