On this page
- How much server does a Traccar install need?
- How do you install Traccar from the release package?
- How do you switch Traccar from H2 to PostgreSQL?
- How do you publish the web interface with Nginx and HTTPS?
- Which firewall ports should you open for devices?
- How do you set up the first account and add a device?
- How do you enable email notifications?
- How do you keep the database size and upgrades under control?
- What if devices connect but no positions show up?
- Questions
How much server does a Traccar install need?
A plan with 2 GB of RAM tracks dozens of devices comfortably. The real growth is the positions table: a tracker reporting every 10 seconds writes over 8,000 rows a day, so disk space and database tuning matter more than CPU as the fleet grows. Set a retention period from the start (covered below) and you can stay on a modest plan for a long time.
You need Ubuntu 24.04/22.04, Debian 12/13, Rocky Linux 9 or AlmaLinux 9, a sudo user and a hostname such as gps.example.net pointing at 198.51.100.24.
How do you install Traccar from the release package?
Pick the current version on the Traccar download page and set it in a variable. The installer ships its own Java runtime, so no separate JDK is required.
sudo apt install -y unzip curl # Ubuntu, Debian
sudo dnf install -y unzip curl # Rocky, Alma
TC_VERSION=6.x # replace with the current release
cd /tmp
curl -fsSLO https://github.com/traccar/traccar/releases/download/v$TC_VERSION/traccar-linux-64-$TC_VERSION.zip
unzip traccar-linux-64-$TC_VERSION.zip
sudo ./traccar.run
ls /opt/traccarThe installer registers traccar.service but does not start it, which gives you time to switch the database first.
How do you switch Traccar from H2 to PostgreSQL?
The default embedded H2 database is meant for testing. Install PostgreSQL and create a user and database. On Ubuntu and Debian:
sudo apt install -y postgresql
sudo -u postgres createuser --pwprompt traccar
sudo -u postgres createdb -O traccar traccarOn Rocky and Alma, initialise the cluster first and allow password logins over loopback by changing ident to scram-sha-256 on the 127.0.0.1/32 and ::1/128 lines of /var/lib/pgsql/data/pg_hba.conf:
sudo dnf install -y postgresql-server
sudo postgresql-setup --initdb
sudo systemctl enable --now postgresql
sudo -u postgres createuser --pwprompt traccar
sudo -u postgres createdb -O traccar traccar
sudo systemctl restart postgresqlThen replace the H2 entries in /opt/traccar/conf/traccar.xml with these lines:
<entry key="database.driver">org.postgresql.Driver</entry>
<entry key="database.url">jdbc:postgresql://127.0.0.1:5432/traccar</entry>
<entry key="database.user">traccar</entry>
<entry key="database.password">your-db-password</entry>sudo systemctl enable --now traccar
sudo tail -f /opt/traccar/logs/tracker-server.log
curl -I http://127.0.0.1:8082Traccar creates its tables on the first start. More PostgreSQL basics are in the PostgreSQL guide.
How do you publish the web interface with Nginx and HTTPS?
The web app talks to the server over a websocket at /api/socket, so the proxy must pass upgrade headers. Install nginx, certbot and python3-certbot-nginx (on Rocky and Alma from EPEL), then create /etc/nginx/conf.d/traccar.conf:
server {
listen 80;
listen [::]:80;
server_name gps.example.net;
location / {
proxy_pass http://127.0.0.1:8082;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600s;
}
}sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d gps.example.netOn Rocky and Alma also run sudo setsebool -P httpd_can_network_connect 1. Certificate renewal is automatic; see Certbot for details.
Which firewall ports should you open for devices?
Open web traffic plus only the protocol ports your trackers use, and keep 8082 closed so the web app is reachable only through Nginx. Each protocol has its own port; the Traccar device list shows which one matches your hardware. For phones running the Traccar Client app (OsmAnd protocol) and Teltonika devices:
# Ubuntu, Debian
sudo ufw allow 80,443/tcp
sudo ufw allow 5055/tcp
sudo ufw allow 5027/tcp
sudo ufw allow 5027/udp
# Rocky, Alma
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --permanent --add-port=5055/tcp --add-port=5027/tcp --add-port=5027/udp
sudo firewall-cmd --reloadCheck which ports Traccar actually listens on with sudo ss -tulpn | grep java. See firewall rules for the general approach.
How do you set up the first account and add a device?
Open https://gps.example.net and register: the first account becomes the administrator. Then open the server settings and turn off registration so nobody else can create accounts, and add users yourself.
To add a device, click the plus icon and enter a name and the device identifier (IMEI for hardware trackers, or the ID shown in the Traccar Client app). Configure the tracker to send to gps.example.net on its protocol port. For the phone app, the server URL is http://gps.example.net:5055. The device turns online in the list as soon as the first position arrives.
How do you enable email notifications?
Traccar can mail alerts for events such as geofence entry, overspeed or device offline. Add these entries to traccar.xml and restart the service:
<entry key="mail.smtp.host">smtp.relay.example.net</entry>
<entry key="mail.smtp.port">587</entry>
<entry key="mail.smtp.starttls.enable">true</entry>
<entry key="mail.smtp.from">gps@example.net</entry>
<entry key="mail.smtp.auth">true</entry>
<entry key="mail.smtp.username">relay-user</entry>
<entry key="mail.smtp.password">relay-password</entry>Use an authenticated relay on port 587 like this rather than direct sending. Port 25 from the VPS should not be assumed open; ask support with a ticket before relying on it. The SMTP relay guide covers sender authentication.
How do you keep the database size and upgrades under control?
Positions pile up fast. Traccar can purge old data automatically; set a retention in days in traccar.xml:
<entry key="database.historyDays">180</entry>Back up the database and config before every upgrade:
sudo -u postgres pg_dump traccar | gzip > ~/traccar-$(date +%F).sql.gz
sudo cp /opt/traccar/conf/traccar.xml ~/traccar.xml.bakTo upgrade, stop the service, run the new traccar.run the same way, compare /opt/traccar/conf/traccar.xml with your backup and restore your entries if the installer replaced the file, then start the service again and watch the log while the schema migrates.
What if devices connect but no positions show up?
- Confirm the device reaches the server:
sudo tcpdump -ni any port 5027shows incoming packets. - Look for "unknown device" lines in
tracker-server.log; the identifier in the web app must match the one the device sends. - If the device uses a different protocol than expected, the log shows the port it hit; open that one instead.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Traccar GPS tracking
Does Traccar need Java installed separately?
No. The Linux installer bundles a Java runtime inside /opt/traccar.
Can I run Traccar in Docker instead?
Yes, the project publishes a traccar/traccar image. You map conf and logs as volumes and publish the device ports you need; the configuration file stays the same.
Which trackers are supported?
Traccar speaks over two hundred protocols, covering most commercial GPS trackers, plus the free Traccar Client apps for Android and iOS.
Can I use MySQL or MariaDB instead of PostgreSQL?
Yes, Traccar supports MySQL as well. The driver and URL entries differ; copy them from the database section of the Traccar documentation.
How much transfer does tracking use?
Very little per device. Positions are small packets, and the web app traffic is light, so most plans have plenty of monthly transfer for a fleet.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM