Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Created January 20, 2021 21:09
Show Gist options
  • Save tangoabcdelta/152afa6cef66887af983b48513c42e24 to your computer and use it in GitHub Desktop.
Save tangoabcdelta/152afa6cef66887af983b48513c42e24 to your computer and use it in GitHub Desktop.
How to stop PostgreSQL / postgres from auto-starting during start up - Linux and Mac (how do you remove them from startup)
How to stop PostgreSQL / postgres from autostarting during start up - Linux

(works on ubuntu 16.04 or later which use systemd)

  • start - sudo service postgresql start
  • stop - sudo service postgresql stop
  • restart - sudo service postgresql restart
  • auto launch - sudo systemctl enable postgresql
  • disable auto launch - sudo systemctl disable postgresql
How to start / stop PostgreSQL / postgres on macOS (assuming you installed via homebrew)
  • start manually: pg_ctl -D /usr/local/var/postgres start
  • stop manually: pg_ctl -D /usr/local/var/postgres stop
  • start PostgreSQL server now and relaunch at login: brew services start postgresql
  • stop PostgreSQL: brew services stop postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment