All posts
TraccarServer maintenanceLinuxMonitoring

Traccar server maintenance checklist — backups, updates, monitoring

Nov 12, 20268 min read

Installing Traccar takes an afternoon. Keeping it running for years is the real job. Most Traccar outages I see aren't bugs in Traccar. They're a full disk, an expired certificate, a backup that never worked, or an upgrade done on a Friday evening with no way back.

This is the checklist I use. Copy it, adapt it, and put the recurring items in your calendar.

All paths assume the standard Linux install: Traccar in /opt/traccar, config in /opt/traccar/conf/traccar.xml, logs in /opt/traccar/logs/, and a MySQL or MariaDB database called traccar.

The checklist at a glance

How often Task
Automatic, daily Database backup copied off the server
Automatic, nightly Old positions cleaned up
Automatic, every minute Uptime and health checks with alerts
Weekly Glance at disk space, database size and the error log
Monthly OS security updates, check backups really ran, review offline devices
Quarterly Test a full restore, review Traccar releases, review users and access
Before every upgrade Fresh backup, read the release notes, have a rollback plan

1. Backups you have actually tested

A backup only counts if you've restored it. You need three things:

  1. The database. This is everything: devices, users, positions, events, geofences.
  2. The config file /opt/traccar/conf/traccar.xml.
  3. Anything you customised, such as notification templates in /opt/traccar/templates/ or a custom web build.

A simple nightly backup script:

#!/usr/bin/env bash
# Nightly Traccar backup: database + config, keep 14 days locally.
set -euo pipefail

DEST=/var/backups/traccar
KEEP_DAYS=14
STAMP=$(date +%F)

mkdir -p "$DEST"

mysqldump --defaults-extra-file=/etc/traccar-backup.cnf \
  --single-transaction --quick traccar | gzip > "$DEST/traccar-db-$STAMP.sql.gz"

tar -czf "$DEST/traccar-conf-$STAMP.tar.gz" -C /opt/traccar conf templates

find "$DEST" -name 'traccar-*' -mtime +"$KEEP_DAYS" -delete

--single-transaction takes a consistent snapshot without locking the tables, so Traccar keeps receiving positions while the dump runs.

Copy backups off the server. A backup on the same disk dies with the disk. Use rclone to send them to object storage (Backblaze B2, Wasabi, S3, Google Drive) or rsync to another server, straight after the backup runs.

Test a restore every quarter. Spin up a cheap temporary server, install the same Traccar version, restore the dump and config, and log in. It takes 30 minutes and is the only way to know the backups work.

gunzip < traccar-db-2026-12-01.sql.gz | mysql traccar

2. Upgrading Traccar safely

Traccar releases bring new device protocols and bug fixes, so staying reasonably current matters. But never upgrade blind.

Before the upgrade:

  • Read the release notes on GitHub for every version between yours and the new one. Look for breaking changes and config keys that were renamed or removed.
  • Take a fresh database backup and copy traccar.xml somewhere safe.
  • Note your current version (shown in the web UI under Settings → Server, or in the logs at startup).
  • Pick a quiet time, not Friday evening.

The upgrade itself is the same as an install: download the new Linux installer from traccar.org, unzip it, and run it.

sudo cp /opt/traccar/conf/traccar.xml /root/traccar.xml.backup
sudo systemctl stop traccar
sudo ./traccar.run
diff /root/traccar.xml.backup /opt/traccar/conf/traccar.xml   # confirm your config survived
sudo systemctl start traccar
sudo tail -f /opt/traccar/logs/tracker-server.log

On first start, Traccar updates the database schema automatically. Watch the log until it finishes and devices start reporting. This schema change is why the backup matters: once a newer version has migrated the database, you can't simply run the old version against it again. Rolling back means reinstalling the old version and restoring the pre-upgrade dump.

After the upgrade: log in, open a few devices, check that positions are arriving, send a test notification, and check any custom reports.

If you run Traccar for clients, test the upgrade on a copy first. The quarterly restore test server is perfect for that.

3. Monitoring: find out before your customers do

You want an alert when something breaks, not a phone call from a customer. Cover these:

Check How
Web UI is up HTTP check on https://track.example.com
Devices can connect TCP check on the protocol ports you use, e.g. 5055 (OsmAnd), 5027 (Teltonika), 5023 (GT06)
Certificate is valid Most uptime tools can warn 14 days before expiry
Disk space Alert at 80% full
Devices actually reporting Count of devices online via the API

For the first three, a free hosted tool like UptimeRobot, or a self-hosted Uptime Kuma on a different server, is enough. A monitor on the same server can't tell you the server is down.

For disk space and device counts, a small script run by cron every 5–10 minutes works well:

#!/usr/bin/env bash
# Traccar health check: alert on low disk space or too few devices online.
set -uo pipefail

URL="https://track.example.com"
AUTH="monitor@example.com:CHANGE_ME"   # a read-only Traccar user
MIN_ONLINE=5                            # alert if fewer devices are online
DISK_LIMIT=80                           # alert above this % used
ALERT_EMAIL="you@example.com"

problems=()

used=$(df --output=pcent / | tail -1 | tr -dc '0-9')
(( used > DISK_LIMIT )) && problems+=("Disk ${used}% full")

if ! systemctl is-active --quiet traccar; then
  problems+=("traccar service is not running")
fi

online=$(curl -sf -u "$AUTH" "$URL/api/devices" | grep -o '"status":"online"' | wc -l)
(( online < MIN_ONLINE )) && problems+=("Only $online devices online")

if (( ${#problems[@]} )); then
  printf '%s\n' "${problems[@]}" | mail -s "Traccar alert on $(hostname)" "$ALERT_EMAIL"
fi

The mail command comes from the mailutils package and needs a working mail setup on the server. You can swap that line for a Telegram or Slack webhook with curl if that's easier.

Create a separate Traccar user for monitoring with read-only access and only the devices it needs, rather than using the admin account. Set MIN_ONLINE from what's normal for your fleet. A sudden drop usually means a network problem, a firewall change or a full disk, not 50 devices failing at once.

4. Disk space and database size

A full disk is the most common Traccar outage. MySQL stops accepting writes, Traccar can't save positions, and data is lost until someone notices.

  • Clean up old positions. Traccar keeps every position forever by default. A nightly cleanup keeps the database a stable size. I covered this in detail in Stop your Traccar database growing forever.

  • Clean up old logs. Traccar writes a new log file each day but doesn't delete old ones. Add a cron job:

    0 4 * * * find /opt/traccar/logs -name 'tracker-server.log.*' -mtime +30 -delete
    
  • Watch the backup folder, which grows too if the retention step ever breaks.

  • Check database size weekly so a sudden jump (a misconfigured device sending every second, say) doesn't surprise you:

    SELECT table_name, ROUND((data_length + index_length)/1024/1024) AS size_mb
    FROM information_schema.tables WHERE table_schema = 'traccar'
    ORDER BY size_mb DESC LIMIT 5;
    

5. Reading the logs

/opt/traccar/logs/tracker-server.log tells you most of what's going wrong. A quick weekly look:

grep -E 'WARN|ERROR' /opt/traccar/logs/tracker-server.log | tail -50

Things worth acting on:

  • Unknown device messages: a device is sending data but its identifier isn't registered, or doesn't match. Common after a customer replaces a tracker.
  • Repeated connection errors from one protocol: often a firewall or port change.
  • Database errors: check disk space and MySQL status first.

6. Security basics

A Traccar server holds live locations of people and vehicles. Treat it that way.

  • Change the default admin login straight after installing, and use a strong, unique password.
  • Turn off open registration (Settings → Server → uncheck Registration) unless you really want anyone to sign up.
  • Serve the web UI over HTTPS through Nginx or Apache with a Let's Encrypt certificate, and make sure it renews automatically.
  • Firewall everything else. Open only SSH, 80/443 and the device protocol ports you actually use. Don't expose MySQL (3306) or Traccar's own web port (8082) to the internet when a reverse proxy is in front.
  • Secure SSH: key-based login, no password login, and fail2ban to slow down brute-force attempts.
  • Apply OS security updates monthly, or enable unattended-upgrades for security patches.
  • Review users quarterly. Remove ex-employees and old customers, and check that each user can only see their own devices.

7. Keep a one-page runbook

Write down, in one place:

  • Server provider, IP addresses and how to log in
  • Traccar version and where the installer is
  • Where backups go and the exact restore commands
  • Which ports are used by which device models
  • Who to call, and the client's contact details

When something breaks at 2 a.m., or someone else has to fix it, this page saves hours.

Summary

  • Back up the database and config daily, copy them off the server, and test a restore every quarter.
  • Upgrade with a fresh backup, after reading the release notes, at a quiet time.
  • Monitor the web UI, device ports, certificate, disk space and online device count from somewhere else.
  • Control disk use with nightly position cleanup and log deletion.
  • Secure the server: HTTPS, firewall, SSH keys, updates and regular user reviews.
  • Document it all on one page.

Keep reading

Need help with your Traccar server?

I offer Traccar setup and maintenance, GPS tracking apps and Flutter development.