Databases

Install PocketBase on Ubuntu with Nginx and HTTPS (New URL)

PocketBase has left GitHub. The pocketbase/pocketbase repository was archived after its final commit on 26 October 2026, and the release zips, checksums.txt and the Go module path now live on ganigeorgiev.com. Any install script, Dockerfile or Go import that still points at github.com is stuck on the last GitHub build, and it fails with a 404 the day it pins a newer version.

Original content from computingforgeeks.com - post 200179

This guide is the setup we’d hand a small team today. You install PocketBase from the new release URL, verify the checksum, and run it as a locked-down systemd service behind Nginx with a Let’s Encrypt certificate. Then you update it without losing data, and fix the pipelines that still expect GitHub. Every step was tested on Ubuntu 26.04 and 24.04 against the PocketBase release current in November 2026.

What moved off GitHub, and what still works

Only the distribution channel changed. PocketBase is still one Go binary with SQLite inside, it still serves the API and the admin dashboard on the same port, and your pb_data directory carries over untouched. What broke is everything that downloads or imports it, because those paths were all built around GitHub. We probed each old and new location from the lab, and the split is clean.

What you useOld locationNew location
Release zipsgithub.com/pocketbase/pocketbase/releases/download/...ganigeorgiev.com/meta/pocketbase/pocketbase/download/v<version>/<file>
Release listGitHub Releases pageganigeorgiev.com/pocketbase/pocketbase/releases
Go modulegithub.com/pocketbase/pocketbaseganigeorgiev.com/pocketbase/pocketbase
pocketbase updateGitHub API (older binaries)The new host (the last GitHub build onward)
Versions servedUp to the 0.40.x lineThe 0.41.x line onward

The overlap is zero. Old releases return 404 on the new host and new releases return 404 on GitHub, so a script cannot simply swap one hostname for the other if it also pins an old version. That’s the trap most broken pipelines fall into: they fix the URL, keep the pin, and fail again with a different 404. The upstream PocketBase changelog records both halves: v0.40.6 replaced the GitHub update command, and v0.41.0 migrated the Go module to the new host. The page renders with JavaScript, so open it in a browser rather than with curl.

Most install guides you will find predate the move. On 30 November 2026 we checked four popular Ubuntu install guides, from CubePath, SysBrix, PerLod and Stack Harbor, and every one still downloads from github.com/pocketbase/pocketbase/releases. CubePath’s version lookup goes through the GitHub API, which now returns v0.40.6 forever, so copying any of them today installs an old build without an error. The download section below uses the new host instead.

Apps that ship PocketBase inside their own binary, such as the Beszel server monitoring hub, aren’t affected by any of this. They update through their own releases, and the move only matters to their maintainers. If you’re weighing PocketBase against a heavier backend, our self-hosted Supabase guide shows what the Postgres-based alternative costs to run.

Prerequisites

PocketBase is light enough that the server choice is about storage and memory headroom, not CPU. The list below is what the steps assume.

  • Ubuntu 26.04 or 24.04 with a sudo user
  • A DNS A record for your hostname, here pb.example.com
  • Ports 22, 80 and 443 open; 80 stays open for Let’s Encrypt renewals
  • An amd64 or arm64 machine (swap amd64 for arm64 in the file names)

On our test server, an e2-small with 2 vCPUs and 2 GB of RAM, the PocketBase service sat at about 12 MB of memory after start, and pb_data was 3.2 MB with one uploaded file. Treat that as a floor, not a target, because an idle instance with one record tells you nothing about load. Three things grow the footprint in production.

  • Uploaded files, kept on local disk unless you configure S3
  • Image thumbnails, which upstream names one of the main causes of OOM kills
  • Concurrent realtime connections, each holding an open file

For a small team app, 1 to 2 vCPUs, 2 to 4 GB of RAM and a disk sized for your uploads plus two backups is a comfortable range. Size the disk first, because uploads and backups both land on it and a full disk stops every database write. A cheap VPS covers that range easily.

Preparing the server and firewall

Your hostname appears in several commands, so export it once. Replace the value with your own domain before running anything else in this guide.

export DOMAIN=pb.example.com

Then install Nginx along with the two tools the download step needs. Ubuntu’s own Nginx package is fine here, because PocketBase only needs a plain reverse proxy and the distro build gets security fixes through normal updates. That also means you never have to add a third-party repository to this server.

sudo apt update
sudo apt install -y nginx unzip curl

