How to install Pocketbase on your Synology NAS (Step by Step guide)

“Learn how to install Pocketbase on your Synology NAS with this step-by-step guide, keeping control of your data and saving money on cloud services, all while running a powerful backend on your own hardware.”

🔓 **Key Takeaways:**
🔓 Pocketbase can be installed on a Synology NAS to provide a free and powerful backend solution.
🔓 To install Pocketbase, you need a Synology NAS with Docker installed, at least 1GB of free RAM, and 500MB of storage space.
🔓 The container settings for Pocketbase include specifying the port (8090) and mounting a volume for data storage.

What is Pocketbase and Why Install it on Your NAS?

Pocketbase is like having your own mini Firebase – but it’s free and runs on your own hardware. It’s a tiny but powerful backend that packs a database, authentication, and file storage into one neat package. I spent hours researching pocketbase vs firebase vs supabase and I think pocketbase is the best option.

Running Pocketbase on your Synology NAS means you keep full control of your data while saving money on cloud services. Plus, your data stays within your home network, which means faster access speeds and better privacy.

This guide is perfect if you’re comfortable using Docker and want to host your own backend. You’ll need basic command line skills and a Synology NAS that can run Docker.

Before You Start: Requirements

You’ll need:

  • A Synology NAS with an Intel or AMD processor (most models from 2018 onwards work great)
  • At least 1GB of free RAM
  • 500MB of storage space
  • Docker package installed
  • Admin access to your NAS
  • Portainer installed

This tutorial assumes you have Portainer or you know how to use Docker Compose.

Setting Up Files and reverse proxy on Synology

  1. Go to files –> Docker
  2. Create a “pocketbase” folder
  3. Inside pocketbase create 3 more folders: “pb_hooks”, “pb_public” and “pb_data”
  4. Right click on each folder and go to Properties
  5. Click on advanced options -> Make inherited permissions explicit
  6. Double click on Everyone -> Click on “Write” to enable write permissions
  7. Click on “Apply to this folder, sub folders and files” and click OK
  1. Go to Control Panel -> Login portal
  2. Inside Login portal -> click Advanced tab -> Reverse proxy
  3. Set proxy name to pocketbase. Port 443. Enable HSTS and set destination port to 8121. Hostname set it to pocketbase.yourname.synology.me. If you don’t have a synology.me account, you need to set up a wildcard ID and reverse proxy back.

4. Click on Customer Header -> Create Web socket

    Now you’ve got the files and reverse proxy, we can move onto next steps.

    Installing Pocketbase Container

    1. Go to Portainer -> Stacks
    2. Press Add stack and choose web editor. In the web editor, edit the below YAML file and paste it in
    services:
      pocketbase:
        image: ghcr.io/muchobien/pocketbase:0.22.22
        container_name: pocketbase
        restart: unless-stopped
        user: "1027:100"
        command:
          - --encryptionEnv
          - ENCRYPTION
        environment:
          ENCRYPTION: {insert your own}
          TZ: Asia/Hong_Kong 
          VIRTUAL_HOST: pocketbase.rumjahn.synology.me
          VIRTUAL_PORT: 8124
        ports:
          - "8124:8090"
        volumes:
          - /volume1/docker/pocketbase/pb_data:/pb_data
          - /volume1/docker/pocketbase/pb_public:/pb_public
          - /volume1/docker/pocketbase/pb_hooks:/pb_hooks
        healthcheck:
          test: wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1
          interval: 5s
          timeout: 5s
          retries: 5

    There are 3 small parts to this:

    1. Find your UID and GID.
    2. Find your own timezone
    3. Create your own encryption key

    3. Once you’re done, you can click on deploy!

    4. After deploying, you can access it through: https://pocketbase.yourname.synology.me/_

    Yes, add the “_” add the end of the URL to access your pocketbase and you’re done!

    Leave a Reply

    Your email address will not be published. Required fields are marked *