How to Setup OpenGTS GPS Tracking System on Linux

Hello everybody, today we are going to show you the installation and configuration steps to use OpenGTS that is well known as Open GPS Tracking System. OpenGTS is the only open source and web-based GPS tracking system which is being widely used in different countries for tracking their different devices. OpenGTS can be operated in any specific GPS tracking device or the protocol that supports it like OpenDMTP (Open Source Device Monitoring and Tracking Protocol). It has a number of features like the customization of its web pages, reports, and mapping services.

OpenGTS is fully written in Java and should run fine on any system that fully supports private JVM environment and an SQL database server (like MySQL).


In this article, we will be installing the Open GPS Tracking System on Ubuntu/CentOS. We are using the Ubuntu server 20.04 in our test environment. There are a number of its prerequisites that we will have to setup first before the OpenGTS installation.

1) System Update

Login to your ubuntu/centos server using the root or sudo credentials to update your system using the below commands receptively.

On Ubuntu Linux

# apt-get update

On CentOS

# yum update

2) LAMP Setup

As we mentioned earlier that OpenGTS is a web-based application, that's why we will set up the LAMP stack as a prerequisite of OpenGTS. We will be using the Apache Web server and MySQL database in our LAMP stack. Let's run the below commands to install the required packages.

For Ubuntu:

# sudo apt-get install apache2 php wget curl unzip ant

Download mysql 5.7 and install it. ( mysql 5.X version is recommended )

# wget
# sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

Now, Select Ubuntu Bionic > By default it shows MySQL 8.0, Click on First option > Select MySQL 5.7 server and click on OK. > Confirm that showing MySQL 5.7 on First option and Click on OK.

Update apt repository and use apt-cache to find the mysql version and install according to it.

# sudo apt-get update
# sudo apt-cache policy mysql-server
# sudo apt install -f mysql-client=5.7.32-1ubuntu18.04 mysql-community-server=5.7.32-1ubuntu18.04 mysql-server=5.7.31-1ubuntu18.04

For CentOS:

# yum install httpd php wget curl yum-utils unzip ant epel-release

To install mysql 5.X use:

# wget 
# rpm -ivh mysql-community-release-el5-7.noarch.rpm
# yum install mysql mysql-server -y

While in CentOS you can run the below command to setup the root password.

# mysql_secure_installation

To start mysql and apache services on your ubuntu or centos server you can use the below commands.

For Ubuntu

# systemctl start mysql
# systemctl start apache2

For CentOS

# systemctl start mysqld
# systemctl start httpd

3) JAVA Setup

To setup the JAVA environment we will be using the JAVA OpenJDK version 8 and then configure its environment using the below commands.

For Ubuntu/centOS:

# apt-get install openjdk-8-jdk

When the installation is complete setup the JAVA_HOME environment variables using the below commands.

# export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
# echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> ~/.bashrc

4) Tomcat Setup

To install and configure the Tomcat setup follow the link to Download Tomcat, then copy the linked URL and download it using the wget command on the server.

# wget -c

Tomcat download

Run the command below to extract the above downloaded zipped package.

# unzip

Now copy the package into the '/usr/local/' directory from the current directory.

root@open-gts:~# cp -a apache-tomcat-7.0.106 /usr/local/

By using the below commands we will setup the CATALINA_HOME environment for the tomcat.

# export CATALINA_HOME=/usr/local/apache-tomcat-7.0.106/
# cd /usr/local
# ln -s $CATALINA_HOME tomcat
# chmod a+x *.sh

Catalina Env

When the Catalina Home environment has been setup, run the command as shown below to start tomcat.

# echo "export CATALINA_HOME=/usr/local/apache-tomcat-7.0.106" >> ~/.bashrc

Stating Tomcat

5) Setup JAVA Connector

To setup the JAVA connector, there's as mysql java connector package is available that we can download.

Download the connector package using the below wget command.

# wget -c

Then extract the zipped package and copy its files into the 'ext' directory of the JAVA_HOME by using the below commands.

# unzip
# cd mysql-connector-java-5.1.37/
# cp mysql-connector-java-5.1.37-bin.jar $JAVA_HOME/jre/lib/ext

JAVA Mail Setup

To install the Java mail setup, we can download the latest Jar repository.

Copy the link address and download it using the wget command in the command-line interface.

# wget -c

Java Mail

Copy this Jar repository into the '/ext/' directoy and then change its name using the commands as shown below.

# cp javax.mail-1.5.2.jar $JAVA_HOME/jre/lib/ext/
# mv $JAVA_HOME/jre/lib/ext/javax.mail-1.5.2.jar $JAVA_HOME/jre/lib/ext/javax.mail.jar

Installing OpenGTS

We are ready to go with the installation of the OpenGTS Tracking System. We will be using the curl command to get the latest available package of OpenGTS.

# curl -L >

download OpenGTS

Then extract the OpenGTS package into the '/usr/local/' directory using below command.

# unzip -d /usr/local

Its recommended to run the OpenGTS with a general user, for this purpose we will run the below command to change the ownership.

# chown -R gts:sudo /usr/local/OpenGTS_2.6.0/

Then export the environment variables to set the OpenGTS home environment.

# export GTS_HOME=/usr/local/OpenGTS_2.6.0/
# echo "export GTS_HOME=/usr/local/OpenGTS_2.6.0" >> ~/.bashrc

1) Setup Environment

To setup the environment variables with ANT and creating the symbolic link, run the following commands.

