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. Support
  3. Default Postgres settings in Digital Ocean

Default Postgres settings in Digital Ocean

Scheduled Pinned Locked Moved Solved Support
postgresql
7 Posts 3 Posters 1.6k Views 3 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.
    • N Offline
      N Offline
      nikosgpet
      wrote on last edited by girish
      #1

      Hello,

      I created a Cloudron Droplet in Digital Ocean. Now I am trying to access the Postgresql database of Cloudron, but I don't know which are the default settings.

      In the documentation, it is implied that we need to know the username, password, host and database, however all these where created by default during the installation of Cloudron, and the marketplace page doesn't have any info about those variables.

      I would be gratefull if you could point me out how I can find the necessary info to access Cloudron's database.

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        Hi, on Cloudron postgres is managed as a service for apps and thus each app will get its own set of credentials. You can read more about this at https://docs.cloudron.io/custom-apps/addons/

        What is your use-case to require direct access to the postgres database?

        1 Reply Last reply
        1
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #3

          Is this in the context of baserow?

          N 1 Reply Last reply
          0
          • N Offline
            N Offline
            nikosgpet
            wrote on last edited by
            #4

            I was trying to connect to the database of an application installed in Cloudron and visualize the database with a program like DataGrip.

            I hadn't realised that the db credentials of each app can be accessed in the environment of the app with PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE}

            The problem I faced ended up being that once DataGrip was connected to the Cloudron server with an SSH tunnel, it was expecting to be able to connect to the database in a local port. However, the postgresql container run by Cloudron doesn't expose the 5432 port, so there was no way to connect to it through a simple ssh tunnel. I ended up using a bit of a hack solution to expose the database port 5432 by running a docker container that does only that.

            docker run -d --rm --network=cloudron --name sql_redirect --link postgresql:postgresql -p 5432:1234 alpine/socat TCP-LISTEN:1234,reuseaddr,fork TCP:postgresql:5432

            1 Reply Last reply
            0
            • girishG girish

              Is this in the context of baserow?

              N Offline
              N Offline
              nikosgpet
              wrote on last edited by
              #5

              @girish Indeed it's in the context of Baserow, but my use case is general. I was trying to connect to the app's database with a program like DataGrip.

              girishG 1 Reply Last reply
              0
              • N nikosgpet

                @girish Indeed it's in the context of Baserow, but my use case is general. I was trying to connect to the app's database with a program like DataGrip.

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #6

                @nikosgpet Right, so the databases are strictly "internal" to the server and locked down for security purposes. There is no way to expose them to the outside world without creating a ssh tunnel. So, I think something like that you did is pretty much the only way.

                Does DataGrip have a way to connect via SSH tunnel (for example, like mysql workbench) ? If so, you can do something like this instead of running sql_redirect container - https://forum.cloudron.io/topic/3237/remote-sql-support-on-a-per-app-basis/2

                N 1 Reply Last reply
                1
                • girishG girish

                  @nikosgpet Right, so the databases are strictly "internal" to the server and locked down for security purposes. There is no way to expose them to the outside world without creating a ssh tunnel. So, I think something like that you did is pretty much the only way.

                  Does DataGrip have a way to connect via SSH tunnel (for example, like mysql workbench) ? If so, you can do something like this instead of running sql_redirect container - https://forum.cloudron.io/topic/3237/remote-sql-support-on-a-per-app-basis/2

                  N Offline
                  N Offline
                  nikosgpet
                  wrote on last edited by
                  #7

                  @girish thanks for the guidance, that's exactly what I was looking for

                  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