How to Install Umami on Your Synology NAS

How to Install Umami on Your Synology NAS

Umami is a simple, fast, privacy-focused alternative to Google Analytics. The goal is to provide you with a friendlier, privacy-focused alternative to Google Analytics and a free, open-sourced alternative to paid solutions. Umami collects only the metrics you care about and everything fits on a single page. You can use Umami on your Synology NAS as alternative to Matomo. For my personal experience Umami is better than Matomo. In this step by step guide I will show you how to install Umami on your Synology NAS using Docker.

Note: This guide works perfectly with the latest version of Umami v.1.31.0

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

Umami Synology NAS Set up 1

  • STEP 5

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

Umami 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 Umami. After that, add the following instructions:

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

Destination:
Protocol: HTTP
Hostname: localhost
Port: 3999

Umami Synology NAS Set up 3

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

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

Umami Synology NAS Set up 5

  • STEP 9

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

Umami Synology NAS Set up 6

  • STEP 10

Now create one new folder inside the umami folder that you created at STEP 9 and name it db. Follow the instructions in the image below.
Note: Be careful enter only lowercase, not uppercase letters.

Umami Synology NAS Set up 7

  • STEP 11

Download (click on the blue link below) then upload the schema.postgresql.sql file below in the umami folder that you created at STEP 9. Follow the instructions in the image below.

Download schema.postgresql.sql

Umami Synology NAS Set up 8

  • STEP 12

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

Umami Synology NAS Set up 9

  • STEP 13

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

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

version: '3'
services:
  umami:
    image: ghcr.io/mikecao/umami:postgresql-latest
    ports:
      - 3999:3000
    environment:
      DATABASE_URL: postgresql://umami:umami@db:5432/umami
      DATABASE_TYPE: postgresql
      HASH_SALT: R9ei571tdLRxGYLRe7MW
    depends_on:
      - db
    restart: always
  db:
    image: postgres:12-alpine
    environment:
      POSTGRES_DB: umami
      POSTGRES_USER: umami
      POSTGRES_PASSWORD: umami
    volumes:
      - /volume1/docker/umami/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
      - /volume1/docker/umami/db:/var/lib/postgresql/data
    restart: always
volumes:
  umami-db-data:

Umami Synology NAS Set up 10

  • STEP 14

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.

Umami Synology NAS Set up 11

  • STEP 15

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

Umami Synology NAS Set up 12

  • STEP 16

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

  • STEP 17

Now open your browser and type in your HTTPS address like this https://umami.yourname.synology.me In my case it’s https://umami.mariushosting.synology.me If everything goes right, you will see the login page. Type in the default username and password, then click Login. Follow the instructions in the image below.

Warning: the default username is admin and the default password is umami

Umami Synology NAS Set up 13

  • STEP 18

At the top right of the page click user Profile. Follow the instructions in the image below.

Umami Synology NAS Set up 14

  • STEP 19

On the left sidebar select Account. Change the default credentials “admin and umami” with your own credentials. Follow the instructions in the image below.

Umami Synology NAS Set up 15

  • STEP 20

Click on the Settings tab then click Add website. Follow the instructions in the image below.

Umami Synology NAS Set up 16

  • STEP 21

Add your own website Name and Domain URL then click Save. Follow the instructions in the image below.

Umami Synology NAS Set up 17

  • STEP 22

Click on the Tracking code icon then copy your own personal Java Script code. Follow the instructions in the image below.

Umami Synology NAS Set up 18

  • STEP 23

Paste your personal Umami JavaScript Tracking code you have automatically generated at STEP 22 on your website between the <​head> and </head> tags of your site, then update your file. For example, I have a WordPress website hosted on a Synology NAS. If you have a WordPress website hosted elsewhere, know that the process is the same. Log into your WordPress admin Dashboard, click on the left sidebar on “Theme File Editor”, select your theme then search for the header.php file. Paste your personal Umami JavaScript Tracking code you have automatically generated at STEP 22 in the header.php file between the <​head> and </head> tags of your site, then update your file. Follow the instructions in the image below.
Note: You can add multiple websites via the Umami Dashboard later.

Umami Synology NAS Set up 19

Enjoy Umami!

Umami Synology NAS Set up 20

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: Find out how to update the Umami container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: Instead of the synology.me DDNS you can also use your own domain name.
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 Sunday / May 8th, 2022 at 2:17 AM