PocketBase will listen on 127.0.0.1 only, so the firewall needs SSH and the two Nginx ports, nothing more. Allow SSH before you enable UFW, because without that rule UFW refuses new SSH connections and your next login to a remote box fails.

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw --force enable
sudo ufw status

The status should list OpenSSH and Nginx Full for both IPv4 and IPv6. Nginx Full is the profile that opens 80 and 443 together, so certbot can answer its HTTP challenge and renewals keep working later. If either line is missing, fix it now rather than debugging a certificate failure in the next section.

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)

Port 8090 never appears in that list, and it shouldn’t. Our UFW firewall guide for Ubuntu covers rate limiting and per-source rules if you want to tighten SSH further.

Downloading PocketBase from the new release URL

Hardcoding a version is how scripts end up stuck, so ask the new host for the latest release instead. Its release list is itself a public PocketBase API, which means a single curl call returns the newest tag sorted by semantic version. The filter matters because the same host lists releases of other projects too.

export PB_VERSION=$(curl -sG https://ganigeorgiev.com/api/collections/releases/records --data-urlencode "perPage=1" --data-urlencode "sort=-semver" --data-urlencode 'filter=channel.repository.name="pocketbase" && channel.repository.project.name="pocketbase"' | grep -o '"tag":"v[^"]*"' | cut -d'"' -f4 | sed 's/^v//')
echo "$PB_VERSION"

It printed the current release on our server. If the variable comes back empty, the server cannot reach ganigeorgiev.com, so stop here and check DNS or the egress firewall. Every later command builds its URL from this value, and an empty one produces confusing 404s.

0.42.3

Now fetch the zip and the checksum file. The -L flag matters here: the predictable URL answers with a 307 redirect to the real file, and without -L curl saves an empty body and the checksum check fails for no obvious reason.

cd /tmp
curl -fLO "https://ganigeorgiev.com/meta/pocketbase/pocketbase/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip"
curl -fLO "https://ganigeorgiev.com/meta/pocketbase/pocketbase/download/v${PB_VERSION}/checksums.txt"
sha256sum -c --ignore-missing checksums.txt

A single OK line means the zip matches the SHA-256 the release published.

pocketbase_0.42.3_linux_amd64.zip: OK

Don’t skip this on a new host you haven’t downloaded from before. The --ignore-missing flag only tells sha256sum to ignore the other platforms listed in checksums.txt; if your zip is corrupted it still fails loudly, as the troubleshooting section shows.

Creating the pocketbase user and directories

Most quick-start guides run the binary from a home directory and let it write pb_data next to itself. That works until an update replaces the binary as the wrong user, and then the service either can’t start or can rewrite its own executable. We split the two instead.

  • /opt/pocketbase: the binary, owned by root, read-only to the service
  • /var/lib/pocketbase/pb_data: the SQLite databases and uploads, owned by pocketbase
  • pocketbase: a system user with no shell and no login

Create the user and both directories, unpack the zip from /tmp, and hand only the data side to the service account.

sudo useradd --system --home-dir /var/lib/pocketbase --shell /usr/sbin/nologin pocketbase
sudo mkdir -p /opt/pocketbase /var/lib/pocketbase
sudo unzip -o "pocketbase_${PB_VERSION}_linux_amd64.zip" -d /opt/pocketbase
sudo chown -R pocketbase:pocketbase /var/lib/pocketbase

Check the binary landed with root ownership and reports its version.

ls -l /opt/pocketbase
/opt/pocketbase/pocketbase --version

The zip holds just three files, and only one of them matters at runtime.

total 32792
-rw-r--r-- 1 root root    15834 Nov 16 16:06 CHANGELOG.md
-rw-r--r-- 1 root root     1090 Nov  1 21:57 LICENSE.md
-rwxr-xr-x 1 root root 33554592 Nov 16 16:17 pocketbase
pocketbase version 0.42.3

Because the service user can’t write to /opt/pocketbase, a compromised PocketBase process can’t replace its own executable. The trade-off is that updates run as root, and we deal with the ownership that leaves behind in the update section.

Running PocketBase as a hardened systemd service

The unit below binds PocketBase to loopback, points it at the data directory and applies systemd’s sandboxing, so the process can write only to /var/lib/pocketbase. Create the unit file.

sudo vim /etc/systemd/system/pocketbase.service

Paste the following. It is the same file that ran on both test servers, and the sandboxing lines below the blank line are the part most guides leave out.

[Unit]
Description=PocketBase
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=pocketbase
Group=pocketbase
WorkingDirectory=/var/lib/pocketbase
ExecStart=/opt/pocketbase/pocketbase serve --http=127.0.0.1:8090 --dir=/var/lib/pocketbase/pb_data
Environment=GOMEMLIMIT=1024MiB
LimitNOFILE=4096
Restart=always
RestartSec=5s

NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/var/lib/pocketbase
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
LockPersonality=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
CapabilityBoundingSet=
UMask=0027

[Install]
WantedBy=multi-user.target

Two lines come straight from the PocketBase going to production notes. LimitNOFILE lifts the usual 1024 open-file default, which realtime connections exhaust first. GOMEMLIMIT is a soft limit that makes the Go garbage collector work harder before the kernel’s OOM killer steps in; we set it to half the RAM so Nginx keeps room. If you still see OOM kills, upstream’s advice is to add swap.

Load the unit and start it at boot.

sudo systemctl daemon-reload
sudo systemctl enable --now pocketbase
systemctl status pocketbase --no-pager

The status shows the service active, and the journal lines at the bottom matter more than the header. The last two hold a one-time installer link for the first superuser, so keep this output handy until that account exists.

● pocketbase.service - PocketBase
     Loaded: loaded (/etc/systemd/system/pocketbase.service; enabled; preset: enabled)
     Active: active (running) since Mon 2026-11-30 10:49:10 UTC; 3s ago
 Invocation: a79a0be9f58f46dd95576030b365b1a0
   Main PID: 3546 (pocketbase)
      Tasks: 8 (limit: 1896)
     Memory: 11.2M (peak: 11.2M)
        CPU: 249ms
     CGroup: /system.slice/pocketbase.service
             └─3546 /opt/pocketbase/pocketbase serve --http=127.0.0.1:8090 --dir=/var/lib/pocketbase/pb_data

Nov 30 10:49:10 pb01 systemd[1]: Started pocketbase.service - PocketBase.
Nov 30 10:49:11 pb01 pocketbase[3546]: 2026/11/30 10:49:11 Server started at http://127.0.0.1:8090
Nov 30 10:49:11 pb01 pocketbase[3546]: > Dashboard: http://127.0.0.1:8090/_/
Nov 30 10:49:11 pb01 pocketbase[3546]: > REST API:  http://127.0.0.1:8090/api/
Nov 30 10:49:11 pb01 pocketbase[3546]: (!) Launch the URL below in the browser if it hasn't been open already to create your first superuser account:
Nov 30 10:49:11 pb01 pocketbase[3546]: http://127.0.0.1:8090/_/#/pbinstall/<superuser-token>
Nov 30 10:49:11 pb01 pocketbase[3546]: (you can also create your first superuser by running: /opt/pocketbase/pocketbase superuser upsert EMAIL PASS)

Confirm the health endpoint answers and that the port is bound to loopback only.

curl -s http://127.0.0.1:8090/api/health
ss -tlnp | grep 8090

The listener should show 127.0.0.1:8090, never 0.0.0.0. A wildcard bind would expose the API without TLS, and it would also let clients forge the proxy header we trust later. So if you see 0.0.0.0, recheck the --http flag in the unit before going further.

{"message":"API is healthy.","code":200,"data":{}}
LISTEN 0      4096       127.0.0.1:8090      0.0.0.0:*

For a quick read on the sandboxing, systemd-analyze security pocketbase scored the unit at 4.3 (“OK”) on both Ubuntu releases. The remaining exposure is mostly network access, which a web backend needs anyway.

Putting Nginx and HTTPS in front of PocketBase

Nginx terminates TLS, enforces an upload size limit and forwards everything to the loopback port. Create a server block for your domain.

sudo vim /etc/nginx/sites-available/pocketbase

Add this configuration, with your own hostname on the server_name line. The empty Connection header and the 360 second read timeout keep PocketBase’s realtime server-sent events alive through the proxy. Leave them out and subscriptions drop after Nginx’s default 60 seconds, so clients reconnect in a loop.

server {
    listen 80;
    listen [::]:80;
    server_name pb.example.com;

    client_max_body_size 10M;

    location / {
        proxy_set_header Connection '';
        proxy_http_version 1.1;
        proxy_read_timeout 360s;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_pass http://127.0.0.1:8090;
    }
}

Enable the site, test the syntax and reload.

sudo ln -s /etc/nginx/sites-available/pocketbase /etc/nginx/sites-enabled/pocketbase
sudo nginx -t
sudo systemctl reload nginx

With the config accepted, install certbot and its Nginx plugin, then request the certificate. The flags make it non-interactive and add the HTTP to HTTPS redirect in the same pass. Swap --register-unsafely-without-email for -m and a real address if you want a contact on the ACME account.

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d "$DOMAIN" --register-unsafely-without-email --agree-tos --redirect -n

Certbot edits the server block in place and reports where it deployed the certificate. It adds the 443 listener and certificate paths to our file and writes a separate port 80 block for the redirect, so you do not maintain TLS lines by hand. Keep that in mind when you edit the file later, because the proxy settings now live in the HTTPS server.

Account registered.
Requesting a certificate for pb.example.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/pb.example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/pb.example.com/privkey.pem
This certificate expires on 2027-02-28.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for pb.example.com to /etc/nginx/sites-enabled/pocketbase
Congratulations! You have successfully enabled HTTPS on https://pb.example.com

Test the public endpoint over HTTPS. A healthy JSON reply here proves DNS, the certificate, Nginx and the service all line up.

curl -s "https://$DOMAIN/api/health"

The reply is the same one you got on loopback. Earlier, on plain HTTP right after the first systemctl reload nginx, our first request returned an Nginx 404 page while the reload was still taking effect, and a second try a moment later worked. If you see a 404 page at either stage, wait a few seconds before you start debugging the config.

{"message":"API is healthy.","code":200,"data":{}}

The Ubuntu 24.04 server ran an older certbot and Nginx than 26.04 did and produced the same result with the same commands. For more on certbot’s options and renewals, see our guide to Let’s Encrypt certificates with certbot, and the Nginx on Ubuntu 26.04 guide if you’re setting up the web server from scratch.

Using DNS-01 when port 80 is closed

HTTP-01 needs port 80 reachable from the internet. If PocketBase sits on a private network or behind a VPN, issue the certificate through a DNS challenge instead and point the ssl_certificate lines at the result. Our walkthrough on Let’s Encrypt on a private network with Cloudflare covers the DNS plugin setup.

Creating the superuser and locking down the dashboard

Until a superuser exists, anyone who has the installer link can claim the instance, so do this right after HTTPS works. The journal printed the link with 127.0.0.1:8090 in it, which your browser can’t reach. Pull it back out and swap that part for your domain. The token in that link expires 30 minutes after the service starts, and each restart prints a fresh one, so if the Nginx and certificate steps took longer, run sudo systemctl restart pocketbase first and use the last link the journal shows.

sudo journalctl -u pocketbase --no-pager | grep pbinstall | tail -1

Open https://pb.example.com/_/#/pbinstall/ followed by the token in your browser. Fill in the Email field (1) and a long password twice, then click Create superuser and login (2).

PocketBase installer page with the Email field and Create superuser and login button marked
  1. 1Email
  2. 2Create superuser and login

On a server you only reach over SSH, the CLI does the same job. The journal’s hint leaves out --dir, and without it the command tries to create pb_data next to the binary and fails, so pass the data directory explicitly and run it as the service user.

sudo -u pocketbase /opt/pocketbase/pocketbase superuser upsert [email protected] 'Lab-pass-12345' --dir=/var/lib/pocketbase/pb_data

Use your own address and a real passphrase, and note that the password lands in your shell history. The command confirms the account.

Successfully saved superuser "[email protected]"!

After login the dashboard opens on the built-in users auth collection, with the release number shown in the bottom right corner. That footer is the quickest way to confirm which build a server runs without SSH.

PocketBase dashboard showing the default users collection after the first login

From here you can create collections and API rules in the browser. Before you hand the URL to anyone, though, fix how PocketBase sees client addresses.

Trusting the right proxy header

Behind Nginx, every request reaches PocketBase from 127.0.0.1. Until you change a setting, the dashboard reports exactly that, which breaks rate limiting and makes the request logs useless. Go to Settings, then Application, and expand IP proxy headers. Type X-Real-IP into Trusted IP proxy headers (1), leave IP priority on “Use rightmost IP” and click Save changes. Resolved user IP (2) then shows your real address and the detected header changes to X-Real-IP.

PocketBase IP proxy headers settings with Trusted IP proxy headers set to X-Real-IP and the resolved user IP
  1. 1Trusted IP proxy headers
  2. 2Resolved user IP

We trust X-Real-IP rather than X-Forwarded-For because our Nginx block overwrites it with $remote_addr on every request, so a client can’t spoof it. The trust only holds because port 8090 is bound to loopback; expose it publicly and anyone can send the header. Further down the same page, Rate limiting and Superuser IPs are both disabled by default. Turn on rate limiting now that the IP is real, and if your team works from fixed addresses or a VPN, list them under Superuser IPs so the dashboard login refuses everyone else.

To check uploads work through the proxy, we created a documents collection with a file field and added a record with a small attachment.

PocketBase documents collection with one record and an uploaded file

That file lands under pb_data/storage, which is why the backup step later archives the whole directory rather than just the database files.

Updating PocketBase after the move

The built-in update command still works, it just talks to the new host now. With our layout it needs three things the quick-start skips: the service stopped so SQLite isn’t mid-write, --dir so it backs up the right data, and an ownership fix afterwards. Run the four commands in this order, because starting the service before the chown leaves it facing root-owned files.

sudo systemctl stop pocketbase
sudo /opt/pocketbase/pocketbase update --dir=/var/lib/pocketbase/pb_data
sudo chown -R pocketbase:pocketbase /var/lib/pocketbase
sudo systemctl start pocketbase

On the Ubuntu 24.04 server, which started one patch release behind, the update downloaded the new zip, swapped the binary and took a backup first.

Fetching release information...
Downloading pocketbase_0.42.3_linux_amd64.zip...
Extracting pocketbase_0.42.3_linux_amd64.zip...
Replacing the executable...
Creating pb_data backup...

The chown line earns its place in the next listing. We looked at the data directory straight after the update, before the ownership fix, and the backup was written as root.

/var/lib/pocketbase/pb_data:
total 988
-rw-r----- 1 pocketbase pocketbase  40960 Nov 30 10:59 auxiliary.db
drwxr-xr-x 2 root       root         4096 Nov 30 10:59 backups
-rw-r----- 1 pocketbase pocketbase 159744 Nov 30 10:59 data.db
-rw-r----- 1 pocketbase pocketbase 803467 Nov 30 10:58 types.d.ts

/var/lib/pocketbase/pb_data/backups:
total 228
-rw-r--r-- 1 root root 229372 Nov 30 10:59 @update_v0.42.3.zip
-rw-r--r-- 1 root root    240 Nov 30 10:59 @update_v0.42.3.zip.attrs

Skip the fix and the service still starts, but it can’t write new backups into a root-owned directory or delete that archive from the dashboard. The pre-update backup also shows up under Settings, then Backups, where you can download or restore it.

PocketBase Backups page listing the automatic pre-update backup archive

Running the update again once you’re current is a cheap way to check that a server can reach the new host at all. It changes nothing when there’s no newer release.

Fetching release information...
You already have the latest version 0.42.3.

Don’t turn this into an unattended cron job, though. When a newer release exists, the same command replaces the binary straight away, without the stop, backup copy and ownership fix around it.

The whole post-update check on the 24.04 server fits in one terminal: service active, binary reporting the new version, the public health endpoint answering through Nginx, and the update command confirming nothing newer is waiting.

Terminal on Ubuntu showing PocketBase active at version 0.42.3 after the update, a healthy API and the update command reporting the latest version

If any of those four lines disagrees, for example the version still shows the old release, the running process most likely predates the binary swap, so check systemctl status pocketbase before touching anything else.

Servers still on an older GitHub build

A binary older than the last GitHub release only knows the GitHub API, so it needs two runs. We started a test instance on the 0.40.x line one patch below the final GitHub build and logged the DNS lookups of each run. Trimmed to the download lines, the two runs look like this.

pocketbase version 0.40.5
Fetching release information...
Downloading pocketbase_0.40.6_linux_amd64.zip...
Creating pb_data backup...
Update completed successfully! You can start the executable as usual.
pocketbase version 0.40.6
Fetching release information...
Downloading pocketbase_0.42.3_linux_amd64.zip...
Creating pb_data backup...
pocketbase version 0.42.3

The DNS log is what explains it. A tcpdump on port 53 during each run caught these lookups, leaving out the VM’s own internal hostname.

run 1 hosts:
A? api.github.com.
A? github.com.
A? release-assets.githubusercontent.com.
run 2 hosts:
A? ganigeorgiev.com.

So the two runs do different jobs:

  1. Run one queried api.github.com, github.com and release-assets.githubusercontent.com, and installed the final GitHub build, whose update command points at the new host.
  2. Run two queried only ganigeorgiev.com and jumped straight to the current release.

Each run took its own @update_ backup. If your servers sit behind an egress allowlist, add ganigeorgiev.com before the second run, or it fails after the first one looks successful. Fleet scripts that run update once a week will land on the final GitHub build and stay there until someone runs it twice.

Fixing Dockerfiles, scripts and Go imports

The binary update is the easy part. The real breakage after the move is in automation that builds PocketBase from a URL. Three patterns cover almost every case.

Dockerfiles

Upstream added a predictable download URL for exactly this case: https://ganigeorgiev.com/meta/pocketbase/pocketbase/download/{tag}/{file}, which redirects to the real file. This is the Dockerfile we built and ran, trimmed from the official example with the download line pointed at the new host.

FROM alpine:latest

ARG PB_VERSION=0.42.3

RUN apk add --no-cache \
    unzip \
    ca-certificates

# download and unzip PocketBase from the new host (GitHub releases stop at v0.40.6)
ADD https://ganigeorgiev.com/meta/pocketbase/pocketbase/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /pb/ && rm /tmp/pb.zip

EXPOSE 8080

CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]

