How to install OnTrack software on Linux

Ontrack is a simple yet powerful self-hosted budgeting software for Linux. It works by creating a beautiful interface where you can list your budget, review your finances, and even track your spending history. This article shows you how to install Ontrack on Ubuntu Linux 22.04 using Docker Compose and Caddy.

Get the dependencies for Ontrack

The first step in installing Ontrack budgeting software on Linux is to download Docker and Caddy. Docker will run the entire web application in an isolated container, while Caddy will let you broadcast it to the Internet.

To get started, find the signing key for the Docker repository from the developer's website:

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 new apt repository file for Docker:

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

Write the following line of code in your repository file:

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

Download the signing key for the Caddy project repository:

curl -fsSL 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

Fetch the Caddy project's repository file by running the following command:

curl -fsSL 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy.list

Apply your new repository and make sure your system is completely updated:

sudo apt update && sudo apt upgrade

Install Docker, Docker Compose and Caddy using apt:

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

Download Docker containers Ontrack

Fetch the current Ontrack repository for Linux from the developer's Github page:

git clone https://github.com/inoda/ontrack.git && cd ./ontrack

Run the following command 2 times to generate two random long text strings:

cat /dev/urandom | tr -dc 'A-Za-z0-9' | fold -w 32 | head -n 1 >> ~/random-pass.txt

How to install OnTrack software on Linux Picture 1

Open Ontrack's 'docker-compose.yml' file with your favorite text editor:

nano ./docker-compose.yml

Scroll to the variable 'SECRET_KEY_BASE' and change the value from 'super-secret' to your first random string.

How to install OnTrack software on Linux Picture 2

Replace the string 'secret' on the variable 'DATABASE_URL' with your second random string.

How to install OnTrack software on Linux Picture 3

Scroll down to the 'POSTGRES_PASSWORD' variable and replace the 'secret' value with your second random string.

How to install OnTrack software on Linux Picture 4

Updating and building Ontrack containers

Open the Dockerfile for Ontrack using your favorite text editor:

nano ./Dockerfile

Replace the value of the FROM variable with the following value:

FROM ruby:3.1.2-alpine

How to install OnTrack software on Linux Picture 5

Save your modified Dockerfile, then open the 'package.json' file:

nano ./package.json

Find the line that starts with @babel/preset-env , then insert the following code below that line:

"babel-plugin-macros": "^3.0.1",

How to install OnTrack software on Linux Picture 6

Scroll down to the 'devDependency' category , then add the following to the @babel/eslint-parser line :

"@babel/plugin-proposal-object-rest-spread": "^7.15.4",

How to install OnTrack software on Linux Picture 7

Open your instance configuration file with your favorite text editor:

nano ~/ontrack/config/environments/development.rb

Add the following line of code right below Rails.application.configure:

config.hosts = [ "SUBDOMAIN.YOUR-ROOT.DOMAIN" ]

How to install OnTrack software on Linux Picture 8

Save your instance configuration file, then run the following command to build both its Ontrack and Postgres databases:

sudo docker compose up --detach

Note : Ontrack Docker container building can take 5 to 10 minutes depending on your server resources. If your machine has less than 2GB RAM and no swap file, Docker will crash without reporting any errors on Terminal.

Confirm that Ontrack containers are running properly by listing all active Docker processes:

sudo docker ps

How to install OnTrack software on Linux Picture 9

Create SSL Reverse Proxy with Caddy

At this point, you have Ontrack budgeting software running on port 3000 of your machine. To access this software securely, you need to create an SSL Reverse Proxy that encrypts the connection between you and your server.

Go to your domain's DNS manager, then add a new 'A' record for your Ontrack instance.

How to install OnTrack software on Linux Picture 10

Backup the original Caddyfile, then create a new Caddyfile in '/etc/caddy/':

sudo mv /etc/caddy/Caddyfile ~/Caddyfile.backup sudo nano /etc/caddy/Caddyfile

Paste the following block of code into your new Caddyfile:

SUBDOMAIN.YOUR-ROOT.DOMAIN { reverse_proxy :3000 }

Save your new Caddyfile, then start the Caddy daemon to run your new reverse proxy:

sudo systemctl enable --now caddy.service

Test if your SSL Reverse Proxy is working by navigating to your URL.

How to install OnTrack software on Linux Picture 11

