How to make Postgres start automatically on boot

If you want to start postgres on startup so that you wont have to restart is all the time simply do:

sudo update-rc.d postgresql enable

this will always start your postgres on boot startup. hope it helps someone


From Ubuntu 15.04 onwards do:

sudo systemctl enable [SERVICE]

Which in your case is:

sudo systemctl enable postgresql

So I figured out how to boot postgresql so i dont need to do the reinstall newb move.

sudo service postgresql start

you will then need to switch to the postgres user to do any changes within Postgresql

sudo -u postgres -i

I'm sure there are much better answers to this question than mine but this might help someone in my position in the future.

I still need to make Postgresql start on boot. Anyone got the answer to that? Ill gladly mark it as correct.

Cheers

Tags:

Postgresql