Install Discourse for development using Docker

I thought I’d give the docker dev install another look, but keep getting:

Caused by:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (PG::ConnectionBad)
        Is the server running locally and accepting connections on that socket?

Yet I can confirm the service is up (and works when using my normal non-docker “manual” install of discourse)

~/discourse_docker/discourse$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Mon 2025-03-10 17:26:13 GMT; 6min ago
    Process: 2052109 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 2052109 (code=exited, status=0/SUCCESS)

Mar 10 17:26:13 black-knight systemd[1]: Starting PostgreSQL RDBMS...
Mar 10 17:26:13 black-knight systemd[1]: Finished PostgreSQL RDBMS.

Does Docker Dev have specific and different Postgres connectivity needs?

1 Like