Running Caddy with public MySQL

Hi,

i’m new to Caddy and im wondering if it is possible to run a mysql docker container behind Caddy and access it from another computer with the public ip address and the port 3306?

If so, how would that be possible?

1. Caddy version (caddy version):

v2.4.5

2. How I run Caddy:

Ubuntu 20.4

Caddy is an HTTP server. MySQL communicates over TCP. So no, not with vanilla Caddy.

But, you can use caddy-l4 which is a plugin that adds TCP/UDP proxy support to Caddy. Unfortunately, it currently only supports JSON config, no Caddyfile.

Be very careful about exposing your MySQL database though. That’s very dangerous unless you’ve taken the appropriate steps to lock it down from being reachable by bad actors.

This topic was automatically closed after 60 days. New replies are no longer allowed.