Docker’s ADD follows the redirect, so no extra tooling is needed. Our lab used Ubuntu’s own docker.io package (sudo apt install -y docker.io). From the directory holding the Dockerfile, build and run it with the data on a named volume, published on loopback for Nginx to proxy.

sudo docker build -t pocketbase:0.42.3 .
sudo docker run -d --name pb -p 127.0.0.1:8080:8080 -v pb_data:/pb/pb_data pocketbase:0.42.3
curl -s http://127.0.0.1:8080/api/health

The container came up healthy on the first build. Publishing on 127.0.0.1 matters for the same reason as the systemd bind, because Docker writes its own firewall rules and a plain -p 8080:8080 skips UFW entirely. Point the Nginx proxy_pass at port 8080 instead of 8090 if you run the container.

Successfully built 5cf3d67ad520
Successfully tagged pocketbase:0.42.3
840c4a287de4912f70d96c5d8b4df067b97aec9ff566b584ee2218a2c9e82e7d
{"message":"API is healthy.","code":200,"data":{}}

Pinning matters more now. A build argument from the 0.40.x line fails against the new URL, because those releases were never copied over. In Docker, upgrade by bumping PB_VERSION and rebuilding; don’t run update inside the container, since a replaced binary disappears with the container.

Update scripts that still pull from GitHub

This is the failure that doesn’t announce itself. A typical home-grown update script asks the GitHub API for the latest tag and downloads that zip. Since the archive, that API returns v0.40.6 forever, so the script keeps “succeeding” and quietly installs an old build. This is the GitHub API lookup CubePath uses, wrapped into an update script that we ran as pb-update-github.sh on our test server.

#!/usr/bin/env bash
set -euo pipefail
PB_VERSION=$(curl -fsSL https://api.github.com/repos/pocketbase/pocketbase/releases/latest | grep -o '"tag_name": *"v[^"]*"' | cut -d'"' -f4 | sed 's/^v//')
cd /tmp
curl -fsSLO "https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip"
unzip -oq "pocketbase_${PB_VERSION}_linux_amd64.zip" pocketbase
systemctl stop pocketbase
install -o root -g root -m 0755 pocketbase /opt/pocketbase/pocketbase
systemctl start pocketbase
/opt/pocketbase/pocketbase --version

We ran it on a test Ubuntu 26.04 VM on 30 November 2026, then asked the GitHub API directly what it considers the latest release.

pocketbase version 0.40.6
  "tag_name": "v0.40.6",

No error, and a server two minor releases behind. The replacement below resolves the version from the new host’s release API (the same query as the download section), verifies the zip against checksums.txt, skips the run when the server is already current, and takes the same cold pb_data tarball described in the backup section below. Save it as /usr/local/sbin/pb-update.sh.

Open the file:

sudo vim /usr/local/sbin/pb-update.sh

Paste the script:

#!/usr/bin/env bash
set -euo pipefail
BASE=https://ganigeorgiev.com/meta/pocketbase/pocketbase/download
PB_VERSION=$(curl -fsSG https://ganigeorgiev.com/api/collections/releases/records --data-urlencode "perPage=1" --data-urlencode "sort=-semver" --data-urlencode 'filter=channel.repository.name="pocketbase" && channel.repository.project.name="pocketbase"' | grep -o '"tag":"v[^"]*"' | cut -d'"' -f4 | sed 's/^v//')
[ -n "$PB_VERSION" ] || { echo "could not resolve the latest release" >&2; exit 1; }
CURRENT=$(/opt/pocketbase/pocketbase --version | awk '{print $3}')
if [ "$CURRENT" = "$PB_VERSION" ]; then echo "already on $CURRENT"; exit 0; fi
WORK=$(mktemp -d)
cd "$WORK"
curl -fsSLO "$BASE/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip"
curl -fsSLO "$BASE/v${PB_VERSION}/checksums.txt"
sha256sum -c --ignore-missing checksums.txt
unzip -oq "pocketbase_${PB_VERSION}_linux_amd64.zip" pocketbase
systemctl stop pocketbase
mkdir -p /var/backups/pocketbase
tar -C /var/lib/pocketbase -czf "/var/backups/pocketbase/pb_data-$(date +%F-%H%M).tar.gz" pb_data
install -o root -g root -m 0755 pocketbase /opt/pocketbase/pocketbase
systemctl start pocketbase
cd /
rm -rf "$WORK"
echo "updated $CURRENT -> $PB_VERSION"
/opt/pocketbase/pocketbase --version

The cd / before the cleanup is there because our first version deleted its own working directory and the final --version call complained with getwd: no such file or directory. Make it executable and run it on the server that the old script left on v0.40.6.

sudo chmod 0755 /usr/local/sbin/pb-update.sh
sudo /usr/local/sbin/pb-update.sh

One run took the server from the final GitHub build to the current release, checksum first.

pocketbase_0.42.3_linux_amd64.zip: OK
updated 0.40.6 -> 0.42.3
pocketbase version 0.42.3

The service came back active, the health endpoint answered, and /var/backups/pocketbase held a fresh pb_data-2026-11-30-1151.tar.gz. A second run printed already on 0.42.3 and touched nothing, which is the behaviour you want before you schedule it. Because it never asks the installed binary to update itself, the script does not care which build is on the server, so the two-run dance from the previous section does not apply to it.

Go projects that extend PocketBase

The old import path still resolves, which makes this failure quiet. Go fetches the archived repository and pins you to the last GitHub build without any error. We ran go mod tidy in the golang:1.27 image on the README’s hello-world app with each import path. The old one resolved like this.

require github.com/pocketbase/pocketbase v0.40.6
	github.com/pocketbase/dbx v1.12.0 // indirect
	github.com/pocketbase/ozzo-validation/v4 v4.3.0 // indirect

To move, change the import prefix in every .go file from github.com/pocketbase/pocketbase to ganigeorgiev.com/pocketbase/pocketbase. The import block at the top of our main.go ended up as shown here.

import (
	"log"

	"ganigeorgiev.com/pocketbase/pocketbase"
	"ganigeorgiev.com/pocketbase/pocketbase/core"
)

Then let Go rewrite the module file and build a static binary. go mod tidy drops the old requirement on its own once nothing imports it.

go mod tidy
grep pocketbase go.mod
CGO_ENABLED=0 go build -o myapp .

The require line now follows the new host, and the dependencies PocketBase maintains moved with it.

require ganigeorgiev.com/pocketbase/pocketbase v0.42.3
	ganigeorgiev.com/pocketbase/dbx v1.13.0 // indirect
	ganigeorgiev.com/pocketbase/ozzo-validation/v4 v4.4.1 // indirect

The upstream README asks for a recent Go toolchain; install Go on Ubuntu from the official tarball if the distro package is behind. Search the whole repository, including CI files, for the old path: one stray go get github.com/pocketbase/... in a pipeline puts the old module back.

Backing up pb_data before every update

The @update_ zip is a convenience, not a backup, because it sits on the same disk as the data it protects. Before any update, and on a schedule, take a cold copy somewhere else. Stopping the service first keeps SQLite’s WAL files consistent with the database, so the archive restores without recovery.

sudo mkdir -p /var/backups/pocketbase
sudo systemctl stop pocketbase
sudo tar -C /var/lib/pocketbase -czf /var/backups/pocketbase/pb_data-$(date +%F-%H%M).tar.gz pb_data
sudo systemctl start pocketbase

List the archive to confirm the uploaded files went in along with the database.

sudo tar -tzf "$(ls -t /var/backups/pocketbase/pb_data-*.tar.gz | head -1)" | head -8

The storage path holds the attachment we uploaded earlier. Restoring means stopping the service, moving the current pb_data aside (extracting on top of it would keep newer uploads and stale -wal files the archive never had), extracting the archive into /var/lib/pocketbase and running the same chown as after an update.

pb_data/
pb_data/types.d.ts
pb_data/data.db
pb_data/.notify/
pb_data/storage/
pb_data/storage/pbc_3332084752/
pb_data/storage/pbc_3332084752/qhdxbzerkazvpc1/
pb_data/storage/pbc_3332084752/qhdxbzerkazvpc1/small_qhafb1hfmj.bin

The stop costs a few seconds of downtime. If that’s not acceptable, the dashboard’s Initialize new backup button and its scheduled backup options take online snapshots, and can push them to S3. Copy whichever archive you use off the server; a backup on the same disk dies with it.

Troubleshooting

These are the errors we hit or reproduced on the test servers, with the fix for each.

“curl: (22) The requested URL returned error: 404”

An install script that builds a GitHub release URL for a current version gets this error from curl.

curl: (22) The requested URL returned error: 404

GitHub has nothing newer than the final 0.40.x build. Point the script at the ganigeorgiev.com/meta/... URL from the download section. The reverse also fails: an old version against the new host returns 404, so check both the host and the pinned version.

“ADD failed: … 404 Not Found” in docker build

This is the same mismatch inside a Dockerfile. Our build with the new URL and an old pinned version stopped at the ADD step.

ADD failed: failed to GET https://ganigeorgiev.com/meta/pocketbase/pocketbase/download/v0.40.5/pocketbase_0.40.5_linux_amd64.zip with status 404 Not Found: {"data":{},"message":"Release file is missing or invalid.","status":404}

A JSON body like that comes from the new host and means the version doesn’t exist there. A plain Not Found body comes from GitHub and means the version is too new for it. Bump the version for the first case and fix the URL for the second.

“computed checksum did NOT match”

We flipped one byte in a downloaded zip to see what a bad download looks like. The check catches a single changed byte, so it also catches truncated or swapped files. In our run sha256sum also exited with status 1, which means a script with set -e stops right here.

pocketbase_0.42.3_linux_amd64.zip: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match

Delete the zip and download it again with -fLO. The usual culprit is a curl call without -L, which saves the redirect response instead of the file, or a proxy that rewrites downloads. Never unzip a file that failed this check.

“mkdir /opt/pocketbase/pb_data: permission denied”

This comes from running a CLI subcommand as the service user without telling it where the data lives.

2026/11/30 10:59:38 mkdir /opt/pocketbase/pb_data: permission denied

PocketBase defaults to pb_data beside the executable, and the service user can’t write to /opt/pocketbase by design. Pass the same --dir path the unit file uses to every CLI subcommand you run against this instance. Running as root without it is worse, because it quietly creates a second, empty data directory.

“413 Request Entity Too Large” on uploads

A 2 MB upload through our proxy returned 200, and a 12 MB one got an Nginx error page instead of a PocketBase response. The Nginx error log names the cause.

2026/11/30 11:10:25 [error] 4225#4225: *582 client intended to send too large body: 12583226 bytes, client: 203.0.113.10, server: pb.example.com, request: "POST /api/collections/documents/records HTTP/1.1", host: "pb.example.com"

Raise client_max_body_size in the server block, then run sudo nginx -t and reload. Certbot rewrote the block into two servers, so make sure the change lands in the one that listens on 443. The file field’s own max size in the collection settings has to allow the upload too.

Keeping it running

Day to day, three checks keep a PocketBase server out of trouble. None of them takes more than a minute, so put them on the same calendar reminder as the backup.

  • Certificate renewal: sudo certbot renew --dry-run passed on our servers, and certbot.timer runs renewals on its own
  • Updates: a monthly cold backup, then the four-command update, then the health check over HTTPS
  • The one log to watch: journalctl -u pocketbase, where restarts and OOM kills show up first

If the journal shows the service restarting under load, look at thumbnail generation before you add RAM; upstream lists it among the main causes of memory spikes, and the PB_THUMBS_MAX_SOURCE_PIXELS environment variable caps it. For an at-a-glance view of the box itself, the PocketBase-based Beszel monitoring hub tracks CPU, memory and disk with alerts. And if the team outgrows hand-run services, Coolify on Ubuntu can host the Docker image above with deploys, backups and TLS handled from one panel.

Keep reading

Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) Ubuntu Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Backup and Restore Linux Systems with Timeshift Debian Backup and Restore Linux Systems with Timeshift Build a FHIR MCP Server for MedGemma 2 with Ollama AI Build a FHIR MCP Server for MedGemma 2 with Ollama Run MedGemma 2 Locally with Ollama and FHIR Tool Calling AI Run MedGemma 2 Locally with Ollama and FHIR Tool Calling How to Install Apache Tika on Ubuntu 22.04|20.04|18.04 Apache How to Install Apache Tika on Ubuntu 22.04|20.04|18.04

Leave a Comment

Press ESC to close