Skip to content

Guide for Installing Directus on Debian 12 Operating System

Setup Directus on Debian 12 with PostgreSQL, PM2, and Nginx for a secure and streamlined installation process. Follow this comprehensive guide to accomplish the task.

Guide for Installing Directus on Debian 12 Operating System
Guide for Installing Directus on Debian 12 Operating System

Guide for Installing Directus on Debian 12 Operating System

In this article, we will walk you through the process of deploying Directus on Debian 12, a long-term supported operating system that offers modern packages and robust security features.

To start, head over to our website.host and choose Debian 12 (64-bit) as your operating system. Select a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD. Once your instance is set up, you can find the IP address under the Resources section.

For a small to medium setup, a configuration with 2 vCPU and 4-8 GB RAM, along with PostgreSQL co-located, should suffice. However, for larger deployments, consider a setup with 4-8 vCPU, 8-16 GB RAM, a dedicated PostgreSQL instance, backups, PITR (point-in-time recovery), PM2 cluster (2-4 workers), S3/MinIO storage, Nginx caching, and a CDN for assets.

In case you need caching or rate limiting, Redis can be a valuable addition. For large setups, multiple Directus nodes behind a load balancer, high availability PostgreSQL (Patroni, managed service, or replicas), and a CDN for assets may also be necessary.

Directus treats your SQL database as the source of truth by introspecting your tables, adding a lightweight system schema, and exposing your content with granular permissions. This approach ensures that your data remains secure and manageable.

Observability can be achieved through logs, metrics, health checks, and CI/CD. Directus supports RBAC for defining Admin, Editor, and Public roles with field-level permissions, local auth, OAuth, OIDC, and SSO providers, and storing media in local disk or external storage with signed URLs/CDN.

Nginx acts as the secure public entrypoint for Directus, providing TLS termination, security headers, Gzip/Brotli compression, caching for safe GET endpoints, and automating certificates with Certbot (ACME).

PostgreSQL is the preferred choice for Directus in production due to its support for JSONB + advanced indexing, high concurrency and transactions, a rich ecosystem of extensions, easy replication, PITR (point-in-time recovery), and HA setups.

For medium to large deployments, it's recommended to run a dedicated PostgreSQL instance and tune parameters like shared_buffers, work_mem, and maintenance_work_mem to your workload.

Directus is an open-source data platform that provides a REST and GraphQL API, and a no-code admin app. It can be used as a headless CMS, API layer, multi-tenant content hubs, back-office dashboards, catalogs, docs hubs, and multilingual content at scale.

The article detailing this deployment process was authored by Christian Wells. For production, PM2 is the recommended way to run Directus, as it daemonizes Directus, restarts automatically after crashes/reboots, supports cluster mode, centralized logs, and basic metrics.

With Directus, you gain total control, no lock-in, and a polished admin UI directly on top of your database. So, let's get started with your Directus deployment on Debian 12!

Read also:

Latest