...
First you need to install PostgreSQL. PostGIS can be installed via the "Application Stack Builder that was installed with PostgreSQL".
After launching this \installer you will pass the following steps:
PostgreSQL/PostGIS installation on Ubuntu
...