Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-08-28

How to Install Firefly III on an Ubuntu VPS

tutorials
img

Are you ready to take control of your personal finances? Look no further than Firefly III, the powerful open-source personal finance manager. In this comprehensive guide, we'll walk you through installing Firefly III on your CloudBlast VPS, empowering you to track, manage, and optimize your financial life with ease.

What is Firefly III?

Firefly III is a free, open-source personal finance manager that helps you track your income, expenses, and everything in between. With its user-friendly interface and powerful features, it's the perfect tool for budgeting, tracking investments, and gaining insights into your spending habits.

Prerequisites

Before we dive in, make sure you have:

- A CloudBlast VPS running Ubuntu 22.04 LTS
- Root access or a user with sudo privileges
- Basic command-line knowledge

Step 1: Update Your System

First, let's ensure your system is up-to-date:


sudo apt update && sudo apt upgrade -y
 

Step 2: Install Essential Packages

Install the necessary packages:


sudo apt install -y git curl zip unzip imagemagick gnupg2
 

Step 3: Set Up the Database

Firefly III needs a database. Let's install MariaDB:


sudo apt install -y mariadb-server mariadb-client
sudo mysql_secure_installation
 

Follow the prompts to secure your MariaDB installation.

Now, let's create a database for Firefly III:


sudo mysql -u root -p
 

In the MySQL prompt, run:


CREATE DATABASE firefly;
CREATE USER 'firefly'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON firefly.* TO 'firefly'@'localhost';
FLUSH PRIVILEGES;
EXIT;
 

Step 4: Install PHP and Required Extensions

Firefly III runs on PHP. Install PHP 8.1 and necessary extensions:


sudo apt install -y php8.1 php8.1-cli php8.1-common php8.1-curl php8.1-gd php8.1-intl php8.1-mbstring php8.1-mysql php8.1-xml php8.1-zip
 

Step 5: Install Composer

Composer is essential for managing PHP dependencies:


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

Step 6: Install Firefly III

Now, let's get Firefly III installed:


cd /var/www
sudo git clone https://github.com/firefly-iii/firefly-iii
cd firefly-iii
sudo composer install --no-dev
 

Step 7: Configure Firefly III

Copy the example environment file:


sudo cp .env.example .env
 

Generate an app key:


sudo php artisan key:generate
 

Edit the .env file:


sudo nano .env
 

Update the following lines:


APP_URL=http://your_domain_or_ip
DB_DATABASE=firefly
DB_USERNAME=firefly
DB_PASSWORD=your_strong_password
 

Save and exit the file.

Step 8: Set Proper Permissions

Ensure the web server can access the files:


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

Step 9: Set Up the Web Server

If you're using Apache, create a new virtual host:


sudo nano /etc/apache2/sites-available/firefly.conf
 

Add the following content:


<VirtualHost *:80>
    ServerName your_domain_or_ip
    DocumentRoot /var/www/firefly-iii/public

    <Directory /var/www/firefly-iii/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/firefly_error.log
    CustomLog ${APACHE_LOG_DIR}/firefly_access.log combined
</VirtualHost>
 

Enable the site and restart Apache:


sudo a2ensite firefly.conf
sudo systemctl restart apache2
 

Step 10: Initialize Firefly III

Run the following commands to set up the database and create a user:


cd /var/www/firefly-iii
sudo php artisan migrate --seed
sudo php artisan firefly:upgrade-database
sudo php artisan firefly:verify
 

Step 11: Access Your New Firefly III Installation

You can now access Firefly III by navigating to `http://your_domain_or_ip` in your web browser. Log in with the default credentials:

- Email: `admin@example.com`
- Password: `secret`

Make sure to change these immediately!

Conclusion: Your Financial Journey Begins

Congratulations! You've successfully installed Firefly III on your CloudBlast VPS. You now have a powerful, self-hosted personal finance manager at your fingertips. Start by importing your transactions, setting up budgets, and exploring the wealth of features Firefly III offers.

Remember, this is just the beginning of your journey to financial mastery. Take time to explore all the features and customize Firefly III to fit your unique financial situation. If you encounter any issues or need assistance optimizing your CloudBlast VPS for Firefly III, don't hesitate to reach out to our expert support team.

Happy budgeting, and here's to your financial success!