Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2017 July PostgreSQL: Install pgAdmin 4 Desktop Mode in Ubuntu 16.04

PostgreSQL: Install pgAdmin 4 Desktop Mode in Ubuntu 16.04

pgadmin4

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

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:

1
sudo apt-get install virtualenv python-pip libpq-dev

Create pgadmin4 virtual environment:

1
2
cd
virtualenv pgadmin4

Now, go to pgadmin4 and activate it:

1
2
cd pgadmin4
source bin/activate

Download the pgadmin4:

1
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.4/pip/pgadmin4-1.4-py2.py3-none-any.whl

Just check the pgadmin4:

1
2
3
4
5
6
7
8
9
10
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:

1
pip install pgadmin4-1.4-py2.py3-none-any.whl

Do activate:

1
2
cd ~/pgadmin4
source bin/activate

Execute require python script:

1
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

Check the output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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:

1
http://localhost:5050
Jul 27, 2017Anvesh Patel
Greenplum: Script to check the full disk space of DCAGreenplum: Script to check Tablespace and Filespace information
Comments: 21
  1. Michel Depiesse
    August 17, 2017 at 11:02 am

    Thank you very much but
    1/ python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
    does not start Application initialisation and i a not thus asked a username/password.
    2/ /var/lib/postgresql/.pgadmin/pgadmin4.db does not exists.

    Could you help me ?

    Thanks,
    Michel

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      August 17, 2017 at 7:03 pm

      Yes sure, can you please share more detail on this?

      ReplyCancel
  2. Michel Depiesse
    August 17, 2017 at 11:32 am

    Problem solved : i found pgadmin.db in HOME/.pgadmin and i deleted it
    Thanks you and have a nice day

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      August 17, 2017 at 7:04 pm

      Ok good šŸ™‚

      ReplyCancel
  3. John
    November 9, 2017 at 2:13 pm

    Next to the word ‘Servers’, I don’t have a ‘+’ sign and cannot see any servers.

    What do I have to do to get a server to show up? Do I have to create one.

    I am successfully signed in and have restarted my machine.

    Thank you.

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      November 10, 2017 at 7:20 am

      Sorry John, not getting you. Please share more detail.

      ReplyCancel
      • John
        November 12, 2017 at 8:42 am

        Hello,

        I guess I don’t know how to create/setup a server!

        I have PostgreSQL set up on my Windows machine where I am learning from a course. The course comes with files but I don’t know how to set up server or even if I only need to set up a database. It’s pretty easy to follow in Windows!

        pgAdmin works in Ubuntu with your instructions but do I need to ‘Add New Server’ first and then create a database?

        Please advise.

        Thanks for your response….

        John

        ReplyCancel
        • Anvesh Patel
          Anvesh Patel
          November 12, 2017 at 6:53 pm

          Yes, Add server means – give your server details like Hostname, User, Password, Port, Database name. The client requires server detail for connection, for that you must install at least one instance of PostgreSQL. Use below link for installation.
          https://www.dbrnd.com/2016/04/postgresql-how-to-install-postgresql-9-4-on-ubuntu-14-04/

          ReplyCancel
          • John
            November 13, 2017 at 8:25 am

            Thank you.

            ReplyCancel
  4. John
    November 14, 2017 at 3:10 pm

    Hi,

    Following your link, everything works in terms of starting things up, but when I create a server, I get:

    Unable to connect to server:
    could not translate host name “localhost:5050” to address: Temporary failure in name resolution

    After starting pgAdmin and signing in, I use that email address as my username. I have even used ‘localhost:5050’ as well as ‘localhost’. No luck

    I’m doing something very basically wrong with creating this server but can’t work it out.

    Any ideas.

    Thanks in advance.

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      November 15, 2017 at 9:24 am

      Instead of localhost:5050, give the ip-address of local host.

      ReplyCancel
  5. John
    November 15, 2017 at 4:14 pm

    That didn’t work. I think I have issues with the config files. I’ll search for some tips on editing.

    Thanks again….

    ReplyCancel
  6. Harish Sharma
    December 14, 2017 at 12:57 pm

    Hello All,
    i am facing issue in Pgadmin4 in ubuntu

    pgAdmin is working with http://localhost:5050 but when trying to run with ip Address:5050 its saying can’t establish a connection to the server at . . . .

    already changed in postgressql.conf file and pg_hba.conf

    ReplyCancel
  7. arulraj
    February 8, 2018 at 5:38 am

    I am using Ubuntu 17.10. I try to start the pgadmin means below the error is coming.

    ImportError: cannot import name _remove_dead_weakref

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      February 12, 2018 at 5:28 pm

      try to reinstall pgadmin. It is looked like a version problem.

      ReplyCancel
  8. Rohan
    March 28, 2018 at 2:56 am

    @Anvest Patel the pgadmin4 hangs alot in ubuntu 16.04 So i will try pgadmin3. So could you tell me the steps to un-install it?

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      March 28, 2018 at 7:22 pm

      Sure, will prepare and share…

      ReplyCancel
  9. Ibrahim Rahimi
    April 1, 2018 at 6:59 am

    Thank you, it was really nice and simple.

    ReplyCancel
  10. Manish
    April 3, 2018 at 5:25 am

    Somebody copied your article verbatim and didn’t even bother to remove your email ID from within the post

    https://medium.com/@philip.mutua/postgresql-install-pgadmin-4-desktop-mode-in-ubuntu-16-04-6faca19f0cfe

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      April 3, 2018 at 6:53 pm

      Thanks Manish, I will send notice that user.

      ReplyCancel
  11. Thierno Seck
    August 10, 2018 at 11:31 am

    Hello
    I followed all steps without error, I have a cloud server VPS at OVH
    when I put
    http://vps567311.ovh.net:5050/
    It tells me I can not display the page
    Thank You

    ReplyCancel

Leave a Reply Cancel reply

CAPTCHA
Refresh

*

Anvesh Patel
Anvesh Patel

Database Engineer

ImageJuly 27, 2017 21 Comments PostgreSQLAnvesh Patel, database, database research and development, dbrnd, linux, pgadmin 4, pip, plpgsql, Postgres Query, postgresql, PostgreSQL Administrator, PostgreSQL Error, PostgreSQL Monitoring, PostgreSQL Performance Tuning, PostgreSQL Programming, PostgreSQL Tips and Tricks, Ubuntu 16.04
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
Ā© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....