Database Port Forwarding
What problem will this feature address?
When I use the Dokploy DB service I am not able to expose a port to the host like in Docker Compose, unless of course I manually expose it through the command line. This would be useful as then we could still leverage the Dokploy build in backup and restore while providing a secure way to tunnel to the server without exposing the port to the public.
Describe the solution you'd like
I successful solution would be to add a field to allow us to forward ports to the host. Not just external like the current implementation.
Describe alternatives you've considered
I could manually run a docker service update
--publish-add target=5432,published=
Problem is when I redeploy it gets wiped out.
Additional context
I may try and implement this when I have some time if nobody gets to it first.
Will you send a PR to implement it?
No
Here are some approaches that I believe you can consider:
-
Port Mapping in Dokploy:
Dokploy already supports mapping ports for database services. You can refer to the official documentation on configuring external connections and port mappings here: External Credentials Documentation. -
Exposing Ports to Other Services:
If your goal is just to expose the port to other services within the same Docker network, you can use theexposeparameter in yourdocker-compose.ymlfile. Example:services: database: image: postgres:latest expose: - "5432" -
Publicly Exposing Ports with the Same Default Port for Multiple Services:
If you want to publicly expose the default port (e.g.,5432) for multiple database services in Dokploy, without having to map different ports for each service, you’ll need to configure Traefik to handle TCP connections with TLS and SNI. This setup allows secure routing and efficient use of ports.
Can I reach DB from SSH as well (not only other docker services), without exposing port externally to the internet? I could use any decent DB client via SSH tunnel.
You could also deploy a vpn into the same docket network, something like twingate Or similar solution. The tunneling also works, it really depends on your exposure level.JasonSent from my iPhoneOn Oct 28, 2025, at 11:18 AM, Dmytro @.***> wrote:dmythro left a comment (Dokploy/dokploy#1741) Can I reach DB from SSH as well (not only other docker services), without exposing port externally to the internet? I could use any decent DB client via SSH tunnel.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>