Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026
The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.
Fix the “could not connect to server” error
If you installed PostgreSQL in the past using Homebrew, then updated its version with brew upgrade, you might not be able to start it again.
Whenever you try to access it, you get this error:
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
The server might be running fine (you can check with ps aux | grep postgres), but connections fail.
The simplest solution is to reinstall PostgreSQL:
brew uninstall postgresql
brew install postgresql
brew services start postgresql
After this, you should be able to connect to the database again.