Synology: Install PrivateBin With Portainer

Synology Install PrivateBin With Portainer

My previous guide for PrivateBin involved the use of Task Scheduler. Today I’m offering a recommended and excellent alternative for installing the latest PrivateBin version via Portainer. PrivateBin is a minimalist open source web service that allows you to create a paste of your text output and bind it to a single URL that you can then share. It’s similar to Yopass and Password Pusher. This method is perfect for sharing private information inside a Facebook chat, WhatsApp chat or any other IM platform, email etc. The end-user would just click on the link and get the output in a browser. The information will be automatically deleted/destroyed at a time of your choice: as soon as the receiver reads it, after a few minutes, after a week or several months etc. Data is encrypted and decrypted in the browser using 256bit AES in Galois Counter mode. In this step by step guide I will show you how to install PrivateBin on your Synology NAS using Docker & Portainer.

💡Note: This guide works perfectly with the latest PrivateBin v1.7.3 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

Install Text Editor via Synology “Package Center”. (Mandatory STEP.) If you already have Text Editor installed on your Synology NAS, skip this STEP.

Synology Install Text Editor 2023

  • STEP 5

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

PrivateBin Synology NAS Portainer Set up 1

  • STEP 6

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

PrivateBin Synology NAS Portainer Set up 2

  • STEP 7

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

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

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 8092

PrivateBin Synology NAS Portainer Set up 3

  • STEP 8

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 9

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

PrivateBin Synology NAS Portainer Set up 4

  • STEP 10

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

PrivateBin Synology NAS Portainer Set up 5

  • STEP 11

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

PrivateBin Synology NAS Portainer Set up 6

  • STEP 12

Download (click on the blue link below) then upload the conf.php file below in the privatebin folder that you have previously created at STEP 11. Follow the instructions in the image below. 🔒Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

👉🏻conf.php

PrivateBin Synology NAS Portainer Set up 7

  • STEP 13

Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the images below.

Synology User Defined Script

  • STEP 14

Once you click on User-defined script a new window will open. Follow the instructions below:

  1. General: In the Task field type in PrivateBin Permission. Uncheck “Enabled” option. Select root User.
  2. Schedule: Select Run on the following date then select “Do not repeat“.
  3. Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that click OK.
chmod -R 0777 /volume1/docker/privatebin

PrivateBin Synology NAS Portainer Set up 8

  • STEP 15

After you click OK on STEP 14 a new warning pop up window will open. Click OK.

PrivateBin Synology NAS Portainer Set up 9

After you click OK, type in your DSM Password then click Submit. Follow the instructions in the image below.

Synology Task Scheduler Confirm Admin Password

  • STEP 16

After you click Submit on STEP 15, select your “PrivateBin Permission” Task then click the “Run” tab. You will be asked to run PrivateBin Permission – click OK. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 10

  • STEP 17

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 18

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

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

version: "3.9"
services:
  privatebin:
    container_name: PrivateBin
    image: privatebin/nginx-fpm-alpine
    mem_limit: 2g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    restart: on-failure:5
    ports:
      - 8092:8080
    volumes:
      - /volume1/docker/privatebin:/srv/data:rw
      - /volume1/docker/privatebin:/run:rw
      - /volume1/docker/privatebin:/tmp:rw
      - /volume1/docker/privatebin/conf.php:/srv/cfg/conf.php:rw

PrivateBin Synology NAS Portainer Set up 11

  • STEP 19

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.

PrivateBin Synology NAS Portainer Set up 12

  • STEP 20

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

PrivateBin Synology NAS Portainer Set up 13

  • STEP 21

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

  • STEP 22

Now open your browser and type in your HTTPS/SSL certificate like this https://privatebin.yourname.synology.me In my case it’s https://privatebin.mariushosting.synology.me If everything goes right you will see the Privatebin dashboard page. Add your text, select the expiration time, burn after reading, optionally set up a password then click Create. At the top right of the page you also have the option to switch the theme to dark mode. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 14 new 2025

  • STEP 23

You should now see your synology.me DDNS link with a really long alphanumerical code. Copy the link and send it wherever you want. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 15 new 2025

  • STEP 24

Your message will look like this. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 16 new 2025

  • STEP 25

Open the conf.php file that you have previously uploaded at STEP 12. In this file you can fully customize your PrivateBin instance. For example, you can add a function that will allow you to upload files. Change the fileupload value from false to true then save the file. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 17

  • STEP 26

Restart your PrivateBin Container. Open the Docker or the Container Manager package. Click Container then restart PrivateBin.

  • STEP 27

Open your PrivateBin DDNS URL address. As you can see, you have an option to upload files. Upload your file, then click the Create button. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 17 new 2025

  • STEP 28

You should now see your synology.me DDNS link with a really long alphanumerical code. Copy the link and send it wherever you want. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set up 18 new 2025

  • STEP 29

Your files at a glance!

PrivateBin Synology NAS Portainer Set up 19 new 2025

  • STEP 30

If you want to remove PrivateBin from your NAS, just delete the privatebin docker container, the privatebin image and the privatebin folder. Once you create the privatebin folder in your main docker folder, you can’t delete it manually. As a workaround, follow the instructions below to delete the privatebin folder.

  • STEP 31

Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.

Synology User Defined Script

  • STEP 32

Once you click on User-defined script, a new window will open. Follow the instructions below:

  1. General: In the Task field type in “Remove PrivateBin Folder“. Uncheck the “Enabled” option. Select root User.
  2. Schedule: Select Run on the following date then select “Do not repeat“.
  3. Task Settings: Check “Send run details by email“, add your email then copy paste the code below in the Run command area. After that, click OK.
rm -r /volume1/docker/privatebin

PrivateBin Synology NAS Portainer Set up 20

  • STEP 33

After you click OK on STEP 32 a new warning pop up window will open. Click OK.

PrivateBin Synology NAS Portainer Set up 21

After you click OK, type in your DSM Password then click Submit. Follow the instructions in the image below.

Synology Task Scheduler Confirm Admin Password

  • STEP 34

After you click Submit on STEP 33, select your “Remove PrivateBin Folder” Task then click the “Run” tab. You will be asked to run Remove PrivateBin Folder – click OK. Follow the instructions in the image below.

PrivateBin Synology NAS Portainer Set

Enjoy PrivateBin!

🆘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 PrivateBin container with the latest image.
Note: How to Add USB Support on DSM 7.2.
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 Sunday / May 26th, 2024 at 4:52 AM