Use Ontrack and create a user account

Once Ontrack is up and running, you can now create your user account. To do this, return to the server's terminal window, then open the shell for the Ontrack container:

sudo docker exec -it ontrack sh

Open the database handler inside your Ontrack container:

bundle exec rails c

Create your new user account by running the following command:

User.create!(username: "YOUR-USERNAME", password: "YOUR-SECURE-PASSWORD")

How to install OnTrack software on Linux Picture 12

Type 'exit' , then press Enter to exit the database handler.

Press Ctrl + D to leave the Docker container's root shell.

How to install OnTrack software on Linux Picture 13

Test your new account by opening Ontrack in your web browser and logging in to your account.

Create your first trade on Ontrack

To use Ontrack to record transactions, you need to create an expense category. This allows the web app to collate your expenses by group, making it easy to deduce insights into your spending habits.

Scroll down to the Ontrack dashboard, then click Add a category .

How to install OnTrack software on Linux Picture 14

Provide the category name, tag color, and whether the category has spending limits.

How to install OnTrack software on Linux Picture 15

Click Add an expense on the Ontrack Dashboard.

How to install OnTrack software on Linux Picture 16

Fill in your expense details, then click Save to transfer it to your Ontrack instance.

How to install OnTrack software on Linux Picture 17

Finally, confirm that Ontrack successfully saved the transaction by checking your expense history. To do that, scroll up the page, then click the History link in the upper right corner of the page.

How to install OnTrack software on Linux Picture 18

Installing and implementing your own expense tracking software is just the first step to taking back control of your online and digital life. Learn how you can ensure your privacy when sending emails by installing an alias server like SimpleLogin.

5 ★ | 1 Vote

May be interested

  • How to run Windows applications on Linux with WineHow to run Windows applications on Linux with Wine
    there are a number of applications from windows that are needed but there are no alternatives on linux. fortunately, there is a software project that allows you to run windows applications on linux. this software is called wine. it creates a compatibility layer for windows programs to interact with the linux operating system.
  • Instructions for installing Windows software on Linux with PlayOnLinuxInstructions for installing Windows software on Linux with PlayOnLinux
    playonlinux provides a point and click interface (point and click) to automatically install and edit software on linux. it is like a package manager but for windows games and other applications on linux.
  • How to install and use Kali Linux on VmWare virtual machineHow to install and use Kali Linux on VmWare virtual machine
    until now, a famous linux distro, kali linux, has always been sought by security experts or hackers. why? simply because kali linux has a built-in range of tools for penetration, hacking, analysis, etc. all are categorized very clearly.
  • How to install dictionaries in Linux TerminalHow to install dictionaries in Linux Terminal
    a locally stored dictionary utility can really be useful when no other dictionary is available. there are many options in the linux software world. among these, there is an option that runs fairly 'smoothly' from the system terminal, called sdcv.
  • How to install Solus LinuxHow to install Solus Linux
    recently, the linux community has given winged compliments to solus linux. this is understandable because this is a beautiful operating system with lots of great features. in a world where most popular linux distributions are 'derivative ubuntu', solus linux really stands out.
  • Ways to install Microsoft Excel on LinuxWays to install Microsoft Excel on Linux
    converting from windows to linux is very simple, but there are a number of issues that are incompatible software. what if you want to use microsoft excel on linux? look at this article and find the answer!
  • How to Install Software in Debian LinuxHow to Install Software in Debian Linux
    this wikihow teaches you how to use tools built into debian linux to install software packages. if you're using the desktop version of debian, you can use synaptic to install application packages with a point-and-click graphical interface....
  • How to install Qt for GUI application development on LinuxHow to install Qt for GUI application development on Linux
    qt is a cross-platform application framework that allows developers to create and deploy software for multiple operating systems.
  • Instructions for installing Kali Linux on Windows 10 are easier than everInstructions for installing Kali Linux on Windows 10 are easier than ever
    you can download and install kali linux directly from the microsoft app store on windows 10 as easily as installing any other application. this is a guide to installing kali linux on windows 10, without usb boot, virtualization software at all.
  • 5 reasons to install Linux on old computers5 reasons to install Linux on old computers
    a lot of people like to use linux on older machines. everyone has a different reason. some people may want to save money by not upgrading to a new computer, while others may want to avoid wasting usable electronics.