Published on Oct 22 2016 in Java Tomcat

Traccar can run on shared server (cPanel) standalone or in pair with OpenGTS. You need a few modifications to have it running.

Download and unpack the software. When trying to start installer on a server without root access we will get Permission denied'

wget https://github.com/tananaev/traccar/releases/download/v3.3/traccar-linux-64-3.3.zip
unzip traccar-linux-64-3.3.zip
bash traccar.run
Verifying archive integrity... All good.
Uncompressing traccar  100%
traccar.run: line 488: ./setup.sh: Permission denied

On shared server you will not be able to extraxt traccar to hardcoded /opt/traccar. You will need to modify the destination path and also the default HTTP port.

./traccar.run --keep --noexec --target traccar
Creating directory traccar
Verifying archive integrity... All good.
Uncompressing traccar  100%

Optionally modify UNIX_PATH in setup.sh to use traccar directory in your home directory (this step is not really needed as setup.sh only tries to make traccar autostarting on server boot).

sed -i 's/UNIX_PATH="\/opt/UNIX_PATH="~/' ~/traccar/setup.sh

Update paths to your own home directory in XML config file:

sed -i "s#\/opt\/traccar#$HOME\/traccar#g" ~/traccar/conf/traccar.xml

Update HTTP port to a custom one assigned by your hosting provider (11111 in this example):

sed -i 's/>8082</>11111</' ~/traccar/conf/traccar.xml

Modify bin/traccar by adding return 0; under mustBeRootOrExit() { and installdaemon() {

sed -i -e '/mustBeRootOrExit() {/a return 0;' -e '/installdaemon() {/a return 0;' ~/traccar/bin/traccar

This way you skip installation of startup script in its default location that is impossible on shared server anyway.

You can now start traccar with:

cd ~/traccar/bin/
./traccar start
Starting traccar...
Waiting for traccar......
running: PID:632085

Notes:

References:

https://www.traccar.org/devices/ https://www.traccar.org/opengts/ https://github.com/tananaev/traccar/issues/1389