Build a reproducible GPS tracking stack, validate it locally, and publish only the dashboard you intend to share
This guide deploys Traccar with MySQL using Docker Compose, reviews the downloaded definition before execution, verifies the browser dashboard on port 8082, and establishes a practical maintenance and recovery plan. The walkthrough is based on Traccar release v6.16.0, associated with commit cfab560, and was reviewed on September 27, 2026. After the local installation and account controls are working, we use a Localtonet HTTP tunnel to provide remote dashboard access without inbound router port forwarding, VPN setup, firewall changes, or a public IP address.
๐ What's in this guide
Understand the Traccar deployment architecture
Traccar is a free, open-source GPS tracking platform for vehicles, assets, people, and other connected devices. Its Java-based server supports more than 200 GPS protocols and more than 2,000 tracker models. Available application features include real-time tracking, account and device management, geofences, reports, alarms, notifications, and driver-behavior monitoring.
The Traccar project publishes a Docker Compose quick start that combines the application with MySQL. Docker Compose creates the services, network, published ports, environment settings, and persistent storage described by the Compose definition. Traccar's browser application and REST API are available through the web service on port 8082.
This tutorial selects Traccar v6.16.0 as its review baseline instead of treating the mutable master branch as a stable release. The release is associated with source commit cfab560. Pinning the source revision lets you retain the exact Compose definition that was reviewed. It does not automatically pin every container image if that definition itself refers to a moving image tag such as latest. Image references must therefore be checked separately before startup.
Dashboard traffic is not tracker ingestion traffic
Port 8082 is the verified web endpoint for the dashboard and Traccar web service. It is not a universal ingestion port for all GPS hardware. Physical trackers generally connect to protocol-specific TCP or UDP listeners selected according to their model, firmware, and configured Traccar protocol.
The reviewed Traccar Compose pattern may publish a range of TCP and UDP ports so supported tracker protocols can reach their listeners. That broad publication is different from exposing the dashboard. Administrators should compare the rendered Compose configuration with the protocols actually required and reduce unnecessary host exposure where practical. Do not select a tracker port by guessing from a model name or by substituting port 8082.
The remote-access instructions below publish only Traccar's HTTP service on port 8082. If a tracker must connect from outside the local network, identify its exact protocol, transport, and listener port in current Traccar and hardware documentation. Configure any TCP, UDP, or combined UDP/TCP tunnel as a separate, protocol-specific workflow.
Prepare the Docker host
This tutorial begins with an already functioning Docker host. Installing an operating system, configuring storage hardware, and designing production host security are outside its scope. The host must have Docker Engine and the modern Docker Compose plugin installed and operational before you continue.
Docker installation procedures vary by Linux distribution, Windows edition, macOS version, and whether Docker Desktop or Docker Engine is used. Follow the official Docker Engine installation instructions and Docker Compose installation instructions for your platform rather than applying an unverified cross-platform command.
Confirm these requirements before downloading anything:
- Docker is running and your account is authorized to manage containers.
- The modern
docker composecommand is available. curlis installed, or you have another controlled method for downloading a file.- The host can reach the container registry and Traccar repository over the internet.
- Host TCP port
8082is not already occupied. - You have a dedicated deployment directory with restricted access.
- You have enough storage for MySQL, application logs, backups, and retained location history.
- You have selected a separate location for backups, ideally outside the active Docker data path.
Check Docker, Compose, and curl
docker --version
docker compose version
docker info
curl --version
The first two commands confirm the client tools. docker info also tests communication with the Docker daemon. Resolve daemon permission or connectivity errors before proceeding. Membership in a Docker management group can provide substantial host-level control, so grant that access only to trusted administrators.
Create and protect a deployment directory
Use a dedicated directory for the retained Compose file, review notes, backup scripts, and any deployment-specific configuration. Run all later Compose commands from this directory unless you explicitly supply a file path.
mkdir traccar-compose
cd traccar-compose
Resource requirements depend on the number of trackers, reporting frequency, database size, retained history, concurrent dashboard users, and enabled features. The reviewed project evidence does not establish a universal CPU, memory, or disk minimum, so monitor actual usage and maintain enough free space for database growth and backups.
Complete local startup, first-account creation, authentication checks, and backup planning before creating a public tunnel. GPS data can reveal homes, workplaces, travel patterns, asset locations, and operational schedules. Treat the dashboard as a sensitive system even when it is used by a small team.
Download, inspect, validate, and start Traccar
Traccar's repository shows a convenient command that downloads the Compose file from its master branch. That branch can change after publication, so it is not a reproducible release reference. For this tutorial, download the definition from the release-associated commit cfab560 and retain that exact file with your deployment records.
Download the release-associated Compose definition
Fetch the MySQL Compose definition using the selected immutable commit rather than the mutable master branch.
curl --fail --location \
--output compose.yaml \
https://raw.githubusercontent.com/traccar/traccar/cfab560/docker/compose/traccar-mysql.yaml
Record and inspect the downloaded file
Generate a local checksum and read the complete definition before Docker pulls an image or starts a service. Store the checksum with your change record so you can identify the reviewed copy later.
sha256sum compose.yaml
cat compose.yaml
Render and validate the effective configuration
Ask Docker Compose to parse the file and show the resulting configuration. Review this output carefully because interpolation and local environment variables can alter the effective deployment.
docker compose config
Resolve image and secret concerns
Identify every image reference, moving tag, database value, port publication, and storage mount. For a controlled deployment, replace moving application image references with a tested version tag or recorded image digest when the registry provides the required artifact. Replace example database passwords before startup and do not commit secrets to source control.
Start the reviewed Compose application
Only after inspection and validation should Docker obtain the images, create the project network and storage, and start the services in detached mode.
docker compose up -d
What to verify in the reviewed Compose definition
The Traccar MySQL deployment has two functional services: the Traccar application and a MySQL database. The application receives its database connection settings through the Compose configuration and reaches MySQL over the Compose network. The database uses persistent storage so recreating a container does not intentionally erase all records. Traccar also retains application logs through the configured storage mapping.
The definition publishes host port 8082 for the Traccar web service. It can also publish TCP and UDP ranges associated with tracker protocol listeners. Review those additional mappings instead of assuming they are required for your fleet. Database port 3306 does not need to be published publicly for Traccar to communicate with MySQL inside the Compose project.
| Compose element | Purpose | Required review |
|---|---|---|
| Traccar service | Runs the application, dashboard, API, and tracker protocol listeners. | Check the image reference, restart behavior, port publications, database variables, and log storage. |
| MySQL service | Stores persistent Traccar application records. | Check the image reference, health check, database name, account settings, passwords, and data volume. |
8082:8082 |
Publishes the Traccar web endpoint on the Docker host. | Confirm the host port is available and decide which local interfaces should be able to reach it. |
| Tracker port mappings | Allow devices to reach protocol-specific TCP or UDP listeners. | Identify the protocols you use and avoid treating the entire published range as a required public surface. |
| MySQL data volume | Preserves database files beyond an individual database container. | Record its exact name and storage location for backup, restore, and migration planning. |
| Traccar log mount | Retains application logs outside the writable container layer. | Protect sensitive log content, monitor growth, and include required files in the operational backup plan. |
The upstream quick-start pattern has historically used example database values suitable for demonstrating connectivity, not organization-specific secret management. The exact values in your retained file are the values that matter. Replace predictable or shared passwords before first startup. Prefer a protected environment file or a secret-management mechanism appropriate to your platform, and ensure rendered output, shell history, screenshots, and support bundles do not disclose those values.
Pinning the Git commit preserves the YAML, but a tag such as latest can later resolve to a different image. Record the resolved images with docker compose images after pulling them. For stricter reproducibility, use a tested version tag or digest and retain the modified Compose file as a deployment artifact.
Complete the Traccar 6.16.0 first-run account flow
Wait for MySQL initialization and Traccar startup before opening the dashboard. A newly created database has no existing organization accounts. In the selected Traccar 6.16.0 workflow, the first account registered against a fresh installation receives administrative access. Complete this step locally before making the login surface public.
If the installation uses a restored or previously initialized database, it is not a first-run deployment. The dashboard will use the accounts and permissions already stored in that database. Do not expect first-account registration to reset an existing administrator or replace forgotten credentials.
Open the local Traccar page
Browse to http://localhost:8082 on the Docker host after the services have stabilized.
Register the first administrative account
On a fresh Traccar 6.16.0 database, use the registration flow to create the initial account. Use a unique password and an administrator-controlled email address. Do not use database credentials or a Localtonet device token as the application password.
Confirm administrative access
Sign out and sign back in, then verify that the initial account has the expected administrative capabilities. Record the account owner and recovery process in your private operations documentation.
Create restricted user accounts
Avoid sharing the administrator account. Create separate accounts and limit device visibility and permissions according to each user's role.
Registration behavior and administrative controls can change between Traccar releases. If you select a version other than 6.16.0, verify its first-run behavior before deployment. Never apply default credentials copied from an old tutorial to an internet-reachable installation.
Verify Traccar locally before remote access
Check container state
docker compose ps
docker compose images
Confirm that both application and database services remain running. Record the resolved image references shown by Docker. A container that repeatedly restarts, exits, or remains unhealthy indicates an application, database, storage, resource, or configuration problem.
Inspect recent logs
docker compose logs --tail=100
Look for database initialization progress, connection failures, permission errors, invalid settings, port-binding failures, and repeated restart messages. Temporary retries can occur while MySQL initializes. Persistent errors after initialization deserve investigation.
Follow new messages while reproducing a problem with:
docker compose logs -f
Review output before sharing it. Logs can contain hostnames, device identifiers, account details, coordinates, network addresses, and other sensitive operational information.
Test the local dashboard and authentication
http://localhost:8082
If the browser runs on another trusted LAN device, use the Docker host's reachable LAN address and port 8082, provided the host firewall and port publication permit it. A successful loopback test does not prove that another machine can reach the service.
- Confirm the expected Traccar page loads without a connection error.
- Sign in with the intentionally created account.
- Sign out and verify that protected content is no longer accessible.
- Test a restricted user and confirm it cannot view unauthorized devices or administrative settings.
- Refresh the browser and confirm the session behaves as expected.
- Check that both containers remain stable during use.
- Review available application or server activity records for unexpected authentication behavior.
Test device ingestion separately
If a physical or software tracker is part of the deployment, configure it with the verified Traccar protocol, device identifier, destination, and listener port. Confirm that a new position reaches the intended device record and that its timestamp and location are plausible. Dashboard availability alone does not verify tracker ingestion.
Localtonet forwards traffic to the local target you configure. If the Localtonet client device cannot open the Traccar endpoint, the public URL will not work. Keep troubleshooting focused on Docker, Traccar, MySQL, port mappings, and local reachability until the local check passes.
Back up, restore, update, and roll back the deployment
Keep routine Compose commands in the directory containing the reviewed compose.yaml. Preserve that file, its checksum, any protected environment file, the resolved image references, and a record of intentional modifications.
| Operation | Command | Expected behavior |
|---|---|---|
| Validate configuration | docker compose config |
Parses and renders the effective configuration without starting the application. |
| Check service state | docker compose ps |
Lists containers in this Compose project and their current state. |
| Read recent logs | docker compose logs --tail=100 |
Displays recent output from the project services. |
| Restart services | docker compose restart |
Restarts existing containers without replacing the Compose definition. |
| Stop services | docker compose stop |
Stops containers while retaining them for a later start. |
| Start stopped services | docker compose start |
Starts containers that were previously stopped. |
| Remove project containers | docker compose down |
Removes project containers and networks but does not remove named volumes unless explicitly requested. |
Create a database-aware backup
A copy of compose.yaml is not a backup of Traccar records. The MySQL database contains the important operational state. The following pattern runs mysqldump inside the database service and uses the database environment already provided to that container. Confirm the database service name in your rendered configuration before using it.
mkdir -p backups
docker compose exec -T mysql sh -c \
'exec mysqldump --single-transaction -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"' \
> backups/traccar.sql
Restrict access to the resulting SQL file because it can contain account information, device identifiers, coordinates, event history, and other sensitive data. Also preserve the reviewed Compose file, checksum, protected environment file, and any retained Traccar configuration or log data required by your recovery plan.
The command assumes the reviewed database service is named mysql and exposes the listed environment variables inside the container. If your rendered configuration differs, adapt the command to that exact deployment instead of copying credentials into the shell command.
Test restoration in an isolated environment
A backup is not proven until it has been restored and checked. Restoration replaces or merges database state depending on the target database, so do not test it against the active production database.
- Create an isolated test deployment using the same reviewed Traccar and MySQL versions.
- Stop the test Traccar application so it does not write while the database is being restored.
- Confirm the test database is empty or intentionally prepared for restoration.
- Import the dump through the test MySQL service.
- Start Traccar and verify accounts, devices, recent positions, permissions, and reports.
- Destroy or securely retain the test copy according to your location-data policy.
cat backups/traccar.sql | docker compose exec -T mysql sh -c \
'exec mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"'
Exact recovery steps can differ when image versions, database schema, service names, storage drivers, or credentials differ. Preserve a deployment-specific runbook after completing a successful test restoration. Do not rely solely on copying live MySQL volume files while the database is running.
Update through a controlled change
- Record the current Compose checksum and resolved image references.
- Create and verify a fresh database backup.
- Retain the currently deployed Compose file and any local modifications.
- Read the target Traccar release information and database compatibility notes.
- Download the new definition from a fixed release tag or commit.
- Compare it with the deployed definition and inspect changed images, ports, volumes, variables, and secrets.
- Run
docker compose configbefore startup. - Schedule maintenance and stop public access if appropriate.
- Deploy the tested update.
- Verify login, user restrictions, reports, device ingestion, logs, and the Localtonet path.
Plan rollback before deployment
A rollback requires more than restoring an old YAML file. A newer application can introduce database changes that an older application does not understand. Preserve the pre-update database backup, old Compose definition, configuration, and image identifiers. If rollback is required, stop the updated stack, restore the compatible database state in accordance with the tested recovery runbook, restore the prior deployment definition, and repeat both dashboard and ingestion tests.
Do not add --volumes to docker compose down unless you deliberately intend to remove project volumes and have confirmed recovery. A named volume can contain the only active copy of the MySQL database.
Provide remote dashboard access with Localtonet
Once Traccar works locally, a Localtonet HTTP tunnel can provide a public HTTPS address for the dashboard. Our client runs on a device that can reach Traccar and establishes an outbound connection to a Localtonet relay server. The tunnel does not require inbound router port forwarding, VPN setup, firewall changes, or a public IP address.
Creating a tunnel configuration does not make it active. The selected client must be connected, and you must press Start. The public endpoint remains available only while that client is connected and the tunnel is running.
Install and run the Localtonet client
Install our client on the Docker host or another trusted device that can reach the Traccar dashboard. From that exact environment, open the local target before creating the tunnel.
Authenticate and select the client device
Use the device-specific authentication token for the client that will run the tunnel. Treat the token as a secret and keep it out of Compose files, repositories, screenshots, logs, and support messages.
Select an available relay server
Choose a relay server or region currently shown in the Localtonet dashboard. Available values can vary, so do not copy a hardcoded server code from an old tutorial.
Create the HTTP tunnel
Select an HTTP tunnel and set its local target to the address that reaches Traccar on port 8082. Choose Random Sub Domain, Custom Sub Domain, or Custom Domain as the Process Type. These process types serve the same target content at a public HTTPS address. Confirm current availability and any custom-domain requirements in the dashboard.
Start and test the tunnel
Press Start and open the assigned public URL in a private browser session. Confirm that the login page appears, unauthenticated users cannot view tracking data, and an authorized account can sign in.
Stop or delete remote access when appropriate
Stop the tunnel to suspend public availability while retaining its configuration, or delete it when the configuration is no longer required.
See the Localtonet HTTP tunnel documentation for the current dashboard workflow. Exact relay choices, plan availability, interface details, and custom-domain requirements should be verified in the current product.
Select the target from the client's point of view
| Localtonet client location | Possible target | Required check |
|---|---|---|
| On the Docker host | 127.0.0.1:8082 |
Open http://127.0.0.1:8082 on that host. |
| On another trusted LAN device | Docker host LAN address and port 8082 |
Open the address from the Localtonet client device and confirm the host firewall permits it. |
| Inside a separate container | Depends on the Docker network design | Test the exact address from inside the client environment. Container loopback does not refer to the Docker host. |
127.0.0.1 means the machine or container where the Localtonet client runs. It does not automatically mean the Docker host or Traccar container. Test the complete local URL from that environment before saving the target.
Protect location data, accounts, and public access
Traccar can hold precise location history, device identifiers, geofences, account data, movement patterns, operational schedules, and driver information. This information can create personal safety, privacy, employment, and business risks if exposed. Collect only what your use case requires, restrict retention where appropriate, and follow applicable privacy and tracking laws.
Review account permissions regularly
Do not use one administrator account for every user. Remove obsolete accounts promptly, review device assignments, and confirm that restricted users cannot see unrelated trackers. Recheck permissions after imports, upgrades, organizational changes, or administrator actions.
Monitor authentication and service activity where supported
Review the activity and logging capabilities available in the selected Traccar version, along with container and host logs. Look for repeated login failures, unexpected successful sessions, new accounts, permission changes, unexplained exports, and access at unusual times. Do not claim an audit event exists unless the installed version actually records it.
Protect the logs themselves. They may reveal device identifiers, account names, IP addresses, coordinates, or internal network details. Limit access and avoid sending unredacted logs through public support channels.
Review whether public access is still justified
A public HTTPS address makes the Traccar login surface reachable from the internet. Periodically confirm that remote access is still required, that all active users are authorized, and that the selected tunnel points only to the intended dashboard. Stop the tunnel during extended periods when public access is unnecessary.
Do not publish MySQL through the dashboard tunnel
The HTTP tunnel target is Traccar's web endpoint on port 8082. MySQL is a separate internal service and does not need to be made publicly reachable for browser access. Traccar communicates with it through the network defined by Docker Compose.
Test two paths after every change
After an application, database, networking, account, or tunnel change, test both the dashboard and tracker ingestion. A successful login does not prove that GPS messages are arriving. A device appearing online does not prove that browser permissions and remote authentication remain correct.
Troubleshoot installation and access problems
The Compose command is unavailable
If docker compose version fails, install or enable the Docker Compose plugin using Docker's platform-specific documentation. The Traccar workflow uses the modern space-separated command. Do not assume an older standalone docker-compose binary behaves identically.
The downloaded file is empty or invalid
Confirm that curl completed successfully and that compose.yaml contains YAML rather than an error page. The --fail option prevents many HTTP errors from being silently saved as successful output. Run docker compose config and do not continue until validation succeeds.
The image reference is not reproducible
A fixed Git commit does not make a moving image tag immutable. Inspect docker compose config, record docker compose images, and select a tested version tag or image digest when required by your deployment controls. Test any substitution because tags and digests must correspond to artifacts actually available from the registry.
Docker cannot bind port 8082
Another process may already occupy the host port, or host policy may prevent publication. Identify the conflict before editing the Compose file. If you deliberately select a different host-side port, preserve the container-side mapping required by Traccar and use the new host port for local tests and the Localtonet target.
The containers start and then exit
Run docker compose ps and inspect logs. Look for invalid database settings, rejected credentials, unavailable storage, permission failures, incompatible images, or resource termination. Preserve the first useful error instead of repeatedly recreating containers.
The dashboard is not immediately available
MySQL initialization can take time on first startup. Watch logs and service state for progress. If errors persist after initialization, investigate the reported failure rather than assuming additional waiting will repair it.
The dashboard works locally but not from another LAN device
Confirm the Docker host's LAN address, effective port publication, host firewall policy, and network reachability. A successful request to localhost proves only that the host can reach its own published service.
The Localtonet URL reports a connection failure
- Confirm the Traccar and MySQL containers are running.
- Open the exact target URL from the Localtonet client environment.
- Confirm the target uses the correct host address and port.
- Confirm the selected Localtonet client is connected.
- Confirm the tunnel has been started, not merely created.
- Check whether a host firewall or container boundary blocks the client.
The public URL loads the wrong application
The tunnel probably points to the wrong local port, or another service occupies the expected port. Compare the configured target with the URL that successfully loads Traccar from the Localtonet client device.
A tracker does not appear in Traccar
Verify the device model, configured Traccar protocol, unique device identifier, destination address, transport, and documented listener port. Some protocols use TCP, others use UDP, and some can involve both. Port 8082 is the web endpoint and must not be substituted for an unknown tracker listener.
The restored database does not start correctly
Check that the MySQL and Traccar versions are compatible with the backup, that the import completed without errors, and that the target database was prepared as intended. Review logs for schema, permission, encoding, and connection errors. Keep the failed restoration isolated and preserve the original backup unchanged.
Frequently asked questions
Which Traccar version does this guide review?
This guide uses Traccar release v6.16.0 and its associated source commit cfab560, reviewed on September 27, 2026. The Compose file is downloaded from that fixed commit rather than the mutable master branch.
Does pinning the Git commit also pin the container images?
No. It preserves the Compose file, but a moving image tag inside that file can still resolve to a newer artifact. Inspect the image references, record the resolved images, and use a tested version tag or digest when strict reproducibility is required.
What happens on the first Traccar 6.16.0 startup?
With a fresh database, use the registration flow to create the first account, which receives administrative access. Complete this locally, sign out and back in, and then create restricted accounts for routine use. A restored database retains its existing accounts instead.
What port does the Traccar dashboard use?
The reviewed Compose deployment publishes Traccar's web service on host port 8082. Test http://localhost:8082 on the Docker host before creating remote access.
Does port 8082 receive data from every GPS tracker?
No. Port 8082 is the web endpoint. GPS devices use protocol-specific TCP or UDP listeners. Identify the exact tracker model, Traccar protocol, transport, and listener port before configuring ingestion.
What must be included in a Traccar backup?
Back up MySQL with a database-aware process and preserve the deployed Compose file, checksum, protected environment configuration, image identifiers, and required Traccar configuration. A Compose file alone does not contain accounts, devices, or position history.
Does Localtonet require router port forwarding?
No. Our client establishes an outbound connection to a Localtonet relay server. This workflow does not require inbound router port forwarding, VPN setup, firewall changes, or a public IP address. The client must still be able to reach Traccar locally.
Is creating a Localtonet tunnel enough to activate it?
No. After creating the configuration, press Start. The endpoint works only while the selected Localtonet client is connected and the tunnel is running.
Should the Localtonet target always use 127.0.0.1?
Only when the Localtonet client runs in an environment where 127.0.0.1:8082 reaches Traccar. If the client runs on another machine or in another container, use an address tested from that environment.
Can the Traccar REST API use the same HTTP tunnel?
Traccar's REST API is part of its web service, so paths exposed through the same endpoint can be reached through the HTTP tunnel. API clients must follow the authentication and request requirements of the installed Traccar version. Never place credentials in public URLs.
Can I use a custom domain for the dashboard?
Localtonet HTTP tunnels support Random Sub Domain, Custom Sub Domain, and Custom Domain process types. Check the current dashboard and documentation for availability and exact custom-domain DNS requirements.
Connect your verified Traccar dashboard with Localtonet
Retain and validate the reviewed Compose definition, secure the first administrative account, verify Traccar on port 8082 from the client device, and then create an HTTP tunnel for controlled remote dashboard access.
Get Started Free โ