NewCode CLOUD — 20% off your first month on all cloud VPSClaim

PocketBase on Hong Kong VPS: Single-Binary Backend (2026)

· 1 min read

PocketBase is a Go backend in one executable: embedded SQLite, authentication, file storage, an admin dashboard and a realtime API. It idles at tens of megabytes of RAM, which makes a small Hong Kong VPS an economical home for prototypes, internal tools and modest production apps.


Step 1: Install

PB=0.22.0   # check the releases page for the current version
mkdir -p /opt/pocketbase && cd /opt/pocketbase
wget https://github.com/pocketbase/pocketbase/releases/download/v${PB}/pocketbase_${PB}_linux_amd64.zip
unzip pocketbase_*.zip && rm pocketbase_*.zip
useradd -r -s /sbin/nologin pocketbase
chown -R pocketbase: /opt/pocketbase

Step 2: systemd

cat > /etc/systemd/system/pocketbase.service << 'EOF'
[Unit]
Description=PocketBase
After=network.target

[Service]
User=pocketbase
WorkingDirectory=/opt/pocketbase
ExecStart=/opt/pocketbase/pocketbase serve --http=127.0.0.1:8090
Restart=always
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now pocketbase

Step 3: Nginx and TLS

server {
    listen 443 ssl http2;
    server_name pb.example.com;
    client_max_body_size 20m;
    location / {
        proxy_pass http://127.0.0.1:8090;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 360s;
    }
}

Step 4: Client and Backup

import PocketBase from 'pocketbase'
const pb = new PocketBase('https://pb.example.com')
await pb.collection('users').authWithPassword('a@b.com', 'password123')
const list = await pb.collection('posts').getList(1, 20, { sort: '-created' })

# Nightly backup (stop-free, uses SQLite online backup)
curl -X POST -H "Authorization: $ADMIN_TOKEN" https://pb.example.com/api/backups
# or simply: sqlite3 /opt/pocketbase/pb_data/data.db ".backup '/backup/pb.db'"

Conclusion

PocketBase on a Hong Kong VPS is the lowest-overhead way to get auth, storage and a REST API running. It scales vertically on one node, so choose it for small to mid-sized workloads rather than horizontally scaled systems.

Try it on a small plan: Browse Server.HK Hong Kong VPS plans.

Related articles

More in VPS & ServersServer setup guides