Traccar GPS Tracking 6.16.0
Overview
This guide covers launching and using the Traccar GPS Tracking 6.16.0 on Ubuntu 24.04 AMI from SecureAnyCloud on Amazon EC2. It is one version of the SecureAnyCloud Hardened EHRbase & GIS, Health and Research Platforms AMIs listing on AWS Marketplace. You pick it as the software version when you subscribe and launch.
Traccar is the reference open-source GPS tracking and fleet telematics server. It receives position reports from vehicle trackers, asset tags and phones, and stores them with a full history. A web application and a complete REST API give you live maps, trip replay, geofences, scheduled and on-demand reports, event notifications, and driver and maintenance records. Traccar understands more than two hundred tracker protocols.
What you get:
- HTTPS from the first boot. nginx serves Traccar on port 443 with a certificate generated on your instance's first boot, never baked into the image. Port 80 redirects to HTTPS.
- No default login and no open enrolment. A fresh Traccar makes the first account anyone creates an administrator. On this image, the web door stays shut until first boot has created your administrator with a random password. First boot also closes self-registration and proves it closed.
- Its own database, created on your instance. PostgreSQL 16 is installed, but no database ships in the image. First boot creates this instance's cluster, listening on its local socket only. Traccar signs in to it by operating system identity (peer authentication), so there is no database password anywhere.
- No device port open by default. Traccar listens for trackers only on the protocols you enable with one command (Step 8). Until you choose otherwise, the only open ports are 22, 80 and 443.
- Traccar on loopback only, as an unprivileged user. The application listens on
127.0.0.1:8082and runs as thetraccarsystem user in a systemd sandbox. You reach it only through nginx. - Fixed host and real client addresses. Requests for a host name the instance does not serve are dropped. Links Traccar generates use your configured host name. Cross-site requests and WebSocket connections from other web origins are refused. Traccar records the real client address rather than forged forwarding headers.
- Metadata service blocked. Traccar, nginx and PostgreSQL cannot reach the instance metadata service, so a forwarding URL, webhook or map source can never reach it. The AMI also requires IMDSv2.
- Fully patched Ubuntu 24.04 LTS at build time, with unattended security upgrades switched on. They cover OpenJDK 21, PostgreSQL and nginx.
- What is on the image: Traccar 6.16.0 (
/opt/traccar), OpenJDK 21, PostgreSQL 16 (cluster created at first boot), nginx, Ubuntu 24.04 LTS, cloud-init and the AWS Systems Manager agent. - Defaults: default user
ubuntu, architecture x86_64, recommended instance type m5.large.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair, and a VPC subnet with a route to the internet (or a private route you use for management).
- A security group that allows TCP 22 (SSH) from your management network. It must also allow TCP 443 (the web interface) and TCP 80 (redirects to HTTPS) from the networks your users work from.
- Open a device protocol port only after you enable that protocol (Step 8), and only to the addresses your trackers report from. Never open port 8082.
Launch the instance
In the AWS Marketplace listing, choose Continue to Subscribe, then Continue to Configuration. Pick Traccar GPS Tracking 6.16.0 on Ubuntu 24.04 as the software version, choose your Region, then choose Launch through EC2.
Choose m5.large, your key pair and a security group as above. The m5.large size handles a small to medium fleet. For hundreds of devices reporting at short intervals, choose a larger instance and a larger root volume.
Or launch with the AWS CLI. Replace the values in angle brackets:
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=traccar}]'Connect to your instance
For Traccar GPS Tracking 6.16.0 on Ubuntu 24.04, the SSH user is ubuntu. Connect with your key pair:
ssh -i <your-key.pem> ubuntu@<public-ip>Check the services
First boot takes about a minute. It creates the database, generates the certificate and the administrator password, and only then lets nginx start. After that, every unit is active:
systemctl is-active postgresql@16-main traccar nginx traccar-firstbootactive active active activeTraccar runs on Ubuntu's own OpenJDK package, so unattended-upgrades keeps the JVM patched along with the rest of the system. Check the Java version:
java -version 2>&1 | head -2openjdk version "21.0.12.1" 2026-08-18 OpenJDK Runtime Environment (build 21.0.12.1+1-1-24.04.4-Ubuntu)Check what the network can reach
Run the port check to list every port reachable from outside the instance:
sudo /usr/local/sbin/traccar-port-check.shoff-box TCP exactly [22 80 443]; Traccar web on loopback 8082; PostgreSQL socket-only TRACCAR_PORTS_OKThat is the complete network surface of a new instance: SSH, the HTTPS front door and the HTTP redirect. Traccar's own web server listens on loopback, and PostgreSQL has no TCP listener at all. No device protocol is listening yet:
sudo traccar-protocols listno device protocol is enabled (the default)Read your login
First boot writes this instance's URL, the administrator login and its password to a root-only file. Read it with:
sudo cat /root/traccar-credentials.txt# Traccar GPS Tracking 6.16.0 on Ubuntu 24.04 (sac)
# Generated on this instance's first boot. These credentials are unique to THIS instance. TRACCAR_URL=https://<public-dns-name>/ TRACCAR_ADMIN_USER=admin TRACCAR_ADMIN_PASSWORD=<TRACCAR_ADMIN_PASSWORD> ...None of these values exists in the image. Your instance's first boot creates the password, the certificate and the database.
Sign in
Open the TRACCAR_URL from Step 5 in a browser. The certificate is self-signed and unique to your instance, so the browser warns on the first visit. Step 10 shows how to use your own DNS name and certificate.
Sign in as admin with the password from Step 5. A new instance has no devices, so the map is empty until you add one.
You can run the same checks from the command line. First, confirm that self-registration is closed:
curl -sk https://127.0.0.1/api/server \
| python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({k: d[k] for k in ("registration","readonly","deviceReadonly")}, indent=2))'{ "registration": false, "readonly": false, "deviceReadonly": false }Then make a real sign-in through the front door. The command reads the password from your credentials file and passes it to curl on standard input, so it never appears on a command line:
sudo sed -n 's/^TRACCAR_ADMIN_PASSWORD=//p' /root/traccar-credentials.txt | tr -d '\n' \
| curl -sk -c /tmp/traccar.jar -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "email=admin" --data-urlencode "password@-" https://127.0.0.1/api/session \
| python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({k: d[k] for k in ("name","login","email","administrator")}, indent=2))'{ "name": "Administrator", "login": "admin", "email": "admin@localhost", "administrator": true }Add your first tracker
Every tracker identifies itself by a unique identifier, usually its IMEI (printed on the device or returned by an SMS status command). Register the identifier first. Traccar refuses positions from identifiers it does not know, so an unregistered device cannot inject data into your fleet.
In the web interface, choose Settings, Devices, then +. Give the device a name and enter its identifier. Or use the API with the session from Step 6:
curl -sk -b /tmp/traccar.jar -X POST -H 'Content-Type: application/json' \
--data '{"name":"My first tracker","uniqueId":"123456789012345"}' https://127.0.0.1/api/devices \
| python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({k: d[k] for k in ("id","name","uniqueId","status")}, indent=2))'{ "id": 1, "name": "My first tracker", "uniqueId": "123456789012345", "status": "offline" }Enable the protocol your trackers speak
Traccar supports more than two hundred device protocols, each on its own port. This image enables none by default, because every protocol listener is unauthenticated by design. The device identifier is the only credential. Enable exactly the protocols your hardware uses.
Traccar's device list gives the protocol name and the conventional port for every supported tracker. Common ones are osmand on 5055 (the official Traccar Client app for Android and iOS), teltonika on 5027 and gt06 on 5023. For example, enable the osmand protocol:
sudo traccar-protocols enable osmand 5055traccar-protocols: osmand enabled on port 5055. Now open 5055 (TCP, and UDP if your trackers use it) in the instance's security group to your trackers' addresses.The command checks the name against the protocols this Traccar build implements, writes the configuration and restarts Traccar. The restart signs out any open web and API sessions.
Now send a test position for the device from Step 7, from the instance itself. This is the same request the Traccar Client app makes:
curl -s -o /dev/null -w '%{http_code}\n' "http://127.0.0.1:5055/?id=123456789012345&lat=51.5074&lon=-0.1278&speed=12×tamp=$(date -u +%s)"200Run the network check again. It now lists the new port and nothing else:
sudo /usr/local/sbin/traccar-port-check.shoff-box TCP exactly [22 80 443 5055]; Traccar web on loopback 8082; PostgreSQL socket-only TRACCAR_PORTS_OKThen open the port in the instance's security group. Ideally, allow only the address ranges your trackers or your mobile operator's APN report from:
aws ec2 authorize-security-group-ingress --group-id <your-security-group> \
--ip-permissions 'IpProtocol=tcp,FromPort=5055,ToPort=5055,IpRanges=[{CidrIp=<tracker-cidr>}]'In the Traccar Client app, set the server URL to http://<public-dns-name>:5055 and the device identifier to the value you registered. Positions start arriving within a minute, and the device turns Online on the map.
Select a device to see its status card with fix time, position, speed and total distance.
To turn a protocol off again, run sudo traccar-protocols disable <name> and remove its security group rule.
Reports and the API
Choose Reports in the navigation. Positions lists every stored fix. Trips and Stops group them into journeys and dwell time. Summary and Chart aggregate distance, engine hours and speed. Pick a device and a period, then select Show.
You can get the same data through the API. Enabling a protocol in Step 8 restarted Traccar, which signs every session out, so sign in again first:
sudo sed -n 's/^TRACCAR_ADMIN_PASSWORD=//p' /root/traccar-credentials.txt | tr -d '\n' \
| curl -sk -o /dev/null -w '%{http_code}\n' -c /tmp/traccar.jar -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "email=admin" --data-urlencode "password@-" https://127.0.0.1/api/session200curl -sk -b /tmp/traccar.jar "https://127.0.0.1/api/positions" \
| python3 -c 'import json,sys; print(json.dumps([{k: p[k] for k in ("deviceId","latitude","longitude","speed")} for p in json.load(sys.stdin)][:1], indent=2))'[ { "deviceId": 1, "latitude": 51.5074, "longitude": -0.1278, "speed": 12.0 } ]The full API reference is at traccar.org/api-reference. When you have finished, remove the cookie jar with rm -f /tmp/traccar.jar.
Your own DNS name and certificate
Point a DNS name at the instance. An Elastic IP keeps the address stable. Then tell the instance its name. This regenerates the self-signed certificate for the name, pins nginx and the cross-origin guard to it, and sets the address Traccar uses in notification and report links:
sudo traccar-set-hostname <your-domain>To use a certificate from a public authority, issue it for the same name, for example with certbot and a DNS challenge. Install it where nginx expects it, then reload nginx:
sudo install -o root -g root -m 0600 /etc/letsencrypt/live/<your-domain>/privkey.pem /etc/ssl/traccar/traccar.key
sudo install -o root -g root -m 0644 /etc/letsencrypt/live/<your-domain>/fullchain.pem /etc/ssl/traccar/traccar.crt
sudo nginx -t && sudo systemctl reload nginxRunning traccar-set-hostname again replaces the certificate with a self-signed one. Repeat the two install commands after it, and in your certificate renewal hook.
Add more users
Self-registration is disabled, so nobody who finds your instance can enrol themselves. Add users from Settings, Users, +, or through the API as the administrator:
curl -sk -b /tmp/traccar.jar -X POST -H 'Content-Type: application/json' \
--data '{"name":"Dispatcher","email":"dispatch@example.com","password":"<new-password>"}' \
https://127.0.0.1/api/usersGrant each user access to specific devices from Settings, Users, then Show next to the user. Leave Admin off for everyday accounts.
If you deliberately want open enrolment, turn it on in Settings, Server, Registration. Do not do this on an instance reachable from the internet unless you intend anyone to be able to create an account.
Security checks
The image carries the checks it was built with. The administrator password works through the front door. Traccar refuses admin/admin, blank and common passwords. Self-registration is closed, and the session cookie is Secure, HttpOnly and SameSite. Run the login check:
sudo /usr/local/sbin/traccar-verify-login.shper-instance credential authenticates as administrator (200); admin/admin and weak passwords refused (401), blank refused (400) self-registration closed (anonymous POST /api/users -> 400); cookie Secure+HttpOnly+SameSite TRACCAR_LOGIN_OKA caller cannot forge the address Traccar records for a sign-in. The check compares a request through nginx with one sent straight to Traccar:
sudo /usr/local/sbin/traccar-xff-check.shthrough nginx Traccar recorded [127.0.0.1], not the forged [203.0.113.77]; the direct control recorded [203.0.113.77] TRACCAR_XFF_OKTraccar, nginx and PostgreSQL are denied the instance metadata service at the kernel level:
systemctl show -p IPAddressDeny traccar nginx postgresql@16-mainIPAddressDeny=169.254.169.254/32 fd00:ec2::254/128 168.63.129.16/32 IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128 168.63.129.16/32 IPAddressDeny=169.254.169.254/32 fd00:ec2::254/128 168.63.129.16/32Back up your data
Everything Traccar stores (devices, users, positions, geofences, reports) is in the traccar PostgreSQL database. Uploaded media is in /opt/traccar/media. Dump the database as the postgres operating system user (peer authentication, no password):
sudo -u postgres pg_dump -Fc traccar > <backup-dir>/traccar-$(date +%F).dump
sudo tar czf <backup-dir>/traccar-media-$(date +%F).tar.gz /opt/traccar/media /etc/traccar-sacTo restore onto a new instance, stop traccar.service. Restore with sudo -u postgres pg_restore --clean --if-exists -d traccar <dump>, put the media back and start the service.
Keep the dumps off the instance, for example in Amazon S3, or snapshot the EBS volume.
Versions, build provenance and licence
The image records the upstream release, archive checksum, licence and runtime it was built from. Read the provenance file:
cat /usr/share/doc/traccar-sac/BUILD-PROVENANCE.txtTraccar 6.16.0 - https://github.com/traccar/traccar/releases/tag/v6.16.0 Archive: traccar-other-6.16.0.zip sha256 87be9347090248747cf31ff00a554d59c28e50d1d41d1f68f7f16957976bde55 Licence: Apache-2.0 (LICENSE.txt at v6.16.0, byte-identical to v6.15.3) Removed from lib/: h2, mysql-connector-j, mssql-jdbc, mariadb-java-client (unused JDBC drivers) Runtime: openjdk-21-jre-headless (Ubuntu noble main); datastore PostgreSQL 16 (Ubuntu noble main), cluster created on each instance's first boot (socket only, peer authentication, no password).Server components
- Traccar 6.16.0: /opt/traccar, traccar.service, user traccar, 127.0.0.1:8082.
- OpenJDK 21: Ubuntu openjdk-21-jre-headless.
- PostgreSQL 16: cluster 16/main, UNIX socket only, peer authentication.
- nginx 1.24: ports 80 (redirect) and 443 (TLS 1.2 and 1.3).
Filesystem layout
- /opt/traccar/conf/traccar.xml: Traccar configuration. It is generated, so use the helpers below to change it.
- /etc/traccar-sac/protocols: enabled device protocols (traccar-protocols).
- /root/traccar-credentials.txt: this instance's URL and administrator login (root-only).
- /etc/ssl/traccar/: this instance's certificate and key.
- /var/lib/postgresql/16/main: the database, created at first boot.
- /opt/traccar/media, /opt/traccar/logs: uploaded media and Traccar's log.
Managing the services
Use these commands to restart Traccar, read its logs and manage protocols and the host name:
sudo systemctl restart traccar
# after changing anything in Traccar's settings files sudo journalctl -u traccar -n 100 --no-pager sudo tail -n 50 /opt/traccar/logs/tracker-server.log sudo traccar-protocols list | enable <name> <port> | disable <name> sudo traccar-set-hostname <dns-name>Security recommendations
- Keep port 8082 closed. nginx on 443 is the only web door. Restrict port 22 to your management network.
- Open a device protocol port only to the addresses your trackers report from. Register device identifiers deliberately, because anyone who can reach an enabled protocol port can send positions for a registered identifier.
- Event forwarding, webhooks and notification channels send data to the URLs you configure. The metadata service stays blocked for Traccar whatever URL is set.
- Unattended upgrades apply Ubuntu security updates for OpenJDK, PostgreSQL and nginx. Reboot when
/var/run/reboot-requiredappears. - To upgrade Traccar itself, back up first (Step 13). Replace
/opt/traccarwith a newer release while keepingconf/traccar.xml, then restart the service. Traccar migrates its own schema on start.
Troubleshooting
The web interface does not load. systemctl is-active traccar nginx should print active twice. Both wait for first boot, and journalctl -u traccar-firstboot --no-pager shows what it did. If traccar is not active, read journalctl -u traccar -n 100 --no-pager.
A tracker does not appear. Check that the protocol is enabled (sudo traccar-protocols list) and that its port is open in the security group. In /opt/traccar/logs/tracker-server.log, Unknown device means the identifier is not registered (Step 7). No line at all means the tracker is not reaching the port.
The browser shows a certificate warning. The certificate is self-signed and unique to your instance. Accept it for testing, or install your own name and certificate (Step 10).
The live map does not update when opened through another address. Traccar is served only under the names it knows: your configured name and the instance's own IP addresses. Use TRACCAR_URL from the credentials file, or set your own name with traccar-set-hostname.
Support and licensing
Traccar is open-source software distributed under the Apache License 2.0. The image runs the unmodified upstream 6.16.0 release with the unused database drivers removed.
SecureAnyCloud provides 24/7 technical support for this image by email and live chat at sales@secureanycloud.com, with a 24-hour response SLA.
Traccar is a trademark of its respective owner. All product names are trademarks of their respective owners. SecureAnyCloud is not affiliated with or endorsed by Traccar Ltd or the OpenStreetMap Foundation.
Deploy on AWS
Launch Traccar GPS Tracking 6.16.0 on Ubuntu 24.04 on AWS, with 24/7 support from SecureAnyCloud.
View on Marketplace
Need help?
Our support team is available 24/7.
sales@secureanycloud.com