Score:0

How to disable postgresql port for out-server connection?

br flag

I installed on my dedicated server ubuntu 20.04, docker, and container with postgressql. I have problem beacouse I want that ubuntu blocked all connection with postgressql, out-server from domain, ip server etc, which added to server.

At the moment I can connect with PostgreSQL:

  • via ssh
  • via server ip. ip.ip.ip:5432/...
  • via all domain which added to nginx like domain1.com:5432 etc.

I want disabled connection via server ip and all domain which added to nginx

in flag
If postgresql is running in a container, and your don't want to have it accessable on the outside, why do you expose the port in the first place?
plastikman156 avatar
cn flag
don't expose port inside your docker container or if you have to then control the access on firewall or whatever is in front i believe.
mxcdh avatar
br flag
@GeraldSchneider I expose the port to another container. How I can expose port only local inside in machine? plastikman156 can you explain more?
mxcdh avatar
br flag
@plastikman156 can you explain more?
in flag
If you only want to access postgres from another container then link them.
Score:0
cn flag

@mxcdh If you want your postgres container to be accessible from other docker container you don't need to expose the port, just put both containers in same docker network.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.