Skip to content

Dokploy container cannot connect to postgres #2331

@emsitkowski

Description

@emsitkowski

To Reproduce

  1. Do Dokploy install on fresh VPS using curl -sSL https://dokploy.com/install.sh | sh.
  2. Go to dashboard url.

Current vs. Expected behavior

Dashboard is inaccessible at a given url.

Provide environment information

Hetzner VPS, Ubuntu 22.04 & 24.04.

Which area(s) are affected? (Select all that apply)

Installation

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

Hi, from 2 days I'm struggling hard to get Dokploy running on my fresh Ubuntu VPS. At first I had problem with traefik not running at all, but managed to fix this using one of the methods from this issue #2018. Right now I cannot make Dokploy dashboard run correctly. When running docker logs <container_name> i get following errors, suggesting that it cannot connect to postgres.

> dokploy@v0.24.8 start /app
> node -r dotenv/config dist/server.mjs

Default middlewares already exists
Network is already initilized
Default traefik config already exists
Migration failed Error: connect EHOSTUNREACH 10.0.1.2:5432
    at <unknown> (Error: connect EHOSTUNREACH 10.0.1.2:5432) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.0.1.2',
  port: 5432
}
Setting up cron jobs....
Main Server Error Error: connect EHOSTUNREACH 10.0.1.2:5432
    at <unknown> (Error: connect EHOSTUNREACH 10.0.1.2:5432) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.0.1.2',
  port: 5432
}
 ELIFECYCLE  Command failed.

> dokploy@v0.24.8 start /app
> node -r dotenv/config dist/server.mjs

Default middlewares already exists
Network is already initilized
Main config already exists
Default traefik config already exists
Migration failed Error: connect EHOSTUNREACH 10.0.1.2:5432
    at <unknown> (Error: connect EHOSTUNREACH 10.0.1.2:5432) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.0.1.2',
  port: 5432
}
Setting up cron jobs....
Main Server Error Error: connect EHOSTUNREACH 10.0.1.2:5432
    at <unknown> (Error: connect EHOSTUNREACH 10.0.1.2:5432) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.0.1.2',
  port: 5432
}

docker network inspect <network_name> shows that host 10.0.1.2 doesn't exist in dokploy-network:


[
    {
        "Name": "dokploy-network",
        "Id": "1iulp62ziywun8pkzlm3i8ok2",
        "Created": "2025-08-05T12:33:11.470764944+02:00",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv4": true,
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.1.0/24",
                    "Gateway": "10.0.1.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "493520d46538cd0feba44b41cea8fd175bcd0b55e759adba2dd8475c1862b945": {
                "Name": "dokploy-redis.1.xw1l15xjfynnga7r3ybw2p42r",
                "EndpointID": "41fddd6be97df0962e5859dd87f5029ebf91c2d60e275e0cc425d6245f292313",
                "MacAddress": "02:42:0a:00:01:06",
                "IPv4Address": "10.0.1.6/24",
                "IPv6Address": ""
            },
            "6a7081ab059456c2759e120c3689acca9ad1cea24d54ec627ca0b088008dd3b1": {
                "Name": "dokploy-postgres.1.lq9xdggha9giknnrwu0f28jck",
                "EndpointID": "184548ae43c223781e31e8a2e8906bbf4231b6770f23c174c329714768a1d52b",
                "MacAddress": "02:42:0a:00:01:03",
                "IPv4Address": "10.0.1.3/24",
                "IPv6Address": ""
            },
            "fd4f2ee46df7d0488322fcb0e69873c0a14434c8587cb30fa159985c404dd3e8": {
                "Name": "dokploy.1.7q2w9gxhl3l3edausyjx7jzbm",
                "EndpointID": "00c2f9500305997f9c171b4fd38d61db4da9a3ed7b36e26e925cad655521c414",
                "MacAddress": "02:42:0a:00:01:0f",
                "IPv4Address": "10.0.1.15/24",
                "IPv6Address": ""
            },
            "fe9fe9317954b25c4af27ef8cbfa72225c9fa3983d03ff0602c62f71f5943492": {
                "Name": "dokploy-traefik",
                "EndpointID": "c5a3b75ad303ae9e860d64838bf235e6da2fe22dbe11cf2aceb6e66d4c5a43f6",
                "MacAddress": "02:42:0a:00:01:0a",
                "IPv4Address": "10.0.1.10/24",
                "IPv6Address": ""
            },
            "lb-dokploy-network": {
                "Name": "dokploy-network-endpoint",
                "EndpointID": "ce22d84ebabdcd7f2c730759ff098e76b2112fac1cf5a63e7881c4c3ff48ebec",
                "MacAddress": "02:42:0a:00:01:04",
                "IPv4Address": "10.0.1.4/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "3880d3b3e31e",
                "IP": "135.181.138.249"
            }
        ]
    }
]

Why this may happen and is there any way to set correct host for postgres in manual install script?

Will you send a PR to fix it?

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions