Skip to content
DocsPocketBaseCustom Domains

Custom Domains

Every PocketBase instance gets a platform address like my-app.xy12.pocketbasecloud.com. You can also serve it from a domain you own — api.example.com, db.example.com — with automatic HTTPS and no extra infrastructure. You can add and verify a domain from the portal or from your terminal; both produce the same result.

Custom domains require the Starter or Pro plan.

Prerequisites

  • A running PocketBase instance (Deploying PocketBase)
  • Access to your domain’s DNS settings at your registrar or DNS provider
  • For the CLI path: pbc installed and logged in (Installing the CLI)

Step 1: Add the domain

Using the portal

  1. Open the instance’s detail page in the portal and find the Domains section
  2. Enter your domain (for example, api.example.com) and confirm

The section now shows the DNS records you need to create, and a note that the domain is waiting for verification.

Using the CLI

pbc cloud pb domain add api.example.com --name my-app
Flag What it does
--name <name> Which instance the domain belongs to. Omitted when a directory is linked to it.

Step 2: Point your DNS at the platform

Create the records at your DNS provider. Which one depends on your domain:

Domain shape Record Name Value
Subdomain (api.example.com) CNAME api {instance-id}.pocketbasecloud.com
Root domain (example.com) A @ the server IP shown in the portal

Your instance id — the CNAME target — is shown in the portal’s Domains section. If you proxy the domain through Cloudflare (the orange cloud), add a TXT record instead: name _pbc-verify, value your instance id. The platform checks that record to confirm you control the domain.

Step 3: Verify

Using the portal

Click Verify now, or wait — the portal re-checks the DNS every few seconds while the domain is pending.

Using the CLI

pbc cloud pb domain verify api.example.com --name my-app

Verification passes once the DNS resolves correctly and no other deployment holds the domain.

What the platform does for you

A verified domain gets a TLS certificate automatically — the instance starts serving it over HTTPS the moment your DNS lands, with nothing else to configure. The domain is yours exclusively: no other deployment on the platform can verify the same name while you hold it.

Developers you share the project with — through an organization — can manage the domain too. Deleting the instance stays with its owner.

Removing a domain

Removing the domain stops serving it and releases the name for use elsewhere.

Using the portal

Open the Domains section on the instance’s detail page and remove the domain.

Using the CLI

pbc cloud pb domain remove api.example.com --name my-app

The platform address keeps working; only your domain stops serving.

Next steps