How to Configure a Public Domain for Databases in Dokploy? #1632
Replies: 6 comments
-
|
Hey @GuangYiDing, |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Siumauricio, First off, thanks for building such a great platform! I’ve been enjoying using Dokploy so far. I recently deployed a PostgreSQL database through Dokploy, and everything works well. However, I’m trying to configure a custom domain (like database.example.com) to connect to my database instead of using the external IP address that’s shown. I was wondering: Any tips or suggestions would be super helpful. I’d really appreciate your guidance! |
Beta Was this translation helpful? Give feedback.
-
|
There is currently no feature for that, there is an open issue about that #92 I think traefik has some support, I haven't done a research but I think it's possible. |
Beta Was this translation helpful? Give feedback.
-
|
I think if you deploy DB not as DB but as Compose service, Raw, expose port there, you will be able to create domain for that no problem. Of course if you have already setup domain for dokploy itself and configured subdomains in your DNS records. |
Beta Was this translation helpful? Give feedback.
-
|
I recommend deploying your DB as an application, it's not that hard just deploy from docker hub, add the env variables, and add the volume mount. Then you get access to the full set of Dokploy features. I wouldn't recommend compose because it's more confusing and internal urls between your compose database and an application don't work out of the box. |
Beta Was this translation helpful? Give feedback.
-
|
For any service which does not use http, for instance db uses tcp You need to create a new entrypoint in the static traefik config for that tcp port and then bind traefik to the host for that port. Then add a dynamic file using the new entrypoint, Please note you can only do domain based tcp routing if you are using tls, For instance if you are just connecting db.example.com:5432 with no ssl then the domain just gets converted to your ip and no routing can be done as traefik does not see anything. So no ssl = direct connection to serverip with port binding So it's not so easy, lastly unless you are db as a service then no db should be public just use ssh tunnelling or a vpn if you need external access. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Databases deployed via Dokploy (for instance, MySQL and PostgreSQL) are accessible solely via IP and port (such as http://SERVER_IP:5432). However, there is a need to expose them via a custom domain (for example, db.yourdomain.com) for external access. Is there a possibility to configure domain access through a domain-based approach?
Beta Was this translation helpful? Give feedback.
All reactions