matiss
matiss

Reputation: 747

PostgreSQL 9.6: pgadmin4 is not opening on localhost:5050 (Ubuntu 16.04)

I've installed PostgreSQL 9.6 and pgadmin4 on Ubuntu 16.04 according to the answer here.

I'm trying to Run it with this:

cd ~/pgadmin4
source bin/activate
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

In terminal I see this back:

Starting pgAdmin 4. Please navigate to http://localhost:5050 in your browser.

however in browser it does not work - basically browser says there it can't connect.

I have modified /etc/postgresql/9.6/main/postgresql.conf to this:

listen_addresses = '*'

my /etc/postgresql/9.6/main/pg_hba.conf looks like this:

# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
host all all  0.0.0.0/0 md5

and I have modified config_local.py (in "pgAdmin4" folder) to have this:

SERVER_MODE = True
DEFAULT_SERVER = os.environ.get('PGADMIN_SERVER_IP', '0.0.0.0')
DEFAULT_SERVER_PORT = int(os.environ.get('PGADMIN_SERVER_PORT', '5050'))

How do I fix this to have pgadmin4 in localhost:5050 working, please?

Upvotes: 0

Views: 6951

Answers (2)

A RD
A RD

Reputation: 1

This is my config_local.py. Works in vagrant box ubuntu 16.04.

import os
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions') 
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
SERVER_MODE = True
DEFAULT_SERVER='0.0.0.0'

Upvotes: 0

vassil
vassil

Reputation: 11

This works for me in CentOS:

cat /usr/lib/python2.7/site-packages/pgadmin4-web/config_local.py

SERVER_MODE = True
DEFAULT_SERVER='0.0.0.0'

Upvotes: 1

Related Questions