Install Traccar on DigitalOcean VPS

Use following link to register DigitalOcean account and receive $10 credit:

You can use commands below to install Traccar on any Ubuntu server. It can be any VPS provider or even a local server.


Update repository

apt-get update

Install Java and MySQL server

apt-get install unzip default-jre mysql-server

If you were not asked for MySQL password during installation process, run following command

mysql -u root -p --execute="GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;"

Create "traccar" database (use password from previous step)

echo "create database traccar" | mysql -u root -p

Download Traccar package for Linux


Un-zip package

unzip traccar-linux-*.zip

Install Traccar service


Create config file

nano traccar.xml

Example configuration (replace password if needed)

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM ''>


    <entry key="config.default">./conf/default.xml</entry>

    <entry key='web.port'>80</entry>

    <entry key='geocoder.enable'>false</entry>

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>root</entry>
    <entry key='database.password'>root</entry>
    <entry key='server.timeout'>120</entry>


Replace default config file

cp traccar.xml /opt/traccar/conf/

Remove installer

rm -f README.txt traccar-linux-*.zip

Configure cron job to clear old logs daily (optional step)

printf '#!/bin/sh\nfind /opt/traccar/logs/ -mtime +5 -type f -delete\n' > /etc/cron.daily/traccar-clear-logs && chmod +x /etc/cron.daily/traccar-clear-logs

Start service (see Linux instructions for up to date commands)


Check that service started correctly

tail -f /opt/traccar/logs/wrapper.log.*