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.

Note: This guide works perfectly with the latest Firefly III 5.7.6 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.

  • 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 III Synology-NAS Set up 1

  • STEP 5

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

Firefly III Synology-NAS Set up 2

  • 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

Destination:
Protocol: HTTP
Hostname: localhost
Port: 6182

Firefly III Synology-NAS Set up 3 new

  • 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.

Firefly III Synology-NAS Set up 4

  • STEP 8

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

Firefly III Synology-NAS Set up 5

  • STEP 9

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

Firefly III Synology-NAS Set up 6

  • STEP 10

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.

Firefly III Synology-NAS Set up 6b

  • STEP 11

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.7'

networks:
  internal:
    external: false

services:
  firefly:
    container_name: firefly
    image: fireflyiii/core:latest
    ports:
      - 6182:8080
    volumes:
      - /volume1/docker/fireflyup:/var/www/html/storage/upload
    restart: unless-stopped
    env_file:
      - stack.env
    depends_on:
      - firefly-db
    networks:
      - internal

  firefly-db:
    container_name: firefly-db
    image: postgres
    volumes:
      - /volume1/docker/fireflydb:/var/lib/postgresql/data
    restart: always
    environment:
      POSTGRES_DB: firefly
      POSTGRES_USER: firefly
      POSTGRES_PASSWORD: firefly
    networks:
      - internal

  firefly-db-backup:
    container_name: firefly-db-backup
    image: postgres
    volumes:
      - /volume1/docker/fireflydb:/dump
      - /etc/localtime:/etc/localtime:ro
    environment:
      PGHOST: firefly-db
      PGDATABASE: firefly
      PGUSER: firefly
      PGPASSWORD: firefly
      BACKUP_NUM_KEEP: 10
      BACKUP_FREQUENCY: 7d
    entrypoint: |
      bash -c 'bash -s < /dump/dump_\`date +%d-%m-%Y"_"%H_%M_%S\`.psql 
        (ls -t /dump/dump*.psql|head -n $$BACKUP_NUM_KEEP;ls /dump/dump*.psql)|sort|uniq -u|xargs rm -- {} 
        sleep $$BACKUP_FREQUENCY 
      done 
      EOF'
    networks:
      - internal

  firefly-redis:
    container_name: firefly-redis
    image: redis
    networks:
      - internal

Firefly III Synology-NAS Set up 7

  • STEP 12

Click the Upload button after Web editor. Download the .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 .env file

Firefly III Synology-NAS Set up 8

  • STEP 13

Add your own values in the specified blue circle below. Follow the instructions.

  1. Your own email.
  2. Your own Time Zone, in my case Europe/Bucharest. (Select your current Time Zone from this list.)
  3. Your own synology.me DDNS that you have previously created at STEP 6. Don’t forget to add https:// at the beginning.

Firefly III Synology-NAS Set up 9

  • STEP 14

After you made the change and added your own values at STEP 13, click the Web editor button. Follow the instructions in the image below.

Firefly III Synology-NAS Set up 10

  • STEP 15

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 III Synology-NAS Set up 11

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

  • STEP 16

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

  • STEP 17

The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection. Now open your browser and type in http://Synology-ip-address:6182 Add your own Email and Password then click Register. Follow the instructions in the image below.
Note: Password should be 16 characters.

Firefly III Synology-NAS Set up 12

  • STEP 18

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

Firefly III Synology-NAS Set up 13

Enjoy Firefly III!

Firefly III Synology-NAS Set up 14

  • STEP 19

If you want to access Firefly III online over HTTPS, open your browser and type in your HTTPS/SSL certificate that you have previously created at STEP 6 like this https://firefly.yourname.synology.me In my case it’s https://firefly.mariushosting.synology.me

Firefly III Synology-NAS Set up 15

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: Some Docker Containers Need WebSocket.

This post was updated on Friday / May 20th, 2022 at 12:43 PM