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.

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.

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.
  • 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.

Deploy Traccar

  1. Create the folder structure
  2. Pull image
  3. 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

Prepare Database

You must have installed on your Synology:

  • MariaDB 10 (With DSM 7 this is the only option).
  • phpMyadmin

Start phpMyadmin and add a new User and an empty database that traccar can use.

Create / edit configuration file

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!

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:

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

Starting with DSM 7:

Things went easier now. You only have to Create a project in your container manager:

  1. Open Container Manager
  2. Click Project
  3. Select Create
  4. Give the project a name
  5. Selekt the path you have created before. For example: /docker/traccar
  6. Select create a docker compose
  7. Cut & paste the content provided in the next step into the fields.

Finally press „weiter“ and your container will be created.

The compose.yaml

copy the following code into the entry-field when creating the project:

Now you can move to Login


Manual way:

Pull Docker image

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

  • traccar/traccar:alpine

Using DSM

Create Container

Make sure you have created the folder as described. Same with the empty database!

Launch image, give name to container, click Advanced Settings.
Map the pathes from container to physical path
/opt/traccar/conf
/opt/traccar/logs
This is essential:

Our container should work on Synolog’s host network. This makes sure traccar can attach to Synology’s MariaDb.

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.


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

Don’t forget to Reverse Proxy Websocket:

Set Reverse Proxy Websocket.
Done!