How to Install Lychee on Your Synology NAS

How to Install Lychee on Your Synology NAS

Lychee is a free photo-management tool, which runs on your server or web-space. Installing is a matter of seconds. Upload, manage and share photos like from a native application. Lychee comes with everything you need and all your photos are stored securely. In this step by step guide I will show you how to install Lychee on your Synology NAS using Docker and Portainer.

💡Note: This guide works perfectly with the latest Lychee v6.1.2 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.

Lychee Synology NAS Set up 1

  • STEP 5

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

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

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

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 6280

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

Synology Proxy WebSocket

  • STEP 8

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

Lychee Synology NAS Set up 4

  • STEP 9

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

Lychee Synology NAS Set up 5

  • STEP 10

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

Lychee Synology NAS Set up 6

  • STEP 11

Now create six new folders inside the lychee folder that you have previously created at STEP 10 and name them conf, db, logs, sym, tmp, uploads. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Lychee Synology NAS Set up 7 new 2025

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

1 Synology Portainer Add Stack

  • STEP 13

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

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

services:
  db:
    image: mariadb:11.4-noble #LTS Long Time Support Until May 29, 2029.
    container_name: Lychee-DB
    hostname: lychee-db
    security_opt:
      - no-new-privileges:false
    environment:
      - TZ=Europe/Bucharest
      - MYSQL_ROOT_PASSWORD=rootpass
      - MYSQL_DATABASE=lychee
      - MYSQL_USER=lycheeuser
      - MYSQL_PASSWORD=lycheepass
    volumes:
      - /volume1/docker/lychee/db:/var/lib/mysql:rw
    ports:
      - 3306:3306
    restart: on-failure:5

  lychee:
    image: lycheeorg/lychee:latest
    container_name: Lychee
    hostname: lychee
    security_opt:
      - no-new-privileges:false
    healthcheck:
      test: curl -f -s http://localhost:80/ || exit 1
    volumes:
      - /volume1/docker/lychee/conf:/conf:rw
      - /volume1/docker/lychee/uploads:/uploads:rw
      - /volume1/docker/lychee/sym:/sym:rw
      - /volume1/docker/lychee/logs:/logs:rw
      - /volume1/docker/lychee/tmp:/lychee-tmp:rw
    environment:
      - PUID=1026
      - PGID=100
      - PHP_TZ=Europe/Bucharest
      - TIMEZONE=Europe/Bucharest
      - APP_FORCE_HTTPS=true
      - APP_ENV=production
      - DB_CONNECTION=mysql
      - DB_HOST=lychee-db
      - DB_PORT=3306
      - DB_DATABASE=lychee
      - DB_USERNAME=lycheeuser
      - DB_PASSWORD=lycheepass
      - STARTUP_DELAY=10
      - APP_NAME=Laravel
      - APP_DEBUG=false      
      - APP_URL=https://lychee.yourname.synology.me
      - TRUSTED_PROXIES=*
      - SECURITY_HEADER_HSTS_ENABLE=true
       #- MAIL_DRIVER=smtp
       #- MAIL_HOST=smtp.gmail.com
       #- MAIL_PORT=587
       #- MAIL_USERNAME=Your-own-gmail-address
       #- MAIL_PASSWORD=Your-own-gmail-address
       #- MAIL_ENCRYPTION=starttls
       #- MAIL_FROM_NAME=Your-own-gmail-address
       #- MAIL_FROM_ADDRESS=Your-own-app-password
    ports:
      - 6280:80
    restart: on-failure:5
    depends_on:
      db:
        condition: service_started

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: Before you paste the code above in the Web editor area below, change the value numbers for PUID and PGID with your own values. (Follow my step by step guide on how to do this.) 1026 is my personal PUID value and 100 is my personal PGID 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 PHP_TZ. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value for TIMEZONE. (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value for APP_URL and type in your own synology.me DDNS with https:// at the beginning that you have previously created at STEP 6.
Note: If you want, you can also add your own SMTP email details by removing all the # in the code above. If you don’t have SMTP details, then leave the code as it is with the #. (Follow my guide on how to Activate Gmail SMTP For Docker Containers.)

Lychee Synology NAS Set up 8 new 2025

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

Lychee Synology NAS Set up 9 new 2025

  • STEP 15

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

Lychee Synology NAS Set up 10

  • STEP 16

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

  • STEP 17

Please wait approximately 5 minutes for the installation to be completed or you will get a blank Synology page if you try to connect too soon. Now open your browser and type in your HTTPS/SSL certificate like this https://lychee.yourname.synology.me In my case it’s https://lychee.mariushosting.synology.me If everything goes right, you will see the Lychee installation page. Click Next. Follow the instructions in the image below.

Lychee Synology NAS Set up 11 new 2025

  • STEP 18

Click Next. Follow the instructions in the image below.

Lychee Synology NAS Set up 12 new 2025

  • STEP 19

Click Next. Follow the instructions in the image below.

Lychee Synology NAS Set up 13 new 2025

  • STEP 20

Click Install. Follow the instructions in the image below.

Lychee Synology NAS Set up 14 new 2025

  • STEP 21

Wait some minutes for the installation to be completed.

  • STEP 22

Click Set up admin account. Follow the instructions in the image below.

Lychee Synology NAS Set up 15 new 2025

  • STEP 23

Type in your own Username and Password. Confirm the password then click Create admin account. Follow the instructions in the image below.

Lychee Synology NAS Set up 16 new 2025

  • STEP 24

Click Open Lychee. Follow the instructions in the image below.

Lychee Synology NAS Set up 12

  • STEP 25

Type in the Username and Password that you have previously created at STEP 23. Click Sign In. Follow the instructions in the image below.

Lychee Synology NAS Set up 18 new 2025

  • STEP 26

Close the pop-up window. Follow the instructions in the image below.

Lychee Synology NAS Set up 19 new 2025

  • STEP 27

Your Lychee at a glance! Upload your own photos by clicking the + button at the top right of the page. Follow the instructions in the image below.

Lychee Synology NAS Set up 20 new 2025

  • STEP 28

Your Lychee at a glance!

Lychee Synology NAS Set up 21 new 2025

Enjoy Lychee!

Note: Lychee integrates a Honeypot and will return 418 if you hit some specific addresses. For example, if anyone tries to access the cross product of those e.g. admin.html, they will get a 418 back. You can then use that response with fail2ban to get rid of undesirable visitors: See more on the official Lychee page documentation.

🆘TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issues article.

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find out how to update the Lychee 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: 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 Monday / December 2nd, 2024 at 11:32 PM