Set up Firefly III Personal Finance Manager on Ubuntu 20.04 | 18.04

To
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
To

The
The

Have you always wanted to have a good understanding and control of your financial situation? Now you have the opportunity to track your finances and keep an eye on your funds without having to upload financial records to the cloud. The working principle of Firefly III is that if you know where the money is going, you can stop the money from going there. Now, you have understood what Firefly III is.

To be clear, “Firefly III” is your personal finance (self-hosted) manager. It can help you track expenses and income, so you can reduce expenses and save more. Firefly III supports the use of budget, categories and tags. It can import data from external sources and can provide many concise financial reports.

Firefly III Personal Finance Manager’s functions

  • Create regular transactions to manage your funds
  • Rule-based transaction processing, you can create your own rules
  • Import data from external systems
  • Double Entry Accounting System
  • Use a piggy bank to achieve goals
  • View income and expense reports
  • 2-factor authentication can enhance security🔒
  • Support any currency you want, including cryptocurrencies such as cryptoitcoin and Ξthereum
  • There is a Docker image and a Heroku script.
  • A clear view can show your work status
  • Browse records easily
  • Many charts because we all like them

Firefly III personal financial manager setup requirements

  • Installation lights | LEMP stack
  • PHP 7.3 and some modules
  • composer

“Opportunities rarely show up. When it rains gold, take out the bucket instead of the thimble”-Warren Buffett

Step 1: Update and upgrade the server

After entering the new Ubuntu server terminal, update and upgrade it and install the basic tools we will use.

sudo apt update && sudo apt upgrade
sudo apt install vim git nginx curl -y

Step 2: Install and set up LEMP Stack

As you might expect, Firefly III requires a web server, a database, and since it is written in PHP, we must also install it.

Install and configure web server and PHP

Here, you can choose Apache or Nginx. We will use Nginx in this guide. In addition, we will use PHP version 7.3 as needed.

Install php-fpm and dependencies

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php7.3 php7.3-{cli,zip,gd,fpm,json,common,mysql,zip,mbstring,curl,xml,bcmath,imap,ldap,intl}

Check if php-fpm is running.

$ sudo systemctl status php7.3-fpm
● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-07-13 13:27:53 EAT; 2min 12s ago
       Docs: man:php-fpm7.3(8)
    Process: 97804 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.3/fpm/pool.d/www.conf 73 (code=exi>   Main PID: 97791 (php-fpm7.3)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
      Tasks: 3 (limit: 1035)
     Memory: 10.7M
     CGroup: /system.slice/php7.3-fpm.service
             ├─97791 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
             ├─97802 php-fpm: pool www
             └─97803 php-fpm: pool www

Add recommended PHP settings

Open your php-fpm ini file and add/edit the details shown below. They include time zone and memory limit settings. Add your date.timezone (about line 955) and change the memory_limit (about line 400) to 512MB.

$ sudo vim /etc/php/7.3/fpm/php.ini
memory_limit = 512M

[Date]
date.timezone = Africa/Nairobi

Stop and disable Apache

When installing PHP in Ubuntu, Apache will drag. If you don’t want to use it, stop it and disable it.

sudo systemctl stop apache2
sudo systemctl disable apache2

Configure Nginx web server

We have to make some changes to the Nginx configuration defaults by adding the details required by Firefly. Change to enable the site, backup the default file and create a new file with the new configuration.

cd /etc/nginx/sites-enabled/
sudo mv default{,.bak}

Create a new file and add the details as shown below. If you have an FQDN, replace it with example.com.

$ sudo vim /etc/nginx/sites-enabled/firefly.conf

server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  example.com;
        root         /var/www/html/firefly-iii/public;
        index index.html index.htm index.php;

        location / {
                try_files $uri /index.php$is_args$args;
        }

        location ~ .php$ {
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_read_timeout 240;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_split_path_info ^(.+.php)(/.+)$;
        }
    }

After the configuration is complete, restart php-fpm and nginx

sudo systemctl restart nginx php7.3-fpm

Install and configure MariaDB database server

We will use MariaDB for this setup. Fortunately, we already have a detailed guide to install MariaDB 10.5. Check out how to install MariaDB 10 on Ubuntu

After installing the database, the next step is to create a database and user for Firefly III. So let’s proceed with this operation as shown below. You are free to use different names to name the database and user, and make sure to use a secure password.

$ mysql -u root -p

CREATE DATABASE firefly_database;
CREATE USER 'fireflyuser'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON firefly_database. * TO 'fireflyuser'@'localhost';
FLUSH PRIVILEGES;
exit;

It’s easy, and it’s amazing.

Step 3: Install PHP Composer

Composer must be installed to install Firefly’s dependencies. Do the following to set up the composer

cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Test whether composer is successfully installed by running the composer command

$ composer -V
Composer version 1.10.8 2020-06-24 21:23:30

Step 4: Install Firefly III on Ubuntu 20.04 | 18.04

After installing composer, go to the directory for saving root files configured in Nginx above, and then run the composer command below. The last number is Latest version number And can be omitted.

cd /var/www/html/
composer create-project grumpydictator/firefly-iii --no-dev --prefer-dist firefly-iii 5.2.8  ##This might take some time to complete!

When in the same directory, repair the access permissions of the new file

sudo chown -R www-data:www-data firefly-iii
sudo chmod -R 775 firefly-iii/storage

Step 5: Configure Firefly III on Ubuntu 20.04 | 18.04

In the firefly-iii directory, you will find a .env file. Open this file with your favorite editor and follow the instructions provided in it to make the following database-related changes. The database and user name are the same as we set in step 2.

$ sudo vim /var/www/html/firefly-iii/.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=firefly_database
DB_USERNAME=fireflyuser
DB_PASSWORD=StrongPassword

Also check out the screenshot below.

Please note that if you want Firefly III to send you mail, the .env file also has a “mail” setting.

Initialize the database

This step is very important, because Firefly III requires a database, and it will tell you whether your configuration is correct. Run the following command in the Firefly III directory.

cd /var/www/html/firefly-iii

sudo php artisan migrate:refresh --seed
sudo php artisan firefly-iii:upgrade-database
sudo php artisan passport:install

Set up logrotate

Logrotate will help you manage logs effectively by ensuring that the logs are properly compressed and rotated. There should be no harm in using Logrotate for Firefly III logs.

sudo vim /etc/logrotate.d/firefly-iii

##Example config:

/opt/firefly-iii/storage/logs/*.log
{
    weekly
    missingok
    rotate 2
    compress
    notifempty
    sharedscripts
    maxage 60
}

Step 6: Visit Firefly III on Ubuntu 20.04 | 18.04

Now you can access the Firefly III web interface by browsing to the site http://domain-name-or-password/. You should see a login screen, but you cannot log in. Click “Register a new account” and fill out the form. The password must be at least 16 characters.

Set up Firefly III Personal Finance Manager on Ubuntu 20.04 | 18.04

You will be automatically logged in. Follow the instructions and you are done!

Set up Firefly III Personal Finance Manager on Ubuntu 20.04 | 18.04

Now you are ready to create a budget, track expenses, track savings and become a better person. It has many valuable tools that can be used.

Set up Firefly III Personal Finance Manager on Ubuntu 20.04 | 18.04

in conclusion

Our personal broker manager should enable us to ascend to a higher level. Firefly III is an amazing software and should be installed for personal use. You will love it. Thanks to the developers and contributors. Great job! Before concluding this session, we would like to thank you for your visit and closing.

Others also read:

How to install invoice ninja on CentOS 8

The best books for learning web development – ​​PHP, HTML, CSS, JavaScript and jQuery

How to install Odoo 13 on Ubuntu

To
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
To

The
The

Sidebar