Cannot connect to Port 5432

Solution 1:

Probably the postgresql service is not running (either it crashed or it is not configured to start at boot time, since you rebooted the server).

Depending on the version of Ubuntu you are using, you should try to start it with command

sudo service postgresql start

or with

sudo /etc/init.d/postgresql start

If the service starts without error, the application should be running fine.