PostgreSQL: Install pgAdmin 4 Desktop Mode in Ubuntu 16.04
PostgreSQL recently launched the new pgAdmin 4 tool to access the PostgreSQL Database Server.
In this post, I am sharing steps to install pgAdmin 4 desktop mode in Ubuntu 16.04.
First, create a virtual environment:
sudo apt-get install virtualenv python-pip libpq-dev
Create pgadmin4 virtual environment:
cd
virtualenv pgadmin4
Now, go to pgadmin4 and activate it:
cd pgadmin4
source bin/activate
Download the pgadmin4:
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.4/pip/pgadmin4-1.4-py2.py3-none-any.whl
Just check the pgadmin4:
ls -ltr
postgres@ip-172–31–27–19:~/pgadmin4$ ls -ltr
total 24
drwxrwxr-x 3 postgres postgres 4096 Jul 18 20:07 lib
drwxrwxr-x 2 postgres postgres 4096 Jul 18 20:07 include
drwxrwxr-x 3 postgres postgres 4096 Jul 18 20:07 share
drwxrwxr-x 2 postgres postgres 4096 Jul 18 20:07 local
-rw-rw-r — 1 postgres postgres 60 Jul 18 20:07 pip-selfcheck.json
drwxrwxr-x 2 postgres postgres 4096 Jul 18 20:07 bin
Now install pgadmin4:
pip install pgadmin4–1.4-py2.py3-none-any.whl
Do activate:
cd ~/pgadmin4
source bin/activate
Execute require python script:
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
Check the output:
pgAdmin 4 — Application Initialisation
======================================
The configuration database — ‘/var/lib/postgresql/.pgadmin/pgadmin4.db’ does not exist.
Entering initial setup mode…
NOTE: Configuring authentication for SERVER mode.
Enter the email address and password to use for the initial pgAdmin user account:
Email address: anveshpatel88@gmail.com
Password:
Retype password:
Password must be at least 6 characters. Please try again.
Password:
Retype password:
The configuration database has been created at /var/lib/postgresql/.pgadmin/pgadmin4.db
Starting pgAdmin 4. Please navigate to http://localhost:5050 in your browser.
Access pgadmin4 in a browser: