[{"data":1,"prerenderedAt":123},["ShallowReactive",2],{"seo-verification":3,"blog-hosting-directus-on-a-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"slugs":9,"title":12,"excerpt":13,"readTime":14,"views":15,"isPinned":16,"publishedAt":17,"category":18,"categories":24,"featuredImage":26,"bgImage":27,"posterImage":28,"relatedSolution":26,"intro":29,"sections":30,"ctaTitle":73,"ctaBody":74,"ctaButton":75,"ctaUrl":76,"relatedPosts":77},63,"hosting-directus-on-a-vps",{"fr":10,"en":8,"ar":11},"heberger-directus-vps","استضافة-directus-على-خادم-vps","Hosting Directus on a VPS","Host Directus on your VPS: an open source headless CMS and data platform on top of your SQL database. Docker, Postgres, reverse proxy, and SSL guide.",3,0,false,"2026-04-18T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},6,"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[25],{"id":19,"name":20,"slug":21,"color":22,"icon":23},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-directus-vps-poster.svg","Directus turns any SQL database into an instant REST and GraphQL API, with a no-code administration interface on top. It's a headless CMS and a complete data platform, perfect to self-host on a VPS to manage the content of your sites and applications. Here's how to deploy it with PostgreSQL, Docker, and an SSL certificate.",[31,35,45,48,70],{"type":32,"title":33,"body":34},"h2","Why self-host Directus on a VPS","Directus plugs into your existing database (PostgreSQL, MySQL, SQLite, MariaDB) without imposing its own schema: it introspects your tables and generates an API and an admin interface on top. By self-hosting it on a VPS, you avoid the per-seat pricing of the official Cloud offering and you keep your content, your media, and your SQL database on your own infrastructure. It's a structuring choice for agencies that deliver several sites: a single Directus can serve as the back office for multiple front-ends (Nuxt, Next, mobile). Control of the database, extensions, and webhooks lets you integrate Directus into any data pipeline without depending on a third-party provider, with no third-party service sitting between your front-ends and your data.",{"type":36,"title":37,"items":38},"ul","The concrete benefits of self-hosting Directus",[39,40,41,42,43,44],"REST and GraphQL APIs generated automatically from your SQL schema, without writing code.","A no-code admin interface to model content, manage roles, and set granular permissions.","Compatible with an existing SQL database: you can expose it without migrating or altering it.","Media management, on-the-fly image transformations, and local or S3 storage of your choice.","Built-in Flows and webhooks to automate processing (notifications, synchronizations).","Pooling: a single Directus VPS can power several sites and front-end applications.",{"type":32,"title":46,"body":47},"Hardware and software prerequisites","Directus is a Node.js application that relies on an external database. Count on a minimum of 2 GB of RAM to comfortably run Directus and PostgreSQL on the same VPS; 4 GB are recommended in production with image transformations and several simultaneous administrators. One to two vCPU are enough to start. Plan for a Redis cache (optional but recommended for sessions and rate limiting) and a 30 to 60 GB SSD volume depending on your media library. You'll need Docker and Docker Compose, a domain pointing to the VPS, and a robust secret key for `SECRET` and token hashing. Postgres remains the recommended database for advanced features.",{"type":49,"title":50,"steps":51},"steps","Deploying Directus step by step",[52,55,58,61,64,67],{"title":53,"body":54},"Provision the VPS and Docker","After connecting via SSH, install Docker and Docker Compose. Create an A DNS record for `cms.mydomain.com` pointing to the VPS IP. Open only ports 80 and 443 in the firewall (`ufw allow 80,443\u002Ftcp`).",{"title":56,"body":57},"Define the stack in docker-compose.yml","Declare three services: `database` (image `postgres:16` with a persistent volume), `cache` (`redis`), and `directus` (`directus\u002Fdirectus`). Connect Directus to Postgres via the variables `DB_CLIENT=pg`, `DB_HOST=database`, `DB_DATABASE`, `DB_USER`, `DB_PASSWORD`.",{"title":59,"body":60},"Configure the environment variables","Fill in `KEY` and `SECRET` with random strings (`openssl rand -hex 32`), set `ADMIN_EMAIL` and `ADMIN_PASSWORD` for the first account, and `PUBLIC_URL=https:\u002F\u002Fcms.mydomain.com` so that links and uploads are correct.",{"title":62,"body":63},"Start and initialize the database","Run `docker compose up -d`. On the first startup, Directus automatically creates the system tables and the admin account. Follow the initialization with `docker compose logs -f directus`.",{"title":65,"body":66},"Connect the reverse proxy and TLS","Put Caddy or Traefik in front of Directus to handle Let's Encrypt. With Traefik, add the routing labels on the `directus` service and the ACME certresolver. Make sure `PUBLIC_URL` exactly matches the HTTPS domain to avoid CORS and upload issues.",{"title":68,"body":69},"Secure and back up","Restrict the CORS origins to your front-ends' domains, disable public registration if unnecessary, then schedule a daily `pg_dump` plus a copy of the `uploads` folder to remote storage.",{"type":71,"body":72},"tip","To serve images performantly, enable media storage on an S3-compatible bucket rather than the local disk, and cache the image transformations (`ASSETS_CACHE_TTL`). Coupled with a CDN in front of Directus, this offloads media requests from the VPS and speeds up front-end rendering. Also consider limiting the size of allowed transformations via `ASSETS_TRANSFORM_MAX_OPERATIONS` to prevent abuse of on-the-fly image generation.","Host your Directus headless CMS in full autonomy","With the ServOrbit Cloud VPS, deploy Directus and PostgreSQL in a high-performance Docker environment, with scalable resources and automatic SSL to power all your front-ends.","Deploy on Cloud VPS","\u002Fvps-cloud",[78,95,108],{"id":79,"slug":80,"slugs":81,"title":84,"excerpt":85,"readTime":86,"views":15,"isPinned":16,"publishedAt":87,"category":88,"categories":89,"featuredImage":26,"bgImage":27,"posterImage":91,"relatedSolution":92},56,"postgresql-on-a-vps-a-reliable-and-controlled-database",{"fr":82,"en":80,"ar":83},"heberger-postgresql-vps","postgresql-على-خادم-vps-قاعدة-بيانات-موثوقة-ومتحكم-بها","PostgreSQL on a VPS: a reliable and controlled database","Host PostgreSQL on a VPS: volumes, backups, restricted network access and sound configuration for your applications.",4,"2026-04-25T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[90],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":93,"appSlug":94},"databases","postgresql-stack",{"id":96,"slug":97,"slugs":98,"title":101,"excerpt":102,"readTime":14,"views":15,"isPinned":16,"publishedAt":103,"category":104,"categories":105,"featuredImage":26,"bgImage":27,"posterImage":107,"relatedSolution":26},57,"hosting-mysql-on-a-vps",{"fr":99,"en":97,"ar":100},"heberger-mysql-vps","استضافة-mysql-على-خادم-vps","Hosting MySQL on a VPS","Host MySQL on your Cloud VPS: Docker deployment, hardening, InnoDB tuning, and automated backups, step by step.","2026-04-24T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[106],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-mysql-vps-poster.svg",{"id":109,"slug":110,"slugs":111,"title":114,"excerpt":115,"readTime":86,"views":15,"isPinned":16,"publishedAt":116,"category":117,"categories":118,"featuredImage":26,"bgImage":27,"posterImage":120,"relatedSolution":121},58,"hosting-redis-on-a-vps",{"fr":112,"en":110,"ar":113},"heberger-redis-vps","استضافة-redis-على-خادم-vps","Hosting Redis on a VPS","Deploy Redis on your Cloud VPS: in-memory cache, sessions, and queues, with persistence, security, and tuning.","2026-04-23T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},[119],{"id":19,"name":20,"slug":21,"color":22,"icon":23},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":93,"appSlug":122},"redis-stack",1787581001126]