Created
June 24, 2020 09:31
-
-
Save rakibulinux/7d8e3cc68a68949fffb10ed1e7be156a to your computer and use it in GitHub Desktop.
How to Install PostgreSQL and pgAdmin4 on Ubuntu 18.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
sudo apt update | |
sudo apt -y install postgresql postgresql-contrib | |
su - postgres | |
psql | |
#Now add a new password for the Postgres user by running the following query to the psql interface. | |
\password postgres | |
TYPE YOUR PASSWORD | |
#Install pgAdmin4 From Repository | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
#Install pgadmin4: It will ask for email and password. Type your own email address that will be used as a username. Then type the password. | |
sudo apt update | |
sudo apt install pgadmin4 pgadmin4-apache2 -y | |
#Visit | |
http://localhost/pgadmin4/ | |
user: postgres | |
Pass: rakib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment