What this covers
Backups. Every night we copy each backend's pb_data/ folder to off-site storage. We keep the last 7 nightly copies, plus weekly and monthly ones. This copy exists so we can recover from a server failure. You cannot restore it yourself from the portal: ask support and tell them the date you want. It is a file copy taken while PocketBase is running, so treat it as a safety net, not your only backup. PocketBase has its own backup feature, which takes a consistent snapshot. Set it up in the admin dashboard under Settings → Backups. It can run on a schedule and send each backup to an S3-compatible bucket such as Cloudflare R2, AWS S3 or Backblaze B2. Outbound HTTPS from your backend is allowed, so this works without asking us. Restoring one of these is something you do yourself in the same screen. Environment variables and secrets. A Pocketbase Backend is a backend: it stores data, handles sign-in and serves the API. Configuration such as API keys, webhook URLs and feature flags belongs to your app, which has its own Environment Variables section on its service page. A Pocketbase Backend has no such section, and $os.getenv() in a hook only sees PORT, HOST and APP_DOMAIN. If your app calls an outside service, put that call and its key in the app. It can react to PocketBase through a realtime subscription, or run its own scheduled job and query PocketBase. If a hook genuinely needs a setting, keep it in PocketBase itself: create a collection, for example config, give it no API rules so only superusers can read it, and read it in the hook with $app.findFirstRecordByFilter("config", "key = 'dispatcher_url'"). Changing a value in the dashboard takes effect on the next read, with no redeploy. It lives in pb_data/, so it is covered by your backups. Treat a missing value as "feature off", so a backend set up before the value exists still behaves correctly. Uptime and idling. A Pocketbase Backend runs all the time. It is never paused, put to sleep or scaled to zero for being idle, and jobs registered with cronAdd() keep firing on schedule. If the process crashes it is restarted within a few seconds. After a server reboot it starts again on its own. It is briefly stopped during a redeploy, and if it goes past its memory limit (1 GB on PocketBase Starter, slowed down from about 680 MB) it is stopped and restarted. A cron run that falls inside one of those few seconds is skipped, not run late, so write each job to check the current state rather than rely on the previous run having happened. Logs. The Runtime logs panel on your service page shows the last 80 lines your backend printed: console.log() output from your hooks, hook errors and stack traces, and PocketBase's own startup messages. It is the place to look when a hook fails. It is not a full history and has no search. For a lasting record, write with $app.logger() in your hooks. Those entries, and every API request, are kept by PocketBase and shown in the admin dashboard under Logs, where you can filter them. console.log() output does not appear there, only in the Runtime logs panel.
Before you start
Have an S3-compatible bucket and an access key ready if you want off-site PocketBase backups. A Cloudflare R2 bucket in the EU region keeps the copy in Europe, next to your backend. Decide where each setting lives: in your app's environment variables if the app uses it, or in a superuser-only collection if a hook does. Never send secret values to support.
How to do it
- Open https://your-domain/_/ and sign in as a superuser.
- Go to Settings → Backups. Turn on scheduled backups and pick a schedule, for example daily at 02:00.
- In the same screen, turn on S3 storage for backups and enter your bucket's endpoint, bucket name, region, access key and secret. For Cloudflare R2 the endpoint is https://<account-id>.r2.cloudflarestorage.com and the region is auto.
- Click Create new backup once and check the file appears in your bucket. A backup you have never seen land is not a backup.
- Set how many backups to keep. Older ones are removed from the bucket automatically.
- Put API keys and URLs that your app uses in the app's own Environment Variables section, then redeploy the app.
- For a setting a hook needs, create a collection named config in /_/ with key and value text fields, leave all its API rules empty so only superusers can read it, add the values, and read them in the hook with $app.findFirstRecordByFilter. Check for a missing record before using it.
- After a redeploy, open Runtime logs on the service page and check your hooks loaded without errors.
- Use $app.logger().info(...) or .error(...) for anything you need to look back at later, and read it in the dashboard under Logs.
What our team checks
Support can restore pb_data/ from one of our nightly copies and confirm that your backend is running and when it last restarted.
Next step
Open /_/ → Settings → Backups and schedule a daily backup to your own S3 or R2 bucket, then check the first file arrives.