xxxxxxxxxx
>> curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
>> sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
>> sudo apt install pgadmin4
# this 3 step will makes pgadmin4 GUI install into your ubuntu machine
xxxxxxxxxx
#
# Setup the repository
#
# Install the public key for the repository (if not done previously):
sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
# Create the repository configuration file:
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
#
# Install pgAdmin
#
# Install for both desktop and web modes:
sudo apt install pgadmin4
# Install for desktop mode only:
sudo apt install pgadmin4-desktop
# Install for web mode only:
sudo apt install pgadmin4-web
# Configure the webserver, if you installed pgadmin4-web:
sudo /usr/pgadmin4/bin/setup-web.sh
# With love @kouqhar
xxxxxxxxxx
# It's fairly simple to setup:
first install postgres from:
https://www.postgresql.org/download/
then install pgadmin4:
https://www.pgadmin.org/download/
after everything installed properly,
# follow this step:
# if nano not installed install first.. it's so good.
# assuming your postgresql version is 16
sudo nano /etc/postgresql/16/main/pg_hba.conf
# repalce all method from peer/md5/ to trust like this
local all all trust
local all all trust
host all all 127.0.0.1/32 trust
host all all a::1/128 trust
ctrl + s
ctrl + x
# then run
sudo service postgresql restart
# then type
sudo -u postgres psql
# after that, type
ALTER USER postgres WITH PASSWORD 'postgres';
# now exit out of it by typing
\q
# now run again
sudo service postgresql restart
# That's all you have to do, congrats, everything will work now.
xxxxxxxxxx
$ cat /etc/apt/sources.list.d/pgadmin4.list
deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bullseye pgadmin4 main