How to access postgres database for outside of the OR manager


How can I access postgres database from outside of OR manager (i.e pgadmin etc), do I need to add host during docker compose up?
Currently my docker compose file is following:

# OpenRemote v3 # # Profile that runs the stack by default on https://localhost using a self-signed SSL certificate, # but optionally on https://$OR_HOSTNAME with an auto generated SSL certificate from Letsencrypt. # # It is configured to use the AWS logging driver. # version: 2.4 volumes: proxy-data: manager-data: postgresql-data: services: proxy: image: openremote/proxy:${PROXY_VERSION:-latest} restart: always depends_on: manager: condition: service_healthy ports: - 80:80 - ${OR_SSL_PORT:-443}:443 - 8883:8883 - 90:90 volumes: - proxy-data:/deployment environment: LE_EMAIL: ${OR_EMAIL_ADMIN:-} DOMAINNAME: ${OR_HOSTNAME:-} DOMAINNAMES: ${OR_ADDITIONAL_HOSTNAMES:-} # USE A CUSTOM PROXY CONFIG - COPY FROM #HAPROXY_CONFIG: /data/proxy/haproxy.cfg postgresql: restart: always image: openremote/postgresql:${POSTGRESQL_VERSION:-latest} volumes: - postgresql-data:/var/lib/postgresql/data - manager-data:/storage keycloak: restart: always image: openremote/keycloak:${KEYCLOAK_VERSION:-latest} depends_on: postgresql: condition: service_healthy volumes: - ./deployment:/deployment environment: KEYCLOAK_ADMIN_PASSWORD: ${OR_ADMIN_PASSWORD:-secret} KC_HOSTNAME: ${OR_HOSTNAME:-} KC_HOSTNAME_PORT: ${OR_SSL_PORT:--1} manager: # privileged: true restart: always image: openremote/manager:${MANAGER_VERSION:-latest} depends_on: keycloak: condition: service_healthy environment: OR_SETUP_TYPE: OR_ADMIN_PASSWORD: OR_SETUP_RUN_ON_RESTART: OR_EMAIL_HOST: OR_EMAIL_USER: OR_EMAIL_PASSWORD: OR_EMAIL_X_HEADERS: OR_EMAIL_FROM: OR_EMAIL_ADMIN: OR_HOSTNAME: ${OR_HOSTNAME:-} OR_ADDITIONAL_HOSTNAMES: ${OR_ADDITIONAL_HOSTNAMES:-} OR_SSL_PORT: ${OR_SSL_PORT:–1} OR_DEV_MODE: ${OR_DEV_MODE:-false} # The following variables will configure the demo OR_FORECAST_SOLAR_API_KEY: OR_OPEN_WEATHER_API_APP_ID: OR_SETUP_IMPORT_DEMO_AGENT_KNX: OR_SETUP_IMPORT_DEMO_AGENT_VELBUS: volumes: - manager-data:/storage - ./deployment:/deployment

Next time please format your text using ```, so we can actually read the file :wink:

If you want postgres access from the network you should expose the ports on the postgresql container.
You should take security considerations though, by instead…

  • hosting the app that accesses the database within the same docker network
  • or letting a firewall / proxy block any traffic outside of your local network