Install PostgreSQL on Ubuntu

Today I installed one more PostgreSql on one more Ubuntu. That’s why I decided to memorize my steps here for quick reference.

Install postgresql and related packages

Type in terminal:
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install pgadmin3

Setting password for postgres user

To set password for postgres user, open psql command prompt:
sudo -u postgres psql postgres
Type command
\password postgres
type password twice when prompted and please don’t forget it 🙂
press ctrl-D to exit

Create database

Database creation command:

Connect database and check installation

In  terminal

With pgadmin

Run pgadmin, for example typing in terminal
press button Add a connection, fill window New Server Registration with data:
Name: my server
Host: localhost
Port: 5432
Password: your postgres user password you entered earlier

Now you can expand localhost server in pgAdmin object browser and go to your database

Leave a Reply

Your email address will not be published.