Traccar provides official Docker images that are available directly on Docker Hub.
Recommended tags:
Multi-platform images available:
Command to create a container using the default database and configuration:
docker run \ --name traccar \ --hostname traccar \ --detach --restart unless-stopped \ --publish 80:8082 \ --publish 5000-5300:5000-5300 \ --publish 5000-5300:5000-5300/udp \ traccar/traccar:latest
Publishing the full 5000-5300 range starts a separate docker-proxy process for every port (for both TCP and UDP), which consumes a large amount of memory and can leak connections under load. To avoid this, disable the userland proxy so Docker uses iptables NAT instead by adding the following to /etc/docker/daemon.json and restarting Docker:
{
"userland-proxy": false
}
Alternatively, publish only the ports for the protocols that you actually use.
It is usually a good idea to mount the logs, data, and configuration file from the host. Make sure to create the directories and the configuration file first.
--volume /opt/traccar/logs:/opt/traccar/logs:rw --volume /opt/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro --volume /opt/traccar/data:/opt/traccar/data:rw
The default H2 database is not recommended for production use. For non-testing deployments, we recommend TimescaleDB for large installations or MySQL for smaller servers.
The following Docker Compose examples can serve as a starting point for your deployment with a production-grade database: