Skip to main content

Firefly-III

Preparation

sudo apt update
sudo apt upgrade -y
sudo apt install -y nginx curl software-properties-common php8.3 php8.3-{cli,zip,gd,fpm,common,mysql,zip,mbstring,curl,xml,bcmath,imap,ldap,intl} php-json

Check to see if php is running

php -v and systemctl status php8.3-fpm

Adjust some php settings

sudo nvim /etc/php/8.3/fpm/php.ini

search for and change or enable the following lines of code

memory_limit = 512M

[Date]
date.timezone = Europe/Berlin

stop apache

sudo systemctl stop apache2
sudo systemctl disable apache2

remove nginx file

sudo rm /etc/nginx/sites-enabled/default

create "firefly.dodekaeder.name" in sites-enabled folder and then paste in the config below

sudo nvim /etc/nginx/sites-enabled/firefly.dodekaeder.name
server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        #server_name  subdomain.domain.com;
        root         /var/www/html/firefly-iii/public;
        index index.html index.htm index.php;

        location / {
                try_files $uri /index.php$is_args$args;
                autoindex on;
                sendfile off;
       }

        location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.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)(/.+)$;
        }

    }

restart

sudo systemctl restart nginx php8.3-fpm

If you get an error due to duplicate web servers, you need to remove the symbolic link in sites-available (ls -l) and then rm the link

Install mariaDB

curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- \
  --mariadb-server-version="mariadb-10.11" --os-type="ubuntu" --os-version="noble"
sudo apt install -y mariadb-server mariadb-client
sudo mysql_secure_installation

test installation

mysql -u root -p

in the mysql shell, check version with the command in bold

SELECT VERSION();

while still inside the mariaDB shell:

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

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

test composer

composer -V

install firefly - change the version number at the end of the command below to whateverDownload the latest isVersion from here.
Unpack it with

cdunzip -o FireflyIII-v6.1.24.zip -d /var/www/html/firefly-iii
sudo chown -R elias /var/www/html
composer create-project grumpydictator/firefly-iii --no-dev --prefer-dist firefly-iii 6.1.24

cdiiicd /var/www/html/firefly-iii

Change in the ".env" file those lines:

DB_HOST=127.0.0.1
DB_DATABASEE=firefly_db
DB_USERNAME=<usr>
DB_PASSWORD=<pwd>

TZ=Europe/Berlin

continueSet instalationup Composer and install

composer install --no-dev --no-scripts
php artisan migrate:refreshkey:generate
php artisan migrate --seed
php artisan firefly-iii:decrypt-all
php artisan cache:clear
php artisan view:clear
php artisan firefly-iii:upgrade-database
php artisan passport:installfirefly-iii:laravel-passport-keys

Make sure we havechange the rightowner locale enabled (currency and language?)

First check to see what is enabled. I want (en_US.utf8, en_US.UTF-8)

locale -a
sudo nvim /etc/locale.gen and uncommentof the line en_US.utf8, en_US.UTF-8
sudo locale-gen
sudo systemctl restart nginx php8.3-fpm

That should be it. Navigate to the container IP address and you should get firefly Login


Nginx

Install Nginxfolder with

sudo aptchown install-R nginxwww-data:www-data /var/www/firefly-iii
sudo servicechmod nginx-R start775 sudo systemctl enable nginx/var/www/firefly-iii/storage

CreateChange ain newthe Configuration".env" Filefile with:
those sudo vim /etc/nginx/sites-available/mywebsite
and test ist with sudo nginx -tand then restart with sudo service nginx restart

PHP

install php 8.3 withlines:

apt-getDB_HOST=127.0.0.1
installDB_DATABASEE=firefly_db
ca-certificatesDB_USERNAME=<usr>
apt-transport-httpsDB_PASSWORD=<pwd>

software-properties-common
# Add Ondrej's PPA
sudo add-apt-repository ppa:ondrej/php
sudo apt update

# Install new PHP 8.3 packages
sudo apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}

# Install FPM OR Apache module
sudo apt install php8.3-fpm
# OR
# sudo apt install libapache2-mod-php8.2

# On Apache: Enable PHP 8.3 FPM
sudo a2enconf php8.3-fpmTZ=Europe/Berlin