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/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

Download the latest Version from here.
Unpack it with

unzip -o FireflyIII-v6.1.24.zip -d /var/www/firefly-iii
sudo chown -R elias /var/www/firefly-iiicd /var/www/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

Set up Composer and install

composer install --no-dev --no-scripts
php artisan key: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 firefly-iii:laravel-passport-keys

change the owner of the folder with

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

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