Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Directus
  3. Connect to Postgres via environment variables

Connect to Postgres via environment variables

Scheduled Pinned Locked Moved Directus
2 Posts 1 Posters 453 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ekevu123
    wrote on last edited by
    #1

    Apparently Directus supports to connect to external existing Postgres databases via custom environment variables - I wanted to try it these days and was wondering if someone has tried it already.

    Also, can I use the same to connect to the Postgres addon database which I'd use for my custom app?

    Also, can anyone recommend a free online Postgres database I could use for testing? I only know ElephantSQL, but they have announced their end of life.

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ekevu123
      wrote on last edited by
      #2

      I could successfully connect to a test postgres database with these environment variables:

      DB_HOST=IP
      DB_PORT=Port
      DB_DATABASE="db_name"
      DB_USER="user_name"
      DB_PASSWORD="password"

      Then I ran
      npx directus bootstrap
      to initialise the database.

      When I run commands like
      npx directus count table_name
      it provides correct answers indicating that the database connection works.

      However, for some reason, the database doesn't show up in my GUI.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Bookmarks
      • Search