Error :unable to connect to server connection to the server at port 5432 failed timeout expired

  • 15-09-2022
  • 1762
  • Ubuntu
  • Haresh Chauhan

unable to connect to server connection to the server at port 5432 failed timeout expired ubuntu.

When you try to connect a server from another server or may you are trying to connect your local system with liver sever that time this error comes even though you did a perfect configuration.

So, in this case, we need to allow the port to our server, so in this case, when you come with 5432 posts it can allow you to access the request.

How to Fix Error Cannot Access ssh to Server network connection timed out? So check whether the port you are trying to access to allowed or not in your server you just paste the below command in your server terminal.

Allow port using the below command in your server terminal.

OPEN THIS FILE
sudo nano /etc/postgresql/*/main/postgresql.conf 
REMOVE # AND ADD '*'
listen_addresses = '*'
OPEN THIS FILE
sudo nano /etc/postgresql/*/main/pg_hba.conf
ufw status
ADD
host    all             all              0.0.0.0/0              md5
host    all             all              ::/0                   md5

image

ALLOW PORT
sudo ufw allow 5432/tcp 
RESTART SERVER
sudo service postgresql restart 

We always thanks to you for reading our blogs.


dharmesh-image

Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

haresh-image

Haresh Chauhan

(Co-Founder)


We Are Also Recommending You :