# echo "export ANT_HOME=/usr/share/ant" >> ~/.bashrc
# source ~/.bashrc
# ln -s $JAVA_HOME /usr/local/java
# ln -s $CATALINA_HOME /usr/local/tomcat
# ln -s $GTS_HOME /usr/local/gts

2) OpenGTS Configurations

Open the default configuration file of OpenGTS to configure some of its basic parameters. To so do use the following command and uncomment the below mentioned line in the configuration file.

# vim $GTS_HOME/config.conf

OpenGTS Conf

Save the configuration file changes, and then list the CATALINA_HOME folder to check if it linked to its folder or not.


Catalina Home Link

In case if it's pointing to itself then you can run the command below unlink it.

# unlink /usr/local/apache-tomcat-7.0.106/apache-tomcat-7.0.106

3) OpenGTS Compilation

Finally, we are ready to compile the OpenGTS, to do first change directory to the GTS-HOME, and then run the command to compile it with 'ant all' command as shown.

# cd $GTS_HOME
root@open-gts:/usr/local/OpenGTS_2.6.0# ant all

The compilation process will take a while to compile all the required data.

OpenGTS Compilation

4) OpenGTS Initialization

To initialize the OpenGTS database, we will be using the below command to by providing the root credentials of our database.

root@open-gts:/usr/local/OpenGTS_2.6.0# bin/ -rootUser=root -rootPass=******

This is creating the new database with name and user 'gts' and grant him the privileges as shown below.

Version: 2.6.0
Database created: gts
Privileges granted to user: gts

Validating table columns ...
Table 'Account' --- Creating table ...
Table 'AccountString' --- Creating table ...
Table 'User' --- Creating table ...
Table 'UserAcl' --- Creating table ...
Table 'GroupList' --- Creating table ...
Table 'Device' --- Creating table ...
Table 'Transport' --- Creating table ...
Table 'UniqueXID' --- Creating table ...
Table 'DeviceGroup' --- Creating table ...
Table 'DeviceList' --- Creating table ...
Table 'Driver' --- Creating table ...
Table 'EventData' --- Creating table ...
Table 'Geozone' --- Creating table ...
Table 'Resource' --- Creating table ...
Table 'Role' --- Creating table ...
Table 'RoleAcl' --- Creating table ...
Table 'StatusCode' --- Creating table ...
Table 'SystemProps' --- Creating table ...
Table 'EventTemplate' --- Creating table ...
Table 'PendingPacket' --- Creating table ...
Table 'Property' --- Creating table ...
Table 'Diagnostic' --- Creating table ...
Column validation completed successfully.

Updating GTS Version: 2.6.0
Updating DMTP Version: 1.3.6

5) Testing Installation

To test the installation of OpenGTS run the below command with the home directory of GTS_HOME as shown below.

root@open-gts:/usr/local/OpenGTS_2.6.0# bin/

After executing the above command you might see some errors, warnings, and recommendations that you can figure them out.

6) Creating New Account

To create the new admin account run the below command by mentioning your account name and password.

root@open-gts:/usr/local/OpenGTS_2.6.0# bin/ Account -account=sysadmin -pass=****** -create
Entry Point: org.opengts.db.tables.Account
Created Account-ID: sysadmin

7) Install Track Java Servlet

To install the Track Java Servelet followed by copying its webapp, use the below commands.

root@open-gts:/usr/local/OpenGTS_2.6.0# ant track
root@open-gts:/usr/local/OpenGTS_2.6.0# cp build/track.war $CATALINA_HOME/webapps/

Track Java servlet

Open OpenGTS Web Interface

Open your web browser and give the below URL to access the web interface on OpenGTS GPS Tracking system to start tracking your devices.


OpenGTS Web

In case if you unable to login using your credentials, then stop the Tomcat services and then restart it again using the below commands.

# rm -rf $CATALINA_HOME/webapps/track*
# cp $GTS_HOME/build/track.war $CATALINA_HOME/webapps/

Welcome to OpenGTS GPS Tracking

We have successfully setup OpenGTS, by using its web console now you can easily manage and track vehicles.

OpenGTS Server Admin


In this article, you have learned the installation and configuration of OpenGTS Open GPS Tricking system including all of its required dependencies on Ubuntu. Hope you under each and every step that we performed in the article. Leave your valuable comments or suggestions if you face any issue or your recommendations.

19 Comments... add one

    • Hi I'm struggling setting this up I only can install tomcat 7.0.69 therefore when i install ant Track its looking for version 7.0.55 what do I need to change please help.

  1. Hello

    Could you please help me?

    am new in centos 7, I have problems trying to install php5, mysql-server and libmysql-java
    No existe disponible ningún paquete php5.
    No existe disponible ningún paquete mysql-server.
    No existe disponible ningún paquete libmysql-java.

  2. thanks, some little problem when it is the first installation with a java application and tomcat. In my case, I had to copy manually the war files. I had firs tried with an apt-get install tomcat7, and it never worked. Hopefully, the manually installed version of tomcat is working

      • I figured it out. Had to use google to find the new url for tomcat.
        One thing that might be of use to other is including the step to build gprmc.war and copying it to the webapps folder.

  3. Hello, I followed the instructions exactly. Everything worked. After installing I only see
    HTTP status 404 - / track / track
    Can u help me?

  4. Failing at OpenGTS Initialization stop "bin/", with the following error:
    ...jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.

    I've kept everything at same version except these => Ubuntu 20.04, MySQL-8.0.2
    The database connection works fine from the shell.

    Any suggestion or direction on the problem would be of great help.
    Thank You.


Leave a Comment