Skip to main content

could not connect to database postgres

Databases • Asked by Peter Boomsma

I'm trying to install postgresql but I'm running into an error when I try to create a user:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
  Is the server running locally and accepting
  connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

It sounds like postgres isn't running. There is a ton of information on managing it from here https://help.ubuntu.com/community/PostgreSQL


Peter, is this in development or in production? If it's Linux and your on production you can do a service postgresql status to see if it it's running or a ps aux | grep -i post to see if there are any Postgres processes running.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.