[{"data":1,"prerenderedAt":198},["ShallowReactive",2],{"seo-verification":3,"blog-hosting-pocketbase-on-a-vps-ma-en":6,"promo-bar-likely":197},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-hosting-pocketbase-on-a-vps-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"sections":37,"ctaTitle":138,"ctaBody":139,"ctaButton":140,"ctaUrl":141,"relatedPosts":142},62,"hosting-pocketbase-on-a-vps",{"fr":12,"en":10,"ar":13,"es":14},"heberger-pocketbase-vps","استضافة-pocketbase-على-خادم-vps","alojar-pocketbase-en-un-vps","Hosting PocketBase on a VPS: complete guide","Deploy PocketBase on your VPS with Docker, HTTPS, OAuth, automatic backups and troubleshooting. Step-by-step guide, 2026.",10,3,false,"2026-04-19T00:00:00+00:00","2026-09-08T22:00:02+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},6,"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-pocketbase-vps-poster.svg",{"categorySlug":34,"appSlug":35},"databases","pocketbase","PocketBase fits in a single Go binary: embedded SQLite database, authentication, file storage, REST API and real-time subscriptions, all with a built-in admin UI. It is the ideal backend to self-host on a lightweight VPS for your web and mobile applications. This complete guide takes you from Docker installation to HTTPS configuration, OAuth authentication, automatic backups and advanced tuning.",[38,42,53,56,75,78,81,85,88,91,133,136],{"type":39,"title":40,"body":41},"h2","Why self-host PocketBase on a VPS","PocketBase is an open source backend-as-a-service distributed as a single binary: no separate Postgres, no Redis, no complex stack to orchestrate. Everything runs on SQLite, making it perfectly suited to an entry-level VPS.\n\nBy self-hosting, you retain full control over your user data and files, without depending on a managed Firebase or Supabase with quotas and latency that can be problematic depending on your region. A VPS gives you a fixed IP, a custom domain and backups that you fully control.\n\nBecause PocketBase writes to a single `pb_data` folder, your backup strategy comes down to copying that directory, which simplifies operations enormously compared to a classic database cluster. You can migrate your backend by moving a single folder.",{"type":43,"title":44,"items":45},"ul","Concrete benefits of self-hosting PocketBase",[46,47,48,49,50,51,52],"A single binary to deploy: starts in seconds, minimal memory footprint (often less than 100 MB of RAM).","Embedded SQLite database: zero database service to manage, backup by simply copying the `pb_data` folder.","Full authentication (email\u002Fpassword, OAuth2, OTP, LDAP) and granular access rules per collection.","Real-time API via Server-Sent Events to automatically sync your clients without additional WebSocket.","Complete web admin interface to manage collections, users, permissions and files without writing SQL.","Data sovereignty: your users and their files stay on your infrastructure, behind your domain.","Predictable cost: the VPS price does not change with traffic, unlike per-request billing.",{"type":39,"title":54,"body":55},"Precise requirements: VPS, system and software","PocketBase is extremely lightweight. Here is what you need based on your load:\n\n**Absolute minimum**: 1 vCPU, 512 MB of RAM. Sufficient for a development project or a small application with fewer than 1,000 active users.\n\n**Recommended in production**: 1 vCPU, 1 GB of RAM. PocketBase handles a small to medium-sized project easily with this configuration; the SQLite cache and real-time traffic spikes are absorbed comfortably.\n\n**For high volumes**: 2 vCPU, 2 GB of RAM. The limit of PocketBase is usually concurrent writes to SQLite, not CPU.\n\nFor storage, plan for 20 to 40 GB SSD NVMe depending on the volume of files uploaded by your users. Since SQLite is a single file, an NVMe disk noticeably improves concurrent write performance — avoid network drives (NFS, CIFS) which can corrupt the database when locks are mishandled.\n\nRequired software: Docker 24+ and Docker Compose v2 (or the PocketBase binary alone with `systemd`), a domain name or subdomain pointing to the VPS IP via an A record, a reverse proxy (Caddy, Nginx or Traefik) to handle TLS.",{"type":57,"title":58,"steps":59},"steps","Deploy PocketBase on VPS step by step",[60,63,66,69,72],{"title":61,"body":62},"Prepare the VPS and DNS","Connect via SSH, update the system with `apt update && apt upgrade -y`, then install Docker with the official script: `curl -fsSL https:\u002F\u002Fget.docker.com | sh`. Add your user to the Docker group with `usermod -aG docker $USER` to avoid `sudo` on every command.\n\nThen create an A DNS record pointing `app.your-domain.com` to the public IP of your VPS. Propagation takes from a few minutes to 24 hours — verify with `dig app.your-domain.com`.",{"title":64,"body":65},"Create the file structure","Create a dedicated directory and the compose file:\n\n```bash\nmkdir -p \u002Fopt\u002Fpocketbase && cd \u002Fopt\u002Fpocketbase\n```\n\nCreate the `docker-compose.yml` file with the following content:\n\n```yaml\nservices:\n  pocketbase:\n    image: ghcr.io\u002Fmuchobien\u002Fpocketbase:latest\n    restart: unless-stopped\n    volumes:\n      - .\u002Fpb_data:\u002Fpb_data\n    expose:\n      - \"8090\"\n```\n\nDo **not** publish port `8090` directly to the Internet (no `ports:`) — let the reverse proxy handle it.",{"title":67,"body":68},"Configure HTTPS with Caddy (recommended reverse proxy)","Caddy automatically obtains and renews Let's Encrypt certificates. Create `\u002Fopt\u002Fpocketbase\u002FCaddyfile`:\n\n```\napp.your-domain.com {\n    reverse_proxy pocketbase:8090\n}\n```\n\nAdd the Caddy service in `docker-compose.yml`:\n\n```yaml\n  caddy:\n    image: caddy:2-alpine\n    restart: unless-stopped\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    volumes:\n      - .\u002FCaddyfile:\u002Fetc\u002Fcaddy\u002FCaddyfile\n      - caddy_data:\u002Fdata\n    depends_on:\n      - pocketbase\n\nvolumes:\n  caddy_data:\n```\n\nCaddy enables WebSockets (used by PocketBase real-time subscriptions) by default. **If you prefer Nginx**, add the `Upgrade` and `Connection` headers in your `location \u002F` so SSE connections pass through correctly.",{"title":70,"body":71},"Start and verify","Start the stack with `docker compose up -d` then follow the logs:\n\n```bash\ndocker compose logs -f pocketbase\n```\n\nYou should see a line indicating PocketBase is listening on `0.0.0.0:8090` and the URL `\u002F_\u002F` for the admin interface. Verify that HTTPS works: `curl -I https:\u002F\u002Fapp.your-domain.com\u002F_\u002F` should return `HTTP\u002F2 200`.",{"title":73,"body":74},"Create the super-admin account","Open `https:\u002F\u002Fapp.your-domain.com\u002F_\u002F` in your browser. On first access, PocketBase prompts you to create a super-admin account (email + password). **Do this immediately** after startup — before making the URL public — because anyone reaching `\u002F_\u002F` can create this first account on a fresh instance.\n\nOnce logged in, explore the interface: Collections, Users, Logs and Settings.",{"type":39,"title":76,"body":77},"Configure OAuth authentication (Google, GitHub, GitLab)","PocketBase natively supports OAuth2 with several providers: Google, GitHub, GitLab, Discord, Twitter\u002FX, Microsoft, Apple and others. Configuration is done entirely from the admin interface, without touching code.\n\n**For Google OAuth**:\n1. Open the \u003Ca href=\"https:\u002F\u002Fconsole.cloud.google.com\u002F\">Google Cloud Console\u003C\u002Fa>, create a project and enable the \"OAuth consent screen\" API.\n2. Under \"Credentials\", create an \"OAuth 2.0 Client ID\" of type \"Web application\".\n3. Add `https:\u002F\u002Fapp.your-domain.com\u002Fapi\u002Foauth2-redirect` as an authorized redirect URI.\n4. Copy the `Client ID` and `Client secret`.\n5. In PocketBase `\u002F_\u002F`, go to **Settings → Auth providers → Google**, enable it and paste your credentials.\n\n**For GitHub OAuth**:\n1. On GitHub, go to **Settings → Developer settings → OAuth Apps → New OAuth App**.\n2. Set `https:\u002F\u002Fapp.your-domain.com` as the Homepage URL and `https:\u002F\u002Fapp.your-domain.com\u002Fapi\u002Foauth2-redirect` as the Authorization callback URL.\n3. Copy the `Client ID` and generate a `Client Secret`.\n4. Enable GitHub under **Settings → Auth providers** in PocketBase.\n\nEach active provider will automatically appear on the login page generated by PocketBase. Your frontend only needs to call `pb.collection('users').authWithOAuth2({ provider: 'google' })` via the JavaScript SDK.",{"type":39,"title":79,"body":80},"Automatic backups: SQLite and files","PocketBase stores everything in the `pb_data` folder: the SQLite database (`pb_data\u002Fdata.db`), uploaded files (`pb_data\u002Fstorage\u002F`) and logs. A complete backup is simply archiving that folder.\n\n**Method 1 — simple cron**: add this line to your crontab (`crontab -e`) for a daily archive at 3am:\n\n```bash\n0 3 * * * tar czf \u002Fvar\u002Fbackups\u002Fpocketbase-$(date +\\%F).tar.gz \u002Fopt\u002Fpocketbase\u002Fpb_data && find \u002Fvar\u002Fbackups -name 'pocketbase-*.tar.gz' -mtime +7 -delete\n```\n\nThis command creates a dated archive and deletes backups older than 7 days.\n\n**Method 2 — built-in PocketBase backups**: from the `\u002F_\u002F` interface, go to **Settings → Backups**. PocketBase can create `pb_data` archives directly from the admin or via the API (`POST \u002Fapi\u002Fbackups`). You can download these archives or send them to an S3-compatible storage.\n\n**Method 3 — rclone to S3**: for automatic off-site copying, use `rclone`:\n\n```bash\n0 4 * * * rclone sync \u002Fopt\u002Fpocketbase\u002Fpb_data your-remote:pocketbase-backup\u002F\n```\n\n`your-remote` is an rclone profile configured to Backblaze B2, AWS S3 or any compatible object storage. Always keep a copy off the server — if the disk fails, a local-only backup is useless.",{"type":82,"title":83,"body":84},"tip","SQLite WAL mode and performance","PocketBase enables SQLite WAL (Write-Ahead Logging) mode by default in recent versions. This mode allows concurrent reads during writes, preventing an insert from blocking all reads. If you experience timeouts under heavy load, check with `PRAGMA journal_mode;` in PocketBase's SQL admin — the response should be `wal`, not `delete`.\n\nFor high traffic, place `pb_data` on an NVMe volume and avoid any network file system. SQLite on NFS can corrupt the database when locks are mishandled.",{"type":39,"title":86,"body":87},"Troubleshooting: common errors","**Port already in use**: if `docker compose up` fails with `bind: address already in use` on port 80 or 443, check with `ss -tlnp | grep ':80'` which service is using the port. An nginx or Apache installed on the host conflicts with Caddy. Stop it (`systemctl stop nginx`) or change its ports.\n\n**Permissions on `pb_data`**: PocketBase runs as user `nobody` (UID 65534) in the official container. If you mount a folder created by root, the process cannot write. Fix with `chown -R 65534:65534 \u002Fopt\u002Fpocketbase\u002Fpb_data`.\n\n**`\u002F_\u002F` inaccessible after startup**: verify that the reverse proxy points to the Docker service name (`pocketbase:8090`) and not `localhost:8090`. In a Docker Compose network, services communicate by their name, not via `localhost`.\n\n**Updating PocketBase**: change the image tag in `docker-compose.yml` (e.g. `ghcr.io\u002Fmuchobien\u002Fpocketbase:0.23`) then `docker compose pull && docker compose up -d`. PocketBase performs schema migrations automatically on startup. Back up `pb_data` before any major update.\n\n**Let's Encrypt certificate not obtained**: Caddy needs ports 80 and 443 accessible from the Internet for the HTTP-01 challenge. Check your firewall (`ufw status`) and your hosting provider's security group rules.",{"type":39,"title":89,"body":90},"Going further: admin CLI, collections and hooks","**Admin CLI**: PocketBase exposes a CLI for common operations without going through the web interface. From the container: `docker exec -it pocketbase_pocketbase_1 \u002Fpb\u002Fpocketbase --help`. You can create a super-admin from the command line, run migrations or check the database health.\n\n**Custom collections**: in `\u002F_\u002F`, create your collections (equivalent to tables) by defining typed fields (text, number, bool, date, file, relation, select, JSON). API rules are expressed in PocketBase syntax (`@request.auth.id != \"\"` to restrict to logged-in users, `@request.auth.id = id` to limit to one's own record).\n\n**Hooks (server-side JavaScript)**: since PocketBase v0.17, you can extend the backend with JavaScript scripts running server-side (`pb_hooks\u002F*.pb.js`). Example uses: send an email when a user is created, validate complex data before insertion, trigger a webhook to Slack. These hooks are files mounted in the container:\n\n```yaml\nvolumes:\n  - .\u002Fpb_data:\u002Fpb_data\n  - .\u002Fpb_hooks:\u002Fpb_hooks\n```\n\n**JavaScript SDK**: the official SDK (`npm install pocketbase`) simplifies calls from your React, Vue or mobile frontend. It handles authentication, token refresh and real-time subscriptions (`pb.collection('tasks').subscribe('*', callback)`).",{"type":92,"title":93,"headers":94,"rows":99},"comparison","PocketBase vs self-hosted alternatives",[95,96,97,98],"Criterion","PocketBase","Supabase self-hosted","Appwrite",[100,105,110,115,119,124,128],[101,102,103,104],"Installation complexity","Very low (1 binary or 1 container)","High (docker-compose of 10+ services)","Medium (docker-compose of 6 services)",[106,107,108,109],"Minimum RAM","512 MB","4 GB+","2 GB+",[111,112,113,114],"Database","Embedded SQLite","PostgreSQL","MariaDB",[116,117,118,117],"OAuth authentication","Yes (native)","Yes (GoTrue)",[120,121,122,123],"Real-time","Server-Sent Events","WebSocket (Realtime server)","WebSocket",[125,126,127,126],"File storage","Yes (local + S3)","Yes (S3 compatible)",[129,130,131,132],"Horizontal scaling","No (single-file SQLite)","Yes (PostgreSQL)","Limited",{"type":82,"title":134,"body":135},"Official documentation","For advanced configuration and tool-specific options, refer to the \u003Ca href=\"https:\u002F\u002Fpocketbase.io\u002Fdocs\u002F\">official PocketBase documentation\u003C\u002Fa>. This guide covers deployment on VPS; the editor documentation remains the reference for fine-tuning, major updates and specific use cases.",{"type":82,"body":137},"If you want to test PocketBase without Docker, download the Linux binary from \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fpocketbase\u002Fpocketbase\u002Freleases\">github.com\u002Fpocketbase\u002Fpocketbase\u002Freleases\u003C\u002Fa>, run `.\u002Fpocketbase serve --http=0.0.0.0:8090` and create a systemd service so it restarts automatically. This approach is even lighter than Docker on small VPS.","Launch your PocketBase backend in minutes","The ServOrbit Cloud VPS gives you a ready-to-use Docker environment, a fixed IP, and fast SSD disks to host PocketBase with automatic SSL and simplified backups.","Deploy on Cloud VPS","\u002Fvps-cloud",[143,162,180],{"id":144,"slug":145,"slugs":146,"title":150,"excerpt":151,"readTime":152,"views":153,"isPinned":19,"noindex":19,"publishedAt":154,"updatedAt":155,"category":156,"categories":157,"featuredImage":30,"bgImage":31,"posterImage":159,"relatedSolution":160},56,"postgresql-on-a-vps-a-reliable-and-controlled-database",{"fr":147,"en":145,"ar":148,"es":149},"heberger-postgresql-vps","postgresql-على-خادم-vps-قاعدة-بيانات-موثوقة-ومتحكم-بها","alojar-postgresql-en-un-vps","PostgreSQL on a VPS: reliable, controlled database","Host PostgreSQL on a VPS: production config, pgBackRest backups, streaming HA, RDS\u002FSupabase\u002FNeon comparison and OOM troubleshooting.",9,1,"2026-04-25T00:00:00+00:00","2026-10-21T15:21:37+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[158],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":34,"appSlug":161},"postgresql-stack",{"id":163,"slug":164,"slugs":165,"title":169,"excerpt":170,"readTime":152,"views":171,"isPinned":19,"noindex":19,"publishedAt":172,"updatedAt":173,"category":174,"categories":175,"featuredImage":30,"bgImage":31,"posterImage":177,"relatedSolution":178},57,"hosting-mysql-on-a-vps",{"fr":166,"en":164,"ar":167,"es":168},"heberger-mysql-vps","استضافة-mysql-على-خادم-vps","alojar-mysql-en-un-vps","Hosting MySQL on a VPS: complete guide","Install MySQL 8.4 LTS on a VPS: prerequisites, security hardening, InnoDB performance, secure remote access, automated backups, and troubleshooting.",0,"2026-04-24T00:00:00+00:00","2026-11-09T20:55:18+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[176],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-mysql-vps-poster.svg",{"categorySlug":34,"appSlug":179},"mysql-stack",{"id":181,"slug":182,"slugs":183,"title":187,"excerpt":188,"readTime":17,"views":171,"isPinned":19,"noindex":19,"publishedAt":189,"updatedAt":190,"category":191,"categories":192,"featuredImage":30,"bgImage":31,"posterImage":194,"relatedSolution":195},58,"hosting-redis-on-a-vps",{"fr":184,"en":182,"ar":185,"es":186},"heberger-redis-vps","استضافة-redis-على-خادم-vps","alojar-redis-en-un-vps","Hosting Redis on a VPS: the complete guide","Deploy Redis on your Cloud VPS: RAM\u002FCPU requirements, security (ACL, TLS), RDB\u002FAOF persistence, troubleshooting, and high availability.","2026-04-23T00:00:00+00:00","2026-09-08T21:59:59+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[193],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":34,"appSlug":196},"redis-stack",true,1794270419837]