You need to make sure postgres is listening on 0.0.0.0 edit /etc/postgresql/9.6/main/postgresql.conf
and check listen_addresses = '*'
and edit /etc/postgresql/9.6/main/pg_hba.conf which has lots of comments on what all the fields mean.
I’m not sure what version of postgres debian 9 has, it might not be 9.6 but it’s the same steps with a slightly different directory for the config files, maybe /etc/postgresql/9.5/main/pg_hba.conf for example.
Please make sure to use the DB readonly! Zammad caches queries and other data which will most likely lead to some unexpected side effects and errors somewhere down the road.