[{"data":1,"prerenderedAt":187},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-trailbase-vps-firebase-alternative-ma-en":6,"promo-bar-likely":186},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-self-host-trailbase-vps-firebase-alternative-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,"keyPoints":37,"sections":38,"ctaTitle":114,"ctaBody":115,"ctaButton":116,"ctaUrl":117,"relatedPosts":118},597,"self-host-trailbase-vps-firebase-alternative",{"fr":12,"en":10,"ar":13,"es":14},"self-host-trailbase-vps","استضافة-trailbase-على-vps","autoalojar-trailbase-vps-alternativa-firebase","TrailBase on a VPS: a self-hosted Firebase backend on SQLite","Install TrailBase on a VPS with Docker Compose: typed REST APIs, realtime, authentication, an admin console and HTTPS behind nginx.",6,0,false,"2026-11-27T00:00:00+00:00","2026-11-28T02:42:22+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fself-host-trailbase-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-trailbase-vps-poster.svg",{"categorySlug":34,"appSlug":35},"development","trailbase","Firebase and its hosted cousins settle the backend question quickly, then raise another one: the bill, the quotas and where your data lives. TrailBase takes a different route: a single binary, written in Rust, that turns your SQLite tables into REST and realtime APIs, manages your users' accounts and ships an admin console. This guide installs it on a VPS with Docker Compose, publishes it over HTTPS behind nginx, and opens a first API end to end.",[],[39,43,52,79,82,95,99,102,105,108,111],{"type":40,"title":41,"body":42},"h2","What TrailBase does","TrailBase is an open-source application backend, released under the **OSL-3.0** licence and written in Rust. It fits in **a single executable** that bundles SQLite, an HTTP server, authentication, file storage, a WebAssembly runtime for your server code and an admin console.\n\nThe idea: you describe your data as **strictly typed SQL tables**, then declare a **Record API** on each. TrailBase derives REST endpoints from it — create, read, update, delete, filtered lists, realtime subscriptions — and JSON schemas that feed typed client libraries for JavaScript\u002FTypeScript, Dart\u002FFlutter, Rust, Go, Python, C#, Swift and Kotlin.",{"type":44,"title":45,"items":46},"ul","What TrailBase gives you",[47,48,49,50,51],"**APIs without code** — one table, one declaration, and the REST API answers with cursor pagination and filters.","**Realtime** — your clients subscribe to changes on a table or a record.","**User accounts** — sign-up, sign-in, email verification, two-factor authentication, OAuth providers and bundled login pages.","**Precise access control** — per-role access lists, refined by SQL rules such as \"only the author edits their row\".","**An admin console** — tables, SQL editor, accounts, request logs and settings, in the browser.",{"type":53,"title":54,"headers":55,"rows":58},"comparison","Hosted backend or TrailBase on your VPS",[5,56,57],"Hosted backend (Firebase-style)","TrailBase on your VPS",[59,63,67,71,75],[60,61,62],"Data","With the provider","On your server",[64,65,66],"Billing","Usage-based: reads, writes, traffic","The fixed price of the VPS",[68,69,70],"Data model","NoSQL documents","SQL tables and versioned migrations",[72,73,74],"Moving parts","None, but no control","One container and one data folder",[76,77,78],"Maturity","Established service","Young project, alpha stage",{"type":40,"title":80,"body":81},"Prepare the server","An **Ubuntu 24.04** VPS with **1 GB of RAM** and 1 vCPU is enough: at rest, TrailBase uses between 80 and 150 MB of memory. Install Docker and the Compose plugin, and point a **domain name** at the VPS: your apps will call the API at that HTTPS address, and authentication email links will point back to it.\n\nTrailBase is **alpha** by its own authors' account: it releases often, and not every version is equal. Pin a precise image version, as below, rather than `latest`.",{"type":83,"title":84,"steps":85},"steps","Install TrailBase with Docker Compose",[86,89,92],{"title":87,"body":88},"Prepare the folder and the .env file","The file holds the public domain and the password the administrator account will use.\n```bash\nmkdir -p \u002Fopt\u002Ftrailbase && cd \u002Fopt\u002Ftrailbase\ncat > .env \u003C\u003CEOF\nDOMAIN=trailbase.example.com\nADMIN_PASSWORD=$(openssl rand -hex 12)\nEOF\nchmod 600 .env\n```",{"title":90,"body":91},"Write the docker-compose.yml file","On the very first start, TrailBase creates the administrator `admin@localhost` with a random password written to its logs. The command starts the server once inside the container, replaces that password with `ADMIN_PASSWORD`, then launches the server. The port is published on the loopback only: nginx will serve it over HTTPS.\n```yaml\nservices:\n  trailbase:\n    image: trailbase\u002Ftrailbase:0.36.3\n    container_name: trailbase\n    restart: unless-stopped\n    environment:\n      ADMIN_PASSWORD: ${ADMIN_PASSWORD:?}\n      PUBLIC_URL: https:\u002F\u002F${DOMAIN:?}\n    entrypoint: [\"tini\", \"--\", \"sh\", \"-c\"]\n    command:\n      - |\n        set -e\n        D=\u002Fapp\u002Ftraildepot\n        if [ ! -f \"$$D\u002F.admin-set\" ]; then\n          \u002Fapp\u002Ftrail --depot \"$$D\" run --address 127.0.0.1:4000 &\n          pid=$$!\n          until curl -fsS http:\u002F\u002F127.0.0.1:4000\u002Fapi\u002Fhealthcheck >\u002Fdev\u002Fnull 2>&1; do sleep 1; done\n          \u002Fapp\u002Ftrail --depot \"$$D\" user change-password admin@localhost \"$$ADMIN_PASSWORD\"\n          kill \"$$pid\"; wait \"$$pid\" || true\n          touch \"$$D\u002F.admin-set\"\n        fi\n        exec \u002Fapp\u002Ftrail --depot \"$$D\" run --address 0.0.0.0:4000\n    volumes:\n      - trailbase-depot:\u002Fapp\u002Ftraildepot\n    ports:\n      - \"127.0.0.1:4000:4000\"\nvolumes:\n  trailbase-depot: {}\n```",{"title":93,"body":94},"Start and check","The health check answers `Ok` once the server is ready.\n```bash\ndocker compose up -d --wait\ncurl -s http:\u002F\u002F127.0.0.1:4000\u002Fapi\u002Fhealthcheck\n```",{"type":96,"title":97,"body":98},"tip","Change the administrator account's address","The account is called `admin@localhost`: it is not a mailbox that receives mail. Once signed in to the console (`https:\u002F\u002Fyour-domain\u002F_\u002Fadmin\u002F`), give it a real address, or create your own account and promote it with `docker exec trailbase \u002Fapp\u002Ftrail admin promote \u003Caddress>`. Keep the data folder safe too: it holds the database, the configuration and the keys that sign session tokens.",{"type":40,"title":100,"body":101},"Publish TrailBase over HTTPS behind nginx","The reverse proxy terminates TLS and forwards everything to the local port. Two details matter: pass `X-Forwarded-For`, otherwise logs and rate limiting see the proxy's address, and **turn off buffering** so realtime subscriptions, served as Server-Sent Events, arrive without delay.\n\n```nginx\nserver {\n    listen 443 ssl;\n    server_name trailbase.example.com;\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Ftrailbase.example.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Ftrailbase.example.com\u002Fprivkey.pem;\n    client_max_body_size 50m;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002F127.0.0.1:4000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto https;\n        # realtime subscriptions (SSE)\n        proxy_set_header Connection '';\n        proxy_http_version 1.1;\n        proxy_buffering off;\n        proxy_cache off;\n    }\n}\n```",{"type":40,"title":103,"body":104},"Create a table and open its first API","A table is created from the console's explorer, which writes the migration for you, or with an SQL file in `migrations\u002Fmain\u002F`. It must be `STRICT` and have an integer or UUID primary key. The Record API is then declared in the console, or in `config.textproto`: here, anyone can read, only signed-in users can create.\n\n```bash\ndocker exec trailbase sh -c 'cat > \u002Fapp\u002Ftraildepot\u002Fmigrations\u002Fmain\u002FU1800000000__create_notes.sql \u003C\u003CEOF\nCREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT NOT NULL) STRICT;\nEOF'\ndocker exec trailbase sh -c 'cat >> \u002Fapp\u002Ftraildepot\u002Fconfig.textproto \u003C\u003CEOF\nrecord_apis: [\n  { name: \"notes\" table_name: \"notes\" acl_world: [READ] acl_authenticated: [CREATE, READ] }\n]\nEOF'\ndocker compose restart\n```\n\nAn anonymous create is refused (403); a create with a sign-in token is accepted, and the list is readable by everyone.\n\n```bash\nTOKEN=$(curl -s -H 'content-type: application\u002Fjson' \\\n  -d '{\"email\":\"admin@localhost\",\"password\":\"\u003CADMIN_PASSWORD>\"}' \\\n  https:\u002F\u002Ftrailbase.example.com\u002Fapi\u002Fauth\u002Fv1\u002Flogin | jq -r .auth_token)\ncurl -s -H \"Authorization: Bearer $TOKEN\" -H 'content-type: application\u002Fjson' \\\n  -d '{\"body\":\"Bonjour\"}' https:\u002F\u002Ftrailbase.example.com\u002Fapi\u002Frecords\u002Fv1\u002Fnotes\ncurl -s https:\u002F\u002Ftrailbase.example.com\u002Fapi\u002Frecords\u002Fv1\u002Fnotes\n```",{"type":40,"title":106,"body":107},"Sign your users in","TrailBase provides the sign-up, sign-in and token refresh endpoints, plus ready-made login pages under `\u002F_\u002Fauth\u002F`. The client libraries manage the session for you: the `trailbase` npm package is initialised with your instance's address, signs the user in and attaches their token to every call.\n\nFor email verification and password reset, configure an **SMTP server** in the console settings: without it, no email goes out. OAuth providers (Google, GitHub, Microsoft…) are set up in the same place, using the public address declared in `PUBLIC_URL`.",{"type":40,"title":109,"body":110},"Backup and updates","All of TrailBase's state lives in the `trailbase-depot` volume: SQLite databases, migrations, configuration, uploaded files and keys. A consistent backup is taken with the server stopped, in a few seconds:\n\n```bash\ncd \u002Fopt\u002Ftrailbase\ndocker compose stop\ndocker run --rm -v trailbase_trailbase-depot:\u002Fd -v \"$PWD\":\u002Fb alpine tar czf \u002Fb\u002Ftraildepot-$(date +%F).tar.gz -C \u002Fd .\ndocker compose start\n```\n\nTo update, read the release notes first, back up, change the image number in `docker-compose.yml`, then run `docker compose up -d`. At the alpha stage, test the new version on a copy of the folder before applying it in production, and keep the previous image at hand to roll back.",{"type":40,"title":112,"body":113},"TrailBase in one click on ServOrbit","From your client area, the Marketplace installs TrailBase on your VPS: pinned official image, administration password generated and shown in the client area, port published on the loopback and nginx reverse proxy over HTTPS. Pick a subdomain of one of your domains, or the VPS's free subdomain (`trailbase.{dns_slug}.servorbit-dns.com`): no need to buy a domain name. All that is left is to create your tables.","Your application backend, on your VPS","A ServOrbit Ubuntu 24.04 VPS with 1 GB of RAM is enough to start with TrailBase. One-click install from the Marketplace, HTTPS on your domain or on the VPS's free subdomain, generated administration password.","Install TrailBase","\u002Fapplications\u002Fdevelopment\u002Ftrailbase",[119,144,167],{"id":120,"slug":121,"slugs":122,"title":126,"excerpt":127,"readTime":128,"views":129,"isPinned":19,"noindex":19,"publishedAt":130,"updatedAt":131,"category":132,"categories":137,"featuredImage":139,"bgImage":31,"posterImage":140,"relatedSolution":141},62,"hosting-pocketbase-on-a-vps",{"fr":123,"en":121,"ar":124,"es":125},"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,"2026-04-19T00:00:00+00:00","2026-09-08T22:00:02+00:00",{"id":17,"name":133,"slug":134,"color":135,"icon":136},"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[138],{"id":17,"name":133,"slug":134,"color":135,"icon":136},"\u002Fblog\u002Fcovers\u002Fheberger-pocketbase-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fheberger-pocketbase-vps-poster.svg",{"categorySlug":142,"appSlug":143},"databases","pocketbase",{"id":145,"slug":146,"slugs":147,"title":151,"excerpt":152,"readTime":153,"views":18,"isPinned":19,"noindex":19,"publishedAt":154,"updatedAt":155,"category":156,"categories":161,"featuredImage":163,"bgImage":31,"posterImage":164,"relatedSolution":165},94,"supabase-vs-appwrite-which-self-hosted-backend-for-your-vps",{"fr":148,"en":146,"ar":149,"es":150},"supabase-vs-appwrite","supabase-مقابل-appwrite-أي-خلفية-مستضافة-ذاتيا-لـ-vps","supabase-vs-appwrite-que-backend-self-hosted-para-vps","Supabase vs Appwrite: Choosing Your Open-Source BaaS on a VPS","Full comparison of Supabase vs Appwrite: Docker deployment, RAM requirements, auth, serverless functions, realtime, and a decision guide for your VPS.",14,"2026-03-18T00:00:00+00:00","2026-11-08T01:13:16+00:00",{"id":157,"name":158,"slug":159,"color":160,"icon":159},5,"Comparison","comparatif","bg-info\u002F10 text-info",[162],{"id":157,"name":158,"slug":159,"color":160,"icon":159},"\u002Fblog\u002Fcovers\u002Fsupabase-vs-appwrite-cover.webp","\u002Fblog\u002Fcovers\u002Fsupabase-vs-appwrite-poster.svg",{"categorySlug":142,"appSlug":166},"supabase",{"id":168,"slug":169,"slugs":170,"title":174,"excerpt":175,"readTime":176,"views":177,"isPinned":19,"noindex":19,"publishedAt":178,"updatedAt":179,"category":180,"categories":181,"featuredImage":183,"bgImage":31,"posterImage":184,"relatedSolution":185},60,"hosting-supabase-on-a-vps",{"fr":171,"en":169,"ar":172,"es":173},"heberger-supabase-vps","استضافة-supabase-على-خادم-vps","alojar-supabase-en-un-vps","Hosting Supabase on a VPS in 2026","Self-host Supabase on your Cloud VPS: Postgres, Auth, Storage and REST API behind Envoy. PG 15→17 migration, Kong→Envoy, GoTrue CVE.",15,1,"2026-04-21T00:00:00+00:00","2026-11-20T14:17:08+00:00",{"id":17,"name":133,"slug":134,"color":135,"icon":136},[182],{"id":17,"name":133,"slug":134,"color":135,"icon":136},"\u002Fblog\u002Fcovers\u002Fheberger-supabase-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fheberger-supabase-vps-poster.svg",{"categorySlug":142,"appSlug":166},true,1795834381526]