Skip to content

Instantly share code, notes, and snippets.

@samuelstein
Last active February 14, 2024 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save samuelstein/caaf20f7a5f1fd0c855c0f5e901a4de3 to your computer and use it in GitHub Desktop.
Save samuelstein/caaf20f7a5f1fd0c855c0f5e901a4de3 to your computer and use it in GitHub Desktop.
Cookbook Self-Hosting Directus 9 Headless CMS

Cookbook: Self-Hosting Directus 9 Headless CMS

Assumption

  • Ubuntu 22.04 LTS
  • PostgreSQL
  • Caddy Proxy

Steps

  1. Install PostgreSQL: https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-22-04-quickstart
  2. Install NodeJS: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-22-04
  3. Install Directus 9: npm install directus
  4. Create new Directus project: npx directus init
  5. Add NodeJS start script: npx directus start
  6. Setup NodeJS production env with pm2: https://www.digitalocean.com/community/tutorials/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps
  7. Install Caddy as reverse proxy: https://www.techrepublic.com/article/install-caddy-web-server-ubuntu/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment