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
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
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.
Replace the string 'secret' on the variable 'DATABASE_URL' with your second random string.
Scroll down to the 'POSTGRES_PASSWORD' variable and replace the 'secret' value with your second random string.
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
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",
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",
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" ]
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
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.
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.
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")
Type 'exit' , then press Enter to exit the database handler.
Press Ctrl + D to leave the Docker container's root shell.
Test your new account by opening Ontrack in your web browser and logging in to your account.
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 .
Provide the category name, tag color, and whether the category has spending limits.
Click Add an expense on the Ontrack Dashboard.
Fill in your expense details, then click Save to transfer it to your Ontrack instance.
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.
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.