Install PostgreSQL

Install

Let's start by installing Postgres. This is for the Ubuntu operating system which you is based on Debian on top of the apt package manager. For RedHat / CentOs/ AmazonLinux you can probably use yum to install the same packages (don't hold me to that).

sudo apt-get install postgresql postgresql-contrib
sudo -u postgres psql postgres

 

Configure

Let's configure the newly installed database. The below commands create a new user, mike, creates a databse named trottier.

sudo su - postgres
psql -d template1 -U postgres
CREATE USER mike WITH PASSWORD 'myPassword';
CREATE DATABASE trottier;
GRANT ALL PRIVILEGES ON DATABASE trottier to mike;
\q

 

Verify Install

Now let's verify mike can connect to trottier

psql -d trottier -U mike

Now let's install pgadmin3:

sudo apt-get install pgadmin3
pgadmin3

Run pgadmin3 from the command line to get the graphical user interface. Connect away and use the UI to your hearts content.