PocketBase is a lightweight, open-source backend that runs from a single file and gives you a database, authentication, file storage, real-time features, and an admin dashboard. It helps you build app backends fast without setting up many separate services, and you can self-host it on your own server. This guide shows you how to install PocketBase on Ubuntu for a real VPS setup with systemd, Caddy, and automatic HTTPS.
PocketBase is completely portable, so you can install it as a single executable and grow from a small test app to a production server.
What You Need to Install PocketBase on Ubuntu
Before you install PocketBase on Ubuntu, make sure your domain already points to the VPS because Caddy can get and renew HTTPS certificates only when the hostname resolves to your server and ports 80 and 443 are open.
To set up PocketBase safely, use a non-root app user, keep the service on localhost, and let Caddy face the public internet. For a small public deployment, a lightweight Linux VPS is a good option for this kind of stack.
If you still need a name for the server, get a custom domain before you turn on HTTPS.
For this setup guide, use a recent Ubuntu LTS server and replace:
At this point, you can install PocketBase on Ubuntu by downloading the binary, putting it in a release folder, and linking current to the active version.
In this guide, we use PocketBase 0.39.4. If your VPS uses ARM64, replace linux_amd64 with linux_arm64 when you download the release file.
At this point, your work to install PocketBase on Ubuntu is nearly done, and the app should listen only on 127.0.0.1:8090 behind the proxy.
You can test the local backend from the server:
Bash
curlhttp://127.0.0.1:8090/api/health
In the output, you must see:
JSON
1{2"message":"API is healthy.",3"code":200,4"data":{}5}
Step 6. Add HTTPS with Caddy for PocketBase
To install PocketBase on Ubuntu for public use, you can put Caddy in front of it instead of exposing port 8090. Make sure your DNS is set up first before using PocketBase's automatic HTTPS. Caddy needs a working hostname plus open ports 80 and 443 to get a certificate.
Also, Caddy handles HTTP to HTTPS redirect and certificate renewal by default when the hostname is set and reachable.
Create the Caddy config file with the command below:
If you got a warning from the validation that Caddyfile input is not formatted, you can fix it by:
Bash
sudocaddyfmt--overwrite/etc/caddy/Caddyfile
Step 7. Access PocketBase Admin Dashboard
The PocketBase admin dashboard is served at /_/. You can access it from your browser by:
Bash
https://yourdomain.com/_/
From the PocketBase dashboard, you can manage your backend in one place, including database collections, users, uploaded files, logs, and settings. You can also create and edit records, manage authentication-related data, check API activity, and handle admin access from the dashboard UI.
After you install PocketBase on Ubuntu behind a reverse proxy, set the User IP proxy headers in PocketBase settings so it can record the real client IP, usually X-Real-IP and X-Forwarded-For.
A safe way for production is to update PocketBase with a new release folder, test it, then move the current symlink. This keeps the layout simple and gives you a quick rollback path if the new version does not act the way you expect.
For real projects, it is recommended to back up pb_data and stop the app first if you use file-copy backups, because PocketBase says copying that directory is enough when the app is not running.
Another reason people install PocketBase on Ubuntu is the simple built-in backup flow in the dashboard, which saves a full ZIP snapshot of pb_data under Settings > Backups.
Now you have a clean way to install PocketBase on Ubuntu with a dedicated user, systemd, Caddy, and automatic HTTPS. You can point your custom domain and run PocketBase on a PerLod Linux VPS for a lightweight backend stack.
We hope you enjoy this guide. For more detailed production information, you can visit the PocketBase production docs.
No. PocketBase can run as a single binary on the server.
The admin login page is available at /_/ on your domain.
No, keep it on 127.0.0.1:8090 and let Caddy handle public traffic.
We use cookies to run PerLod and to understand how the site is used. You can accept everything, or open Manage to turn individual categories off. Cookie policy.