Postgresql Docker example


I’m trying to run the postgresql example from the osimis/orthanc-setup-samples repository, and I’m having trouble with connecting to the database. Though I’ve done a lot of experimenting with environment variables, my first question is, should this example run as downloaded?

When I run docker-compose up I get a message PluginsManager.cpp:164] PostgreSQL error: fe_sendauth: no password supplied (full log file attached orthanc_log_00_stock.txt and fwiw verbose log orthanc_log_00_stock_verbose.txt). Online references to this error message generally talk about the Postgres side of things: pg_hba.conf or postgresql.conf, but it seems more likely I’m doing something wrong. I don’t know if this is related to Postgres 9.x Docker images recently being made more secure by default (I did try POSTGRES_HOST_AUTH_METHOD: “trust” envt var in the orthanc-index section).

From this point I tried several things. I tried defining PG_PASSWORD and POSTGRES_PASSWORD in the environment sections of orthanc and orthanc-index in docker-compose.yml, but then I got the error PG: ERROR: Missing HOST setting, and if I define PG_HOST then the Docker image creates /etc/orthanc/postgresql.json, and I get errors about defining Postgresql in two config files, as this section is also defined in orthanc.json.

Another question: When I look at orthanc.json in the local Docker container (docker cp ffffff:/etc/orthanc/orthanc.json /tmp/), I don’t see any edits I make in the local orthanc.json that Dockerfile copies in to /etc/orthanc/. Is the container stored before the effect of COPY orthanc.json /etc/orthanc/? I’m (clearly) not very good at Docker.


orthanc_log_00_stock.txt (3.46 KB)

orthanc_log_00_stock_verbose.txt (54.1 KB)


If you read the documentation ( you can notice that you need to run docker-compose up --build and not only docker-compose up.

If you’re not comfortable with Docker, I would suggest you use the example that does not require to build anything and is much easier to setup.



Hi Andrew,

Yes, the samples are supposed to run as downloaded but, we missed the PG images update and indeed, it did not work with latest PG images.

I’ve fixed the samples in this commit: Thanks for pointing out the issue.

Concerning your last paragraph, with osimis/orthanc images, you’re actually have to use a configuration file or the environment variables. As soon as you use one of the PG_* env variable, the image will create a postgresql.json at startup.

Best regards,