🔓 **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
- Go to files –> Docker
- Create a “pocketbase” folder
- Inside pocketbase create 3 more folders: “pb_hooks”, “pb_public” and “pb_data”
- Right click on each folder and go to Properties
- Click on advanced options -> Make inherited permissions explicit
- Double click on Everyone -> Click on “Write” to enable write permissions
- Click on “Apply to this folder, sub folders and files” and click OK
- Go to Control Panel -> Login portal
- Inside Login portal -> click Advanced tab -> Reverse proxy
- 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
- Go to Portainer -> Stacks
- 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:
- Find your UID and GID.
- Find your own timezone
- 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!
You use Portainer, can we use “container manager” from DSM 7?
Kind regards
Yes. If it’s available in container manager, you can use that too.