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
  • Brite
  • 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 - Status | 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 1.0k 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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      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