Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host PocketBase on a VPS (Complete Guide)

A complete step-by-step guide to self-hosting PocketBase on a VPS in 2026, covering installation, configuration, security, and the specs you need.

How to Self-Host PocketBase on a VPS (Complete Guide)

PocketBase is a powerful backend solution that allows developers to manage data easily while building applications quickly. Self-hosting PocketBase on a Virtual Private Server (VPS) gives you full control over your data and the ability to customize your deployment. This guide will walk you through the process of setting up PocketBase on popular VPS providers.

Why Self-Host PocketBase?

Self-hosting means you can ensure data privacy, manage updates, and customize the application as you see fit. Compared to managed solutions, self-hosting may also offer cost savings, especially for developers looking to scale their projects.

Selecting a VPS Provider

Here is a comparison of some of the top VPS providers suitable for hosting PocketBase:

ProviderPricingSpecsLink
Contabo VPSโ‚ฌ5.99/mo4 CPU, 8 GB RAM, 200 GB SSDContabo
Hetzner Cloudโ‚ฌ4.15/mo2 CPU, 8 GB RAM, 20 GB SSDHetzner
DigitalOcean$6/mo1 CPU, 1 GB RAM, 25 GB SSDDigitalOcean
Vultr$6/mo1 CPU, 1 GB RAM, 25 GB SSDVultr
Linode (Akamai)$5/mo1 CPU, 2 GB RAM, 25 GB SSDLinode

You can check out our full VPS comparison for more options to suit your needs.

Prerequisites

  1. A VPS with Docker Installed: Most environments listed above support Docker, which simplifies the deployment of PocketBase.
  2. Basic Command Line Knowledge: Familiarity with terminal commands is essential.
  3. Domain (Optional): If you plan to access PocketBase from the web, consider registering a domain.

Installation Steps

Step 1: Connect to Your VPS

Start by connecting to your VPS via SSH. Open your terminal and enter:

ssh username@your_vps_ip_address

Replace username and your_vps_ip_address with your actual login details.

Step 2: Install Docker

If Docker is not pre-installed on your VPS, you can install it by executing the following commands:

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce

Verify the installation:

docker --version

Step 3: Pull the PocketBase Docker Image

With Docker installed, you can now pull the PocketBase image from Docker Hub. Execute:

docker pull pocketbase/pocketbase

Step 4: Create a PocketBase Database

Create a directory on your VPS to store the database files:

mkdir ~/pocketbase

Step 5: Run PocketBase

Now run the PocketBase Docker container. You can customize the command with desired configurations:

docker run -d -p 8090:8090 -v ~/pocketbase:/pb pocketbase/pocketbase serve --dir /pb

This command maps port 8090 from the container to your VPS and stores the database in the ~/pocketbase directory.

Step 6: Access PocketBase

You can access PocketBase by visiting http://your_vps_ip_address:8090 in your web browser. From there, you can start creating your data models and building your applications.

Configuration Tips

FAQs

1. How do I secure my PocketBase instance?

To secure PocketBase, enable a firewall and restrict access to specific IPs if possible. You should also run your PocketBase instance behind a reverse proxy (like NGINX) to handle SSL termination. Using Letโ€™s Encrypt, you can obtain a free SSL certificate to encrypt traffic to your app. Finally, regularly update the Docker container to ensure any security patches are applied.

2. Can I run multiple instances of PocketBase on the same VPS?

Yes, you can run multiple instances of PocketBase on the same VPS by mapping each instance to a different port. For example, you can run one instance on port 8090 and another on 8091. Just ensure each instance has its own directory for data storage to avoid any data conflicts.

3. What databases does PocketBase support?

PocketBase uses SQLite as its default storage engine. For self-hosted applications, this is generally sufficient, especially for smaller projects. If youโ€™re expecting substantial traffic or require advanced features, consider integrating it with a more robust database management system. You can manage the database directly through the web interface provided by PocketBase.

With the above steps, you should have PocketBase successfully running on your VPS. Whether youโ€™re building a small personal project or a larger application, self-hosting gives you the flexibility to manage your environment effectively. Happy coding!