Can't Open Port 5432 on Ubuntu 16.04 Server [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












BACKGROUND



Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.



I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.



ufw is enabled, and I can tell other ports are open via



nc -zv ipAddress 80,
nc -zv ipAddress 22, etc.



nc -zv ipAddress 5432 just times out. pgAdmin4 can't connect to the server via port 5432 either.



ALREADY TRIED



sudo ufw allow 5432/tcp



sudo ufw allow 5432 (just thought I'd give it a try)



In /etc/postgresql/9.5/main/postgresql.conf



listen_addresses = '*'



In /etc/postgresql/9.5/main/pg_hba.conf



host all all 0.0.0.0/0 md5
host all all ::0/0 md5


ALSO TRIED



host all all 0.0.0.0/0 trust
host all all ::0/0 trust


ACTUAL FILES



Here are the current versions of the relevant parts of the aforementioned files:



postgresql.conf



listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories


pg_hba.conf



# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5









share|improve this question















closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, Goro, RalfFriedl, Thomas
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    Have you verified that Postgres is actually running?
    – RalfFriedl
    Sep 25 at 19:07










  • Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
    – DopeGhoti
    Sep 25 at 19:09










  • Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
    – In_Circ
    Sep 25 at 19:19











  • Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
    – ivanivan
    Sep 25 at 19:54










  • @ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
    – In_Circ
    Sep 25 at 19:57














up vote
1
down vote

favorite












BACKGROUND



Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.



I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.



ufw is enabled, and I can tell other ports are open via



nc -zv ipAddress 80,
nc -zv ipAddress 22, etc.



nc -zv ipAddress 5432 just times out. pgAdmin4 can't connect to the server via port 5432 either.



ALREADY TRIED



sudo ufw allow 5432/tcp



sudo ufw allow 5432 (just thought I'd give it a try)



In /etc/postgresql/9.5/main/postgresql.conf



listen_addresses = '*'



In /etc/postgresql/9.5/main/pg_hba.conf



host all all 0.0.0.0/0 md5
host all all ::0/0 md5


ALSO TRIED



host all all 0.0.0.0/0 trust
host all all ::0/0 trust


ACTUAL FILES



Here are the current versions of the relevant parts of the aforementioned files:



postgresql.conf



listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories


pg_hba.conf



# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5









share|improve this question















closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, Goro, RalfFriedl, Thomas
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    Have you verified that Postgres is actually running?
    – RalfFriedl
    Sep 25 at 19:07










  • Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
    – DopeGhoti
    Sep 25 at 19:09










  • Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
    – In_Circ
    Sep 25 at 19:19











  • Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
    – ivanivan
    Sep 25 at 19:54










  • @ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
    – In_Circ
    Sep 25 at 19:57












up vote
1
down vote

favorite









up vote
1
down vote

favorite











BACKGROUND



Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.



I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.



ufw is enabled, and I can tell other ports are open via



nc -zv ipAddress 80,
nc -zv ipAddress 22, etc.



nc -zv ipAddress 5432 just times out. pgAdmin4 can't connect to the server via port 5432 either.



ALREADY TRIED



sudo ufw allow 5432/tcp



sudo ufw allow 5432 (just thought I'd give it a try)



In /etc/postgresql/9.5/main/postgresql.conf



listen_addresses = '*'



In /etc/postgresql/9.5/main/pg_hba.conf



host all all 0.0.0.0/0 md5
host all all ::0/0 md5


ALSO TRIED



host all all 0.0.0.0/0 trust
host all all ::0/0 trust


ACTUAL FILES



Here are the current versions of the relevant parts of the aforementioned files:



postgresql.conf



listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories


pg_hba.conf



# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5









share|improve this question















BACKGROUND



Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.



I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.



ufw is enabled, and I can tell other ports are open via



nc -zv ipAddress 80,
nc -zv ipAddress 22, etc.



nc -zv ipAddress 5432 just times out. pgAdmin4 can't connect to the server via port 5432 either.



ALREADY TRIED



sudo ufw allow 5432/tcp



sudo ufw allow 5432 (just thought I'd give it a try)



In /etc/postgresql/9.5/main/postgresql.conf



listen_addresses = '*'



In /etc/postgresql/9.5/main/pg_hba.conf



host all all 0.0.0.0/0 md5
host all all ::0/0 md5


ALSO TRIED



host all all 0.0.0.0/0 trust
host all all ::0/0 trust


ACTUAL FILES



Here are the current versions of the relevant parts of the aforementioned files:



postgresql.conf



listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories


pg_hba.conf



# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5






firewall postgresql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 25 at 19:55

























asked Sep 25 at 19:03









In_Circ

113




113




closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, Goro, RalfFriedl, Thomas
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – DopeGhoti, Goro, RalfFriedl, Thomas
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 1




    Have you verified that Postgres is actually running?
    – RalfFriedl
    Sep 25 at 19:07










  • Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
    – DopeGhoti
    Sep 25 at 19:09










  • Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
    – In_Circ
    Sep 25 at 19:19











  • Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
    – ivanivan
    Sep 25 at 19:54










  • @ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
    – In_Circ
    Sep 25 at 19:57












  • 1




    Have you verified that Postgres is actually running?
    – RalfFriedl
    Sep 25 at 19:07










  • Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
    – DopeGhoti
    Sep 25 at 19:09










  • Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
    – In_Circ
    Sep 25 at 19:19











  • Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
    – ivanivan
    Sep 25 at 19:54










  • @ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
    – In_Circ
    Sep 25 at 19:57







1




1




Have you verified that Postgres is actually running?
– RalfFriedl
Sep 25 at 19:07




Have you verified that Postgres is actually running?
– RalfFriedl
Sep 25 at 19:07












Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
– DopeGhoti
Sep 25 at 19:09




Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432)?
– DopeGhoti
Sep 25 at 19:09












Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
– In_Circ
Sep 25 at 19:19





Checked, and it is running. @DopeGhoti here's the output of that command LISTEN 0 128 *:5432 *:* LISTEN 0 128 :::5432 :::*
– In_Circ
Sep 25 at 19:19













Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
– ivanivan
Sep 25 at 19:54




Your ufw syntax looks wrong... shouldn't it be ufw allow 5432 or similar - the key being the allow part ?
– ivanivan
Sep 25 at 19:54












@ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
– In_Circ
Sep 25 at 19:57




@ivanivan you're right; I had a typo. I did use sudo ufw allow 5432/tcp in the command line, and the rules do show up under sudo ufw status
– In_Circ
Sep 25 at 19:57















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay