mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-04-25 05:35:57 +03:00
[GH-ISSUE #109] Connecting to local Postgres DB's on server #88
Labels
No labels
bug
confirmed next step
duplicate
enhancement
help wanted
in progress
in progress
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pgbackweb#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ejscheepers on GitHub (Mar 19, 2025).
Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/109
I am hosting pgbackweb on my own server. On the same server I have the postgres db I want to backup, I don't want to expose the port to the internet.
But if I put localhost or 127.0.0.1 into the connection string the connection fails.
How can I fix this?
@eduardolat commented on GitHub (Mar 19, 2025):
Try with
host.docker.internalinstead oflocalhostand read more about this here.You can also check the docker network documentation.
@ejscheepers commented on GitHub (Mar 20, 2025):
Okay I managed to set it up and host.docker.internal works, but if I then
close the port on ufw it still fails.
[image: Eugene Scheepers] http://eugenescheepers.com
Eugene Scheepers
Entrepreneur
eugenescheepers.com
On March 20, 2025 at 1:24 AM, Luis Eduardo @.***)
wrote:
@eduardolat commented on GitHub (Mar 20, 2025):
That is how docker works, it creates it's own "firewall" via iptables, the best solution in your case is that if your postgresql is running using docker, you can attach both postgresql and pgbackweb to the same docker network and then use the name of the container as the host and docker will handle the underlying communication for you.
You can see an example of that in the PG Back Web README.md example, both of that containers are under the same (implicitly created) network created by docker compose so the containers can communicate each other using the container name
@ejscheepers commented on GitHub (Mar 25, 2025):
For anyone else who has this issue, I used Tailscale to solve this issue. This video helped tons: https://www.youtube.com/watch?v=tqvvZhGrciQ&t=1s
@eduardolat commented on GitHub (Mar 28, 2025):
I'm glad you fixed your problem!