Sunday, September 20, 2020

Debian Buster: install pgadmin4 (fresh postgresql 11)

  1. Download apt key https://www.pgadmin.org/static/packages_pgadmin_org.pub and add key
    # wget https://www.pgadmin.org/static/packages_pgadmin_org.pub
    # apt-key add packages_pgadmin_org.pub
  2. Create and append pgadmin4 repository
    # echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list
  3. Run update & install pgadmin4-desktop
    # apt-get update
    # apt-get install pgadmin4-desktop

By default postgres user has no password in database (not system). You need to set/change postgres database password. From root linux shell
# su - postgres
$ psql
# \password
<type_your_password>

Try login to your postgres using psql
$ psql -U postgres  -h localhost
Password for user postgres:
psql (11.7 (Debian 11.7-0+deb10u1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=#

After running pgadmin4, pgadmin4 server will started and the first time you need to create master password (NOTE: master password is password to use pgadmin4).

Connect to your local postgresql server

  1. From your browser http://127.0.0.1:41271/browser/, Add New Server
  2. Fill
    1. Connection: localhost (your connection name)
    2. Port: 5432
    3. Maintenance Database: postgres
    4. Username: postgres
    5. Password: <your password>
  3. and Save

Reference:
https://www.pgadmin.org/download/pgadmin-4-apt/

 

No comments:

Post a Comment