Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ejCFo-0004qH-5e for pgsql-general@arkaria.postgresql.org; Tue, 06 Feb 2018 23:02:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejCFm-0000GM-QN for pgsql-general@arkaria.postgresql.org; Tue, 06 Feb 2018 23:02:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ejCFm-0000GC-IX for pgsql-general@lists.postgresql.org; Tue, 06 Feb 2018 23:02:18 +0000 Received: from susanne.redcor.ch ([178.63.103.72]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ejCFe-0007gx-R0 for pgsql-general@postgresql.org; Tue, 06 Feb 2018 23:02:18 +0000 Received: from [192.168.0.220] (84-72-41-168.dclient.hispeed.ch [84.72.41.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robert@redcor.ch) by susanne.redcor.ch (Postfix) with ESMTPSA id 82B14A0441; Wed, 7 Feb 2018 00:02:09 +0100 (CET) Subject: solution: Re: pgadmin4: not possible to create server To: Adrian Klaver , "pgsql-general@postgresql.org" References: <75bd1546-6822-e366-d7da-1488074b474f@redcor.ch> <35c2c035-9911-2a5f-e54a-0b8e49dd256e@aklaver.com> <8415c4eb-d73f-1bb8-3d04-54ba32bb19cd@redcor.ch> <1259de1e-91b9-7d21-5e01-eed51b464423@aklaver.com> <5c9f1bbd-5f90-2180-5d60-5af1c17f0812@redcor.ch> <2fab5f7f-a941-cfdd-64e5-5a4f93130c9f@aklaver.com> From: robert Message-ID: <3482ea7e-1422-5226-4951-9e316561997e@redcor.ch> Date: Wed, 7 Feb 2018 00:02:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2fab5f7f-a941-cfdd-64e5-5a4f93130c9f@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian >>> So you pgAdmin4 running in a container on your local machine and >>> Postgres running in the native OS(the OS is?) on your local machine. >>> Is the Docker container set up to 'see' the local machine? >> >> what do you mean by see? > > For fuller explanation see: > > https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach > >> your hint pointed in the right direction: it is not localhost, on which the server is running, because localhost is relative to the container, so it is in effect the container itself. Postgres is running on the gatway of the containers network. This I found out by issuing: docker inspect reverent_volhard (where reverent_volhard is the containers name in which pgadmin4 runs) this providest: ...           "Networks": {                 "bridge": {                     "IPAMConfig": null,                     "Links": null,                     "Aliases": null,                     "NetworkID": "df33249ff65c37ea1ca1f142b4a74283c4429c44c3ed1eb5ea80c695c87ab86d",                     "EndpointID": "905c0c78145ef1847854f221200d8e4a7788f99b901030460111258ab9156b29",                     "Gateway": "172.17.0.1",                     "IPAddress": "172.17.0.2",                     "IPPrefixLen": 16,                     "IPv6Gateway": "",                     "GlobalIPv6Address": "",                     "GlobalIPv6PrefixLen": 0,                     "MacAddress": "02:42:ac:11:00:02",                     "DriverOpts": null                 } so postgres runs on 172.17.0.1 and bingo, it works thanks again robert