Nomploy Nomad Packs

← All packs

traccar v0.1.0

Productivity

Traccar — an open-source GPS tracking platform supporting 200+ device protocols, with live maps, geofences, reports and alerts. Deployed as a single host-networked Nomad service with the embedded H2 database.

nomad-pack run traccar --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- traccar

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 8082 2 volumes image traccar/traccar:latest tracks :latest image bumped today
Variables 9
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run traccar -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "traccar"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Traccar container image. Pin a tag in production.
image = "traccar/traccar:latest"

# Host port for the Traccar web UI.
port = 8082

# Named volume for the embedded H2 database and data (/opt/traccar/data).
data_volume = "traccar_data"

# Named volume for Traccar logs (/opt/traccar/logs).
logs_volume = "traccar_logs"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 500
    memory = 1024
  }
NameTypeDefaultDescription
job_name string
"traccar"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"traccar/traccar:latest"
The Traccar container image. Pin a tag in production.
port number
8082
Host port for the Traccar web UI.
data_volume string
"traccar_data"
Named volume for the embedded H2 database and data (/opt/traccar/data).
logs_volume string
"traccar_logs"
Named volume for Traccar logs (/opt/traccar/logs).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 1024
  }
The task resources.
Back up this pack

This pack stores data in 2 Docker named volumes: traccar_datatraccar_logs

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/traccar_data/_data \
  /var/lib/docker/volumes/traccar_logs/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/traccar_data/_data backup:<bucket>/traccar_data
rclone sync /var/lib/docker/volumes/traccar_logs/_data backup:<bucket>/traccar_logs

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

traccar

Traccar is a popular open-source GPS tracking platform. It speaks over 200 device protocols (commercial trackers, phones via the Traccar Client app, OBD dongles and more), and gives you live maps, trip and stop detection, geofences, reports, notifications and a full REST API.

This pack runs Traccar as a single host-networked Nomad service using its embedded H2 database, so there's nothing else to set up to get started.

Deploy

nomad-pack run traccar --registry=nomploy

Open http://<node-ip>:8082 and register — the first account created becomes the administrator.

Configuration

Variable Default Description
image traccar/traccar:latest Container image (pin a tag in production).
port 8082 Host port for the web UI.
data_volume traccar_data Volume for the H2 database (/opt/traccar/data).
logs_volume traccar_logs Volume for logs (/opt/traccar/logs).
resources 500 MHz / 1024 MB CPU and memory for the task.

Devices connect on the protocol port range 5000-5150 (TCP/UDP), which host networking exposes on the node. For production, configure an external MySQL or PostgreSQL database via a mounted traccar.xml instead of the embedded H2 store.