pg_dump: [archiver (db)] connection to database "mydb" failed: could not connect to server: Connection refused
Is the server running on host "0.0.0.0" and accepting
TCP/IP connections on port 5432?
pg_dump -h 0.0.0.0 -U mydb -F c -f dump.tar.gz mydbuser
-h host
--host=host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.