Introduction - Turn a Raspberry Pi Into a GPS Tracking Server

Introduction: Introduction - Turn a Raspberry Pi Into a GPS Tracking Server

About: GPS Tinkerer and lover of dogs.

In this guide I will show you how to install Traccar GPS tracking software onto a Raspberry Pi which will receive data from compatible devices over the internet, logging their positions onto a map for real time tracking, and also tracking playback.

Traccar is a free and open source GPS Tracking Software which is currently used in many different applications, in many different companies since it's inception around for 8+ years

Raspberry Pi is an ideal device for people who want to track a minimal number of devices and need a cheap server to perform that duty.

A GPS tracker that will work with Traccar ranges from a dedicated device that wires into your vehicles electrical system, such as a tracker for car, to as simple as downloading an app onto an iPhone or Android, such as a personal tracker.

Software Notes:

  • Traccar Version: traccar-linux-64-4.8 (alternatively you can use the ARM version of traccar.)
  • Raspberry Pi Version: Linux raspberry 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux

Raspberry Pi System Requirements:

  • Java installed (JRE is sufficient, SDK is ok too), The program needs java executable, so you can try to enter java --version to check if java is installed on your pi (Already installed on Raspberry Pi 4.19.0-9)
  • wget installed (to download the zip file, you do not need it if you copy it with other tools) (Already installed on Raspberry Pi 4.19.0-9)
  • unzip installed (to unzip the zip file, you do not need it if you unzip the content with other toots) (Already installed on Raspberry Pi 4.19.0-9)

Supplies

Raspberry Pi

Step 1: SSH Into Your Raspberry Pi

(Raspberry Pi SSH access is disabled by default)

Instructions for enabling SSH can be found here: https://www.raspberrypi.org/documentation/remote-access/ssh/

Step 2: Create the /opt/traccar Directory

This is the directory where the software will be installed to.

sudo mkdir /opt/traccar

Step 3: Change Into the /opt/traccar Directory

Change into the /opt/traccar directory as it will be easier to work where the files are located.

cd /opt/traccar

Step 4: Download Traccar Installer Files

Download the latest Traccar server .zip file from traccar.org/downloads

Currently, 4.8 is the latest version (Feb 2020 release).

sudo wget https://github.com/traccar/traccar/releases/download/v4.8/traccar-linux-64-4.8.zip

Step 5: Check File Integrity

Perform an md5 checksum to ensure your file is not corrupted.

md5sum traccar-linux-64-4.8.zip

The md5sum result for version md5sum traccar-linux-64-4.8.zip should be

4993f55e16a62e0e025533a2b0e33e68

Nb. The md5sum results will be different if you are installing a different version of traccar from what I have shown.

Step 6: Extract the Traccar .zip File Contents to Your Working Directory

Extract the contents of the traccar-linux-64-4.8.zip file using unzip. Raspberry Pi has unzip installed by default.

sudo unzip traccar-linux-64-4.8.zip

Step 7: Clean Up After Yourself

Delete the no longer required traccar-linux-64-4.8.zip file using remove.

sudo rm traccar-linux-64-4.8.zip

Step 8: Run Traccar Run

At this point you can proceed to install/run Traccar.

sudo ./traccar.run

Pay close attention to the output when installing. Take note of any error messages that may appear.

A successful install should look as pictured.

Step 9: Start Traccar

Start the Traccar service with system ctl

sudo systemctl start traccar.service

Step 10: Check Logs for Errors

Using tail with the follow switch & lines set to 300, observe and monitor the Traccar logs for error entries.

tail -f -n 300 /opt/traccar/logs/tracker-server.log

Step 11: Check the Web Portal

Open a web browser to check the system is online.

From your Raspberry Pi Web Browser
http://localhost:8082/

From your Computer on the same network.
http://:8082/>:8082/

If successful, you should see the login screen and be able to log in as the below user:
Email: admin
Password: admin

Step 12:

List of Supported Devices:
https://www.traccar.org/devices/

Links to some GPS trackers:
2G GPS Tracker
3G/4G GPS Tracker
4G GPS Tracker

Other handy links:
GPS Tracker Types

Be the First to Share

    Recommendations

    • Micro:bit Contest

      Micro:bit Contest
    • Tinkercad Student Design Contest

      Tinkercad Student Design Contest
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge

    4 Comments

    0
    Raoul van Noorden
    Raoul van Noorden

    Question 7 months ago on Step 8

    Dear Richard,
    I have installed the traccar server on an old PC. I installed linux and downloaded traccar and everything works fine.
    However considering the power consumption of my old PC I have bought a Raspberry Pi 4 and installed Linux and traccar on it.
    Up till inclusive the above step 8 all works well.
    I have a Raspberry Pi 4, 8Gb with a 32 Gb sd card. The linux installed on the RPI is Ubuntu Desktop 20.10 64b
    I have tried with the downloads traccar-linux-arm-4.12 and with traccar-linux-64-4.12.
    After: "sudo systemctl start traccar" nothing happens. I have tried http://localhost:8082 but no connection is established to the traccar server. I have done the port forwarding steps in the router to the IP address of the Raspberry.
    I have the idea that I cannot get the traccar server running one way or the other.
    At least when I try the traccar Port Check to port 8082 I get the message that the port is closed.
    Do you have any suggestions how to solve this problem?
    Is it a port problem or is the traccar server not running?
    Kind regards, Raoul

    0
    richard.geronimo89
    richard.geronimo89

    Answer 7 months ago

    Hi Raoul, can you confirm that traccar is running & accepting connections on the raspberry pi by performing the the commands whilst logged into the raspberry pi

    Check for traccar service
    > ps aux | grep traccar

    If service is running, check you can telnet into the port to see if traccar is accepting connections (might need to install telnet.. found a link for that)
    https://bytesofgigabytes.com/networking/raspberry-pi-telnet/
    > telnet localhost 8082


    0
    greg.a.brown79
    greg.a.brown79

    8 months ago on Step 11

    Great write up - I think you made an error with connecting to localhost

    From your Computer on the same network.
    http://:8082/>:8082/>

    should be:
    From your Computer on the same network.
    http://localhost:8082/