Sentry Answers>Postgres>

psql Could Not Connect to Server: No Such File or Directory

psql Could Not Connect to Server: No Such File or Directory

Evan Hicks

The ProblemJump To Solution

When connecting to Postgres you might see this error: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket <some socket>. This happens most often when Postgres’ server daemon process is not running.

The Solution

To troubleshoot this issue, first check to make sure that Postgres is running on the machine you expect it to run. You can use the ps aux command to make sure that the postgres process is currently running. If it’s not, you will need to start Postgres.

Further Reading

If you’re looking to get a deeper understanding of how application monitoring works, take a look at the following articles:

  • ResourcesWhat is Distributed Tracing
  • Syntax.fm logo
    Listen to the Syntax Podcast

    Tasty Treats for Web Developers brought to you by Sentry. Web development tips and tricks hosted by Wes Bos and Scott Tolinski

    Listen to Syntax

Loved by over 4 million developers and more than 90,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

© 2024 • Sentry is a registered Trademark
of Functional Software, Inc.