I'll be building on top of Ubuntu Server 20.04 LTS
apt install apache2 mariadb-server php8.0 php8.0-bcmath php8.0-intl php8.0-curl php8.0-zip php8.0-gd php8.0-xml php8.0-mbstring php8.0-ldap php8.0-mysql
Install Composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Verify the installation
composer -v
Run the secure installation
mysql_secure_installation
Login as root
mysql
Create a new database
CREATE DATABASE firefly;
Create a new user
CREATE USER 'firefly'@'localhost' IDENTIFIED BY '*********************';
Grant all privileges on database firefly
for user firefly
GRANT ALL ON firefly.* TO 'firefly'@'localhost';
Flush privileges and exit
FLUSH PRIVILEGES;
exit
Create a new config for Firefly III
vim /etc/apache2/sites-available/firefly.conf
Use the following config. Modify as you see fit.
<VirtualHost *:80>
DocumentRoot /var/www/firefly/firefly-iii/public
DirectoryIndex index.php
ServerSignature Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/firefly/firefly-iii/public>
AllowOverride all
</Directory>
</VirtualHost>
Disable the default site, enable firefly.conf, reload Apache
a2dissite 000-default.conf
a2ensite firefly.conf
systemctl reload apache2.service
Create a directory for the installation, change its permissions, and cd into it
mkdir /var/www/firefly/
chown ross:ross /var/www/firefly/
cd /var/www/firefly/
Use Composer to install (as Composer says, don't run the installation as root)
sudo -u ross composer create-project grumpydictator/firefly-iii --no-dev --prefer-dist firefly-iii 5.6.16
Now that the installation is complete, change the permissions again so Apache has the access it needs
chown -R www-data:www-data /var/www/firefly/
chmod -R 775 /var/www/firefly/firefly-iii/storage/
Modify the .env
config - follow the instructions in the file. Make sure to set your database credentials.
vim /var/www/firefly/firefly-iii/.env
Initialize the database
cd /var/www/firefly/firefly-iii/
php artisan migrate:refresh --seed
php artisan firefly-iii:upgrade-database
php artisan passport:install
Firefly III Data Importer | Official Docs
I will be installing FIDI on the same server as the main Firefly III instance
Create a new directory next to the existing Firefly install
mkdir /var/www/fidi/
chown ross:ross /var/www/fidi/
cd /var/www/fidi/
Use Composer to install
sudo -u ross composer create-project firefly-iii/data-importer --no-dev --prefer-dist data-importer 0.9.0
Now that the installation is complete, change the permissions again so Apache has the access it needs
chown -R www-data:www-data /var/www/fidi/
chmod -R 775 /var/www/fidi/data-importer/storage
Modify the .env
config - follow the instructions in the file. Make sure to set your database credentials.
vim /var/www/fidi/data-importer/.env