That error usually indicates that postgresql has not been installed yet, or is not running.
For Ubuntu, to see if any postgresql packages are installed, type in terminal window:
dpkg -l | grep -i postgresql
If nothing shows up, confirm that postgresql has not been installed manually:
psql -l
If 'psql -l' results in a list of databases or an error about "role does not exist", then posgresql is installed.
If postgresql is not installed, install it using:
apt-get install postgresql-client postgresql-contrib
To see if postgresql is running:
ps auxww | grep postgresql