How to Create Your Own GPS Tracker with Ulogger in Linux

A photograph of a person looking at a digital map while trekking.

Ulogger is a lightweight GPS tracking server for Linux with a dedicated mobile app. This article will show you how to install Ulogger on an Ubuntu 24.04 server and link it to an Android phone.

Why Track GPS Data with Ulogger?

One of the biggest selling points of Ulogger GPS tracker is that you can host it directly on your Linux system. This allows you to log your geolocation tracks without the risk of bad actors snooping around your data.

A screenshot of ulogger's default interface.

Another advantage of Ulogger is that it can import and export standard geolocation file formats such as KML and GPX. This is an invaluable feature if you’re using an existing GPS solution and want to migrate your data to Ulogger.

Lastly, Ulogger is free and open-source software. This means that anyone can access the program’s source code, making vulnerabilities easier to detect and fix. As a result, Ulogger can be a more resilient option if you’re looking for a long-term GPS logging server for Linux.

FYI: learn how GPS technology works in simple terms.

Obtaining the Dependencies for Ulogger

Assumption: This article assumes that you’re installing Ulogger on an Ubuntu 24.04 VPS with 2GB of RAM and that you currently own a domain name.

The first step in installing Ulogger is to obtain the dependencies for Docker. To do that, import the signing key for the Docker project’s repository:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Create a new repository file for the Docker project using your favorite text editor:

sudo nano /etc/apt/sources.list.d/docker.list

Paste the following line of code inside your new repository file:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable

Refresh your machine’s repository listings and update every current package in the system:

sudo apt update && sudo apt upgrade

Make sure that the “core” Snap package is running on your server:

sudo snap install core

Install the Certbot package from the Electronic Frontier Foundation:

sudo snap install certbot --classic

Install Docker, Docker Compose, and the dependencies for deploying Ulogger:

sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin nginx unzip git

Building and Installing Ulogger

Create a new folder in your home directory, then enter it:

mkdir ~/ulogger && cd ~/ulogger

Pull the latest version of Ulogger from the developer’s Github repository:

git clone https://github.com/bfabiszewski/ulogger-server.git
cd ./ulogger-server

Switch to the latest stable branch of the program:

git checkout -b v1.2 tags/v1.2

Open the Ulogger Dockerfile using your favorite text editor:

nano ./Dockerfile

Find the lines that contain “DB_ROOT_PASS” and “DB_USER_PASS” then replace their values with two random strings of text.

A terminal highlighting the two random password for the ulogger server's database.

Note: you can generate your own random text by running the following command: cat /dev/urandom | tr -dc 'A-Za-z0-9' | fold -w 32 | head -n 1.

Save your Dockerfile, then create a “docker-compose.yml” file using your favorite text editor:

nano ./docker-compose.yml

Paste the following block of code inside your compose file:

services:
  ulogger:
    container_name: ulogger-instance
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 8080:80

Save your docker-compose.yml file, then run the following command to start your Ulogger Docker container:

sudo docker compose up -d

Check if Ulogger is running properly by listing the running containers in the system:

sudo docker ps
A terminal highlighting the running ulogger-server Docker container.

Setting Up an SSL Reverse Proxy Using Nginx

At this point, you now have Ulogger server running at port 8080. However, to access it you need to create a secure proxy for incoming connections using Nginx.

Start by creating a new “A” record on your domain pointing to the IP address of your Ulogger machine.

A screenshot showing the DNS A record for the ulogger server.

Go back to your server, then create a site configuration file for your Ulogger instance:

sudo nano /etc/nginx/sites-available/ulogger

Paste the following block of code inside your new config file:

server {
 
        server_name SUBDOMAIN.YOUR-ROOT.DOMAIN;
 
        location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_http_version 1.1;
                proxy_redirect off;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
        }
}

Replace the value of the “server_name” variable with your domain name.

A terminal highlighting the server_name variable on the Nginx site config file for ulogger.

Save your Nginx site config file, then create a symbolic link to it on Nginx’s “sites-enabled” directory:

sudo ln -s /etc/nginx/sites-available/ulogger /etc/nginx/sites-enabled/

Enable and start the Nginx service in your machine:

sudo systemctl enable --now nginx.service

Register your Ubuntu server to the EFF:

sudo certbot register --agree-tos -m YOUR@EMAIL.ADDRESS

Type “y”, then press Enter.

A terminal highlighting the prompt for the Certbot newsletter registration.

Get a new SSL certificate for your Ulogger domain name from the EFF:

sudo certbot --nginx -d SUBDOMAIN.YOUR-ROOT.DOMAIN

Good to know: learn how you can protect your online identity by creating an email aliases server using SimpleLogin.

Running Ulogger for the First Time

Test if your Ulogger instance is working properly by navigating to your subdomain using your web browser.

A screenshot showing the ulogger login screen.

Type “admin” on both the Username and Password fields, then press Enter to login.

Click your account’s name on the page’s upper right corner, then select Change password.

A screenshot showing the location of the "Change password" prompt inside ulogger.

Type “admin” under the Old password textbox, then provide a new password for your instance.

A screenshot showing the ulogger server's password prompt window.

Click Submit to commit your changes, then test it by logging out of Ulogger and logging back in.

Good to know: learn how to optimize your vacation prep by looking at some of the best travel-oriented tools for Linux.

Linking Your Ulogger Server with Android

To actively log your GPS tracks, you need to first obtain the Ulogger’s dedicated mobile app. At the moment, you can only get this program from the F-Droid Store.

A screenshot showing the ulogger GPS client for Android.

Open the Ulogger Android app, then click the gear icon on the app’s upper right corner.

A screenshot highlighting the gear icon on ulogger's mobile app.

Tap the Location provider option, then select Network and GPS from the radio button menu.

A screenshot highlighting the "Network and GPS" option for ulogger's geolocation data source.

Select the User name option, then type “admin” on the text box.

Tap the Password option, then provide the password that you’ve set for your admin account.

Select the Server URL option, then provide the whole base URL for your Ulogger server. In my case, it’s “https://gps.myvpsserver.top.”

A screenshot showing the account and server details of the ulogger backend.

Toggle the Live synchronization switch above the server details category. This will allow your Android phone to automatically send GPS data to your ulogger backend.

Go back to the mobile app’s main screen, then tap the New Track button.

A screenshot highlighting the "New Track" option on the ulogger mobile app.

Toggle the Tracking switch to start logging your GPS data to your ulogger server.

A screenshot highlighting the "Tracking" switch for the ulogger mobile app.

Confirm that Ulogger is properly tracking your GPS data by going to your admin account.

Hosting your GPS tracking server and client with Ulogger is just one way to keep track of your geolocation logs today. Learn how you can track your location even without an internet connection by checking out some of the best offline GPS apps for Android.

Image credit: Antonio Groß via Unsplash and Ulogger Github. All alterations and screenshots by Ramces Red.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Ramces Red
Ramces Red - Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.