Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?

If you get the above error, please follow the below steps.

Above error states that postgres is not running.

  1. Running pg_lsclusters will list all the postgres clusters running on your device.

2. Most probably the status will be down if we get the above error . Try restarting Postgres clusters and service
systemctl start postgresql@12-main

3. Check ownership of postgres. Make sure that postgres is the owner of /var/lib/postgresql/version_no/main
eg: sudo chown postgres -R /var/lib/postgresql/12/main/

The issue will be resolved with the above steps. If the issue still persists then we need to debug further.

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top