You can run it using the following command /usr/pgadmin4/bin/setup-web.sh
Next, update the repository cache and install the latest version of pgAdmin4 with the following command: apt-get updateĪfter installing pgAdmin4, you will need to run a web setup script to configure the system to run in web mode. Next, add the pgAdmin4 repository using the following command: sh -c 'echo "deb $(lsb_release -cs) pgadmin4 main" > /etc/apt//pgadmin4.list Once installed, download and add the GPG key with the following command: curl | apt-key add So you will need to add the pgAdmin4 repository to the APT.įirst, install all the required dependencies using the following command: apt-get install curl gnupg2 -y Save and close the file then restart the PostgreSQL service to apply the changes: systemctl restart postgresqlīy default, pgAdmin4 is not included in the Ubuntu 20.04 default repository. nano /etc/postgresql/12/main/pg_hba.confĬhange the following lines: host all all 127.0.0.1/32 md5
All settings are located in /etc/postgresql/12/main/pg_hba.conf file. # Configure PostgreSQL Client Authenticationīy default, PostgreSQL uses a client authentication to control the remove database connections. Next, exit from the PostgreSQL shell with the following command: postgres=# \qĪt this point, you have a database and a user is created in the PostgreSQL server. Next, grant all the privileges to PostgreSQL database with the following command: postgres=# GRANT ALL PRIVILEGES ON DATABASE testdb to testuser Once connected, create a user and database with the following command: postgres=# CREATE USER testuser WITH PASSWORD 'password'
Next, you will need to create a database and user in PostgreSQL.įirst, connect to the PostgreSQL shell with the following command: su - postgres You should get the following output: /var/run/postgresql:5432 - accepting connections Next, verify the PostgreSQL connection with the following command: pg_isready You can verify it using the following command: ss -antpl | grep 5432 Main PID: 2284 (code=exited, status=0/SUCCESS)Īpr 12 02:06:54 ubuntu systemd: Starting PostgreSQL RDBMS.Īpr 12 02:06:54 ubuntu systemd: Finished PostgreSQL RDBMS.īY default, PostgreSQL listen on port 5432. Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled)Īctive: active (exited) since Mon 02:06:54 UTC 25s ago Next, verify the status of the PostgreSQL service using the command below: systemctl status postgresql
Once the PostgreSQL has been installed, start the PostgreSQL service and enable it to start at system reboot: systemctl start postgresql You can install it by running the following command: apt-get install postgresql -y
In this guide, we will show you how to install PostgreSQL with pgAdmin4 on Ubuntu 20.04.
It is cross-platform and can be installed on multiple platforms such as Linux, Windows and Mac OS X. It is written in Python and JQuery and has a lot of improvements compared to pgAdmin 3. It has simple and powerful web interface that helps you to write simple SQL queries to develop complex databases. PgAdmin is a free, open-source and one of the most popular database management platforms for PostgreSQL.