Firefly III is an open-source personal financial management software solution designed for those seeking complete control over their personal finances. It functions as a self-hosted web application, ensuring user privacy and full data control. This tool offers robust functionalities for tracking expenses and income, budget management, and monitoring accounts in different currencies. One of its main advantages is the ability to import data from other financial sources, facilitating the transition and consolidation of financial information in one place.
In addition, Firefly III stands out for its advanced graphics and reporting engine, allowing users to visualize their finances effectively for better analysis and decision-making. The application also supports the creation of automated rules for transaction categorization, saving time and effort. With an intuitive user interface, Firefly III is accessible to users of all technical levels. Backed by an active community of developers, the tool is constantly evolving to adapt to changing needs in personal finance management.
Below, we will explain how to install the latest version of Firefly on a web server with Apache2 on a Debian-based distribution or one derived from it with no preconfigured settings. We will also detail the process of installing dependencies and configuring a Let's Encrypt SSL certificate using Certbot beforehand.
Installation of Required Packages and Dependencies
First, update the system's repositories and packages:
# apt update && apt upgrade -y && apt install software-properties-common -y
Also, add the official PHP repository:
# add-apt-repository ppa:ondrej/php -y
Install the web server, MySQL, PHP FPM, and other dependencies:
# apt install apache2 nano php8.3 php8.3-fpm php8.3-curl php8.3-gd php8.3-mbstring php8.3-mysql php8.3-xml php8.3-intl php8.3-cli php8.3-ldap php8.3-xml php8.3-xmlrpc php8.3-apcu php8.3-zip php8.3-bcmath php8.3-bz2 mariadb-server redis language-pack-es-base -y
Enable the modules and configure PHP FPM for Apache:
# a2enmod proxy_fcgi setenvif rewrite && a2enconf php8.3-fpm
Install Composer for later use:
# curl -sS https://getcomposer.org/installer -o composer-setup.php && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
And restart the web server:
# systemctl restart apache2
Creation of MySQL Database and User for Firefly
To create a database for Firefly, execute the following:
# mysqladmin create db_firefly
Create a MySQL user for Firefly (remember to modify the example password):
# mysql -u root -e "CREATE USER 'user_firefly'@'localhost' IDENTIFIED BY 'your_password'"
And grant permissions to the user on the previously created Firefly database:
# mysql -u root -e "GRANT ALL ON db_firefly.* TO 'user_firefly'@'localhost'"
Downloading and Preparing Firefly Installation
To download the latest version of Firefly III, execute the following:
# curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest | grep "tarball_url" | cut -d : -f 2,3 | tr -d '," ' | xargs curl -sLO
Then, extract the downloaded file into the web directory:
# tar -xzf v6.* -C /var/www/html --strip-components=1
Change the permissions of the web directory recursively:
# chown -R www-data:www-data /var/www/
Once done, edit the default website configuration file:
# nano /etc/apache2/sites-enabled/000-default.conf
Uncomment and modify the ServerName line with the desired DNS record (example):
ServerName firefly.example.com
Additionally, modify the DocumentRoot and add a Directory for /var/www/html/public:
DocumentRoot /var/www/html/public
<Directory /var/www/html/public/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
Save the changes, exit the editor, and reload Apache:
# systemctl reload apache2.service
Additionally, remove the default Apache index file:
# rm /var/www/html/index.html
Next, you'll need to configure the Firefly environment file, and you can directly copy the example file:
# cp /var/www/html/.env.example /var/www/html/.env
And edit it to modify the configuration:
# nano /var/www/html/.env
In it, you should specify the configuration for the database and the URL you will use, as shown in the following example:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_firefly
DB_USERNAME=db_firefly
DB_PASSWORD=your_password
APP_URL=https://firefly.example.com
Remember that there are other parameters in the environment file, and you will need to configure them if you want to use all the features that Firefly offers.
Then, navigate to the Firefly directory to install Firefly with Composer and finish setting it up with Artisan:
# cd /var/www/html && composer install && php artisan firefly-iii:upgrade-database && php artisan passport:install --force && chown -R www-data:www-data /var/www/
Finally, install Certbot and the Python automation script for Apache:
# apt install python3-certbot-apache -y
And run it (remember to modify the example with the DNS record entered in ServerName):
# certbot --apache --redirect -d firefly.example.com
Afterwards, you can access the configured URL and create the user:
Once this final step is completed, you will have FireFly ready to use and can begin working with it:
We hope this article has been helpful. If you have any questions about this or any other matter related to your servers on Clouding, do not hesitate to contact support@clouding.io. We are here to help!