To start the service, you can use: sudo service postgresql start
To check if the service is enabled for startup on ubuntu (systemd system manager):
sudo systemctl list-unit-files --type=service | grep postgres
UNIT FILE STATE VENDOR PRESET
postgresql.service disabled enabled
postgresql@.service indirect enabled
To enable the service to start on boot every time:
ahmar@raze:~$ sudo systemctl enable postgresql.service
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
Checking again:
sudo systemctl list-unit-files --type=service | grep postgres
UNIT FILE STATE VENDOR PRESET
postgresql.service enabled enabled
postgresql@.service indirect enabled