PgAdmin 4 is a rewrite of the popular pgAdmin3 management tool for the PostgreSQL ( database. Installing the last version under CentOS 7 can be a bit tricky, here it is one way how to do it.

Download the Python wheel for the last pgAdmin release listed on the following page :

cd ~/Downloads

The pgAdmin 4 team advices to use a virtual environment therefore create one dedicated to pgAdmin.

conda create -n pgadmin4 python=3.6

Activate this new environment.

source activate pgadmin4

Install the Python wheel you just download.

pip install pgadmin4-4.3-py2.py3-none-any.whl

Check the pgAdmin4 installation location.

sudo find / -name

It should return something like:


Edit a in the same directory.

vi /home/username/anaconda3/envs/pgadmin4/lib/python3.5/site-packages/pgadmin4/

Insert (i) in it the following content:

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')

Save and close this configuration file (:wq).

Run pgAdmin 4.

python $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib() + '/pgadmin4/')")

Open the given to address ( to access the PgAdmin 4 interface.

Create a shortcut

Create a dedicated folder for your shortcuts.

mkdir ~/.shortcuts
touch ~/.shortcuts/pgadmin4
chmod +x ~/.shortcuts/pgadmin4

Edit in it a bash script for pgadmin4

vi ~/.shortcuts/pgadmin4

..with the following content:

source activate pgadmin4
python /home/username/anaconda3/envs/pgadmin4/lib/python3.5/site-packages/pgadmin4/

Save and close it (:wq).

Add the ~/.shortcuts directory to your ~/.bashrc file.

echo 'export PATH="/home/username/.shortcuts:$PATH"' >> ~/.bashrc

In a new terminal window, you will now be able to launch pgAdmin 4 just by typing the pgadmin4 command.