How to Install Firefly III on Your Synology NAS

How to Install Firefly III on Your Synology NAS

Firefly III is a self-hosted manager for your personal finances. It can help you keep track of your expenses and income so you can spend less and save more. Firefly III supports the use of budgets, categories and tags. Using a bunch of external tools, you can import data. It also has many neat financial reports available. Firefly III should give you insight into and control over your finances. In this step by step guide I will show you how to install Firefly III on your Synology NAS using Docker & Portainer. With the updated Firefly guide below you will be able to set up recurring transactions.

Note: This guide works perfectly with the latest Firefly III 5.7.18 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

Firefly Synology NAS Set up 1 2023

  • STEP 5

Now click the “Create” button. Follow the instructions in the image below.

Firefly Synology NAS Set up 2 2023

  • STEP 6

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in Firefly. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: firefly.yourname.synology.me
Port: 443

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 6182

Firefly Synology NAS Set up 3 2023

  • STEP 7

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Synology Proxy WebSocket

  • STEP 8

Go to Control Panel / Network / Connectivity / Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

Firefly Synology NAS Set up 4 2023

  • STEP 9

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

Firefly Synology NAS Set up 5 2023

  • STEP 10

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it firefly. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Firefly Synology NAS Set up 6 2023

  • STEP 11

Now create three new folders inside the firefly folder that you created at STEP 10 and name them db, redis, upload. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Firefly Synology NAS Set up 7 2023

  • STEP 12

Log into Portainer using your username and password. In the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 13

In the Name field type in firefly. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: "3.9"
services:
  redis:
    image: redis
    container_name: Firefly-REDIS
    hostname: firefly-redis
    mem_limit: 256m
    mem_reservation: 50m
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    read_only: true
    user: 1026:100
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    volumes:
      - /volume1/docker/firefly/redis:/data:rw
    environment:
      TZ: Europe/Bucharest
    restart: on-failure:5

  db:
    image: mariadb:jammy
    container_name: Firefly-DB
    hostname: firefly-db
    mem_limit: 512m
    mem_reservation: 128m
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -P 3306 -prootpass | grep 'mysqld is alive' || exit 1"]
    volumes:
      - /volume1/docker/firefly/db:/var/lib/mysql:rw
    environment:
      TZ: Europe/Bucharest
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: firefly
      MYSQL_USER: fireflyuser
      MYSQL_PASSWORD: strangepass
    restart: on-failure:5

  firefly:
    image: fireflyiii/core:latest
    container_name: Firefly
    hostname: firefly
    mem_limit: 1g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: curl -f http://localhost:8080/ || exit 1
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/firefly/upload:/var/www/html/storage/upload:rw
    ports:
      - 6182:8080
    restart: on-failure:5
    depends_on:
      db:
        condition: service_started
      redis:
        condition: service_healthy

  cron:
    image: alpine:latest
    command: sh -c "echo \"0 3 * * * wget -qO- http://firefly:8080/api/v1/cron/9610001d2871a8622ea5bf5e65fe25db\" | crontab - && crond -f -L /dev/stdout"
    container_name: Firefly-Cron
    hostname: firefly-cron
    mem_limit: 64m
    cpu_shares: 256
    security_opt:
      - no-new-privileges:true
    environment:
      TZ: Europe/Bucharest
    restart: on-failure:5
    depends_on:
      firefly:
        condition: service_started

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.)
Note: The number 3 in command means cronjob gets triggered everyday at 3 o’clock in the morning so Firefly can do its recurring transactions job. You can change the number according to your preferences.

Firefly Synology NAS Set up 8 new 2023

  • STEP 14

Click the Upload button after Web editor. Download the stack.env file by clicking the blue link below and then upload it from your computer in the “Load variables from .env files“. Follow the instructions in the image below.

Download stack.env file

Firefly Synology NAS Set up 9 2023

  • STEP 15

Note: On the Environment variables change the value for APP_KEY and add your own App Key. MariushostingMariushostingMari13 is an example for an APP_KEY. You should invent your own Value. Add 32 random characters, both letters and numbers. 🔵
Note: On the Environment variables change the value for APP_URL. Type in your own synology.me DDNS that you have previously created at STEP 6 with https at the beginning. 🟡
Note: On the Environment variables change the value for TZ and add your own TIMEZONE. (Select your current Time Zone from this list.) 🟢
Note: On the Environment variables change the value for DEFAULT_LANGUAGE. Examples: en_US for English, de_DE for German, fr_FR for French etc. (Select your current Default Language from this list.) 🔴
Warning: Do not change any of the other values.

Firefly Synology NAS Set up 10 2023

  • STEP 16

After you made the changes, click the Web editor button. Follow the instructions in the image below.

Firefly Synology NAS Set up 11 2023

  • STEP 17

Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

Firefly Synology NAS Set up 12 2023

  • STEP18

If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.

Firefly Synology NAS Set up 13 2023

  • STEP 19

Go back to STEP 1 or you will deal with karma 🙂

  • STEP 20

Please wait approximately 3-5 minutes for the installation to be completed or you will get a blank page if you try to connect too soon. Now open your browser and type in your HTTPS/SSL certificate like this https://firefly.yourname.synology.me In my case it’s https://firefly.mariushosting.synology.me If everything goes right, you will see the Firefly registration page. Add your own Email and Password, confirm the Password, then click Register. Follow the instructions in the image below.
Warning: Password should be 16 characters, it’s mandatory.

Firefly Synology NAS Set up 14 2023 new

  • STEP 21

Add your own Bank details then click Submit. Follow the instructions in the image below.

Firefly Synology NAS Set up 15 2023

  • STEP 22

Your Firefly dashboard at a glance!

Firefly III Synology-NAS Set up 14

Enjoy Firefly III!

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: Find out how to update the Firefly III container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Tuesday / January 31st, 2023 at 2:44 AM