Overview

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.

You are here because you want to install Traccar on a Synology Plus Series in a way that Tracar ports do not overlay any ports used by Synology.

Your prerequisites

  • 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.
  • Knowledge of how to SSH into your Synology and perform basic tasks in Linux.
  • 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.
  • Very supportive is having Portainer installed on Synology Docker. This is part of this instruction but is not an operating requirement.

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/

The system we install in this instruction currently of 3 containers, one for the database, one for database management and one for traccar itself.

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.

Deploy Traccar

  1. Create the folder structure
  2. Create a Docker network
  3. Pull images
  4. Create container

Create folder structure

In Synology folder /volume1/docker make your workspace for the container data and configuration files.

  • /volume1/docker/traccar
  • /volume1/docker/traccar/db
  • /volume1/docker/traccar/traccar
  • /volume1/docker/traccar/traccar/conf
  • /volume1/docker/traccar/traccar/logs

Create / edit configuration file

20. August 2022:
With traccar version >5, before you move on, read this post carefully:
https://www.traccar.org/forums/topic/web-gui-404-not-found-from-one-day-to-another/page/3/

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
docker/traccar/traccar/conf

Best is to start with this section, leave the rest for later tuning:

change

  • your_ip to your Synology’s IP e.g. 192.168.178.60
  • yourpassword to the password you later will provide when MariaDB is being set up

Morde details: https://www.traccar.org/configuration-file/

Create a network

To separate and link our container we do need a special network.

Create a network – provide a name for it.

Pull images

If you are familiar with how to pull an image, simply pull these and skip to create container.

  • yobasystems/alpine-mariadb:latest
  • phpmyadmin:latest
  • traccar/traccar:alpine

MariaDB

Let’s get the MariaDB first and use it as an example for the other two images.

Define the image you want to pull
Define „latest“

as soon as you click „add“, you should see the file being downloaded in Docker -> Image.

phpMyadmin

Use Hub Page „phpmyadmin“ and Tag „latest“

Traccar

use „traccar/traccar“
and Tag „alpine“

Create Container

Make sure you have created the folder as described.

Create MariaDB

Select „yobasystems/alpine-mariadb:latest“ , next click „Launch“
Prove a name to your container (e.g. „mariadb“)
Select „Advanced Settings“
Map your local folder to the containers internal folder.
Goto Network next.
Attach your container to your previously built. Traccar network.
It is essential to map the port out of Synonology’s port ranges. Synology’s MariaDB uses 3306 already.
Remove the container from the standard bridge.

Skip „Links“

Provide your „MasterPassword“ MYSQL_ROOT_PASSWORD and you traccar Database password.
Note them, you need them again later!

Press Apply, then Next

Check your settings and correct if necessary.
Press done to create the container.
the container is now running
Having a look at your „File Station“ you see that mariadb has set up some basics and has established our traccar database.

phpMyadmin

I’m not documenting all steps. What you need:

  • Launch phpmyadmin:latest
  • Click Advanced Settings
  • Advanced Settings tab: Skip
  • Volume tab: Skip
  • Network tab: Attach to „Traccar _Net“, delete „bridge“
  • Port Settings tab: To start phpMayadmin wee need a port. Define yours, leave the container port untouched (I’m using 8283/80).
  • Links tab: Skip
  • Environment tab:
  • Change UPLOAD_LIMIT to 8G . Why? Over time your database will grow. The default value is by far to small for any Database restore activities.
  • PMA_PASSWORD – your traccar database password set when having set up mariadb.
  • PMA_USER – traccar
  • PMA_PORT – 3306 (YES 3306 NOT 33306)
  • PMA_HOST – mariadb .
    The name of the mariadb container. If yours has another name – use that.

As soon as the container is running, you can log in using your webbrowser: http://localhost:Container_Port where localhost is your Synology’s internal IP and Container_Port is the Port address you provided earlier.
In my case: http://192.168.58.70:8283

Traccar

Again, I’m not describing picture by picture. Simply follow the logic provided for MariaDB.

Now: You need to have a basic understanding of the ports you plan to use. Before you proceed, know what port / protocol your tracker uses: https://www.traccar.org/devices/

If using the App on your mobile as a tracker: It is using the OsmAnd protocol on Port 5055.

Why is this essential to know now? Synology is using the same range of ports – so we can’t use them and we need to map them to a different area. I choose to map 5055 to 55055.

My example:

Container configuration parameter:

  • Launch traccar/traccar:alpine
  • name: traccar
  • click Advanced Settings
  • Advanced Settings tab: Skip.
  • Volume tab: Add Folder:
    docker/traccar/traccar/logs – /opt/traccar/logs
    docker/traccar/traccar/conf – /opt/traccar/conf
  • Network tab: Add to Traccar_Net, delete from bridge
  • Port settings tab: Add following:
    • The standard port to access the webinterface is 8082. You can (not must) map it to somewhere else. I’m using
      Local port 8284 Container port 8082
    • Now add ports for the tracker. Don’t forget to map them twice: TCP and UDP. Example:
      55055 – 5055 – TCP
      55055 – 5055 – UDP
  • Links Tab: Skip
  • Environment tab: Skip

Ramping up

Starting the container

In Docker Container you can now start:

  1. mariadb
  2. In case you need to manage your data: phpmyadmin
  3. traccar

Login

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“
  1. Provide name
  2. Select https
  3. provide your Synology’s DynDns address or better an own for traccar
  4. select 433 for https
  5. Enable HSTS to route http to https
  6. traccar operates on http
  7. Synology’s local IP
  8. Traccars Webserver port 8082