This instruction will inform about a couple of basic components and guide through the process of installing Traccar on a Synology NAS using Docker. It will focus on employing Sonology’s User Interface (UX) capabilities mainly.
When can you use this installation instruction?
Synology and Traccar use Ports to address services. Unfortunately, some of the ports overlap.
Before you carry on, make sure what port / protocol your tracker uses: https://www.traccar.org/devices/ and compare to the ports the services you installed in your Synology uses: https://kb.synology.com/en-us/DSM/tutorial/What_network_ports_are_used_by_Synology_services
Example 1: You own a TK104 tracker. That runs on port 5001. Port 5001 is used by Synology for certain secure services as DSM, File & Audio Station, so you can’t run Traccar on that port! You need to remap the Traccar ports – you can’t use this instruction for the simple installation. Instead use this one: https://motorradtouren.de/synology-docker-install-traccar-server-including-mariadb-and-phpmyadmin/
Example 2: You use an AVL-900 real time vehicle tracker. AVL-900 needs port 5005. Synology uses 5005 on case you run Webdav / Caldav. Now you need to decide.
* If you have Webdav/Caldav installed: You need to remap the Traccar ports – you can’t use this instruction for the simple installation. Instead use this one: https://motorradtouren.de/synology-docker-install-traccar-server-including-mariadb-and-phpmyadmin/
* You don’t have Webdav/Caldav installed: Carry on with this simple instrution!
Example 3: You want to use your mobile as a tracker. The mobile app uses the Osmand protocol on port 5055. Port 5055 is not in use by any Synology services: So it works – use this instrution and carry on!
You are here because you want to install Traccar on a Synology Plus Series and you are sure you will have no port overlaps between Traccar and Synology.
- A Synology NAS of the Plus Series, as those are enabled for virtualizing environments with their more powerful central processing units (CPUs). These are easily identified by the name DSxxxx+.
- Some understanding of DNS, Network, Ports and Proxies to make sense of and secure things.
- Understanding of IP handling and Port forwarding for your Router.
- Understanding of the Synology Disk Station (DS) and the Disk Station Manager (DSM) and an Administrator Account for the DSM.
- A registered Domain which forwards (e.g. via DynDNS) to your Router/Server (Synology DS) and/or a Subdomain with according CNAME entry.
What is Traccar?
With Traccar you can view your GPS tracking devices in real-time with no delay. There are various mapping options, including road maps and satellite imagery. The Server can handle a wide variety of sensors and additional information supplied by GPS units. Code and documentation can be found here: https://www.traccar.org/
More details here: https://www.traccar.org/products/
What is Docker?
Docker is a platform written in Go and takes advantage of several features of the Linux kernel to deliver its functionality.
Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host (Synology).
Docker uses a technology called namespaces to provide the isolated workspace (the container). These namespaces provide a layer of isolation. Each aspect of a container runs in a separate namespace and its access is limited to that namespace.
Note: Synology’s DSM is a heavily customized Linux. Even though DSM already employs for example components like ngnix and postgres, separate containers will use a part of the existing Linux base but not interfere with any of the Synology’s components of functionality.
- Create the folder structure
- Pull image
- Create container
Create folder structure
In Synology folder /volume1/docker make your workspace for the container data and configuration files.
You must have installed on your Synology:
- MariaDB 10 (With DSM 7 this is the only option).
Start phpMyadmin and add a new User and an empty database that traccar can use.
Create / edit configuration file
20. August 2022:
With traccar version >5, before you move on, read this post carefully:
What it basically says is, don’t link the „conf“ folder, but link traccar.xml only instead! The following instruction should work, but I haven’t tested it. As I’m travelling these days, I can’t fully update this instruction!
There are two configuration files. Upload them via Synology FileStation to
- default.xml : Use the file provided with the installer package from Traccar.org or download it from Github: https://github.com/traccar/traccar/blob/master/setup/default.xml. This file should not be edited by you unless you know what you do!
- traccar.xml : Here is my example, you need to edit it according to your needs!
Best is to start with this section, leave the rest for later tuning:
<!-- Using a MYSQL Database on Host Synology -->
<!-- Essential: If Network was host then one can attach Synology's -->
<!-- MariaDB directly using Synology's IP along with MariaDB 10 Port 3307 -->
Morde details: https://www.traccar.org/configuration-file/
Pull Docker image
If you are familiar with how to pull an image, simply pull these and skip to create container.
Port Settings as well as Links and Environment leave untouched.
Click Apply and the container is built and should start. Details see in Docker’s Container section.
As soon as the container is running, you can log in using your webbrowser: http://localhost:8082 where localhost is your Synology’s internal IP.
In my case: http://192.168.178.70:8082
Using a tracker
There is a variety of trackers that are supported by traccar https://www.traccar.org/devices/
I’m using an Inkutex TK5000 and the Traccar Client on my mobile.
See the port numbers per device / protocol.
Make sure the devices port don’t overlap to any of your Synology’s service ports!
Router & Reverse Proxy
- Router: Do port forwarding according to the tracker you will use. If you use the mobile app Traccar Client, then forward port 5055 TCP and UDP (always TCP and UDP).
- If you want to use the mobile app „Traccar Manager“ or you want to access your traccar server from abroad, you need to setup a Reverse proxy.
Go to Synology „Control Panel“ -> „Login Portal“ -> „Advanced“ -> „Reverse Proxy“
- Provide name
- Select https
- provide your Synology’s DynDns address or better an own for traccar
- select 433 for https
- Enable HSTS to route http to https
- traccar operates on http
- Synology’s local IP
- Traccars Webserver port 8082
Don’t forget to Reverse Proxy Websocket: