Install caddy. Check that it works. Get to know what a firewall is. How it works. Forward your ports from router to the machine. (I use cockpit (preinstalled on fedora) to configure my firewall)
Use a caddyfile with the content
sub.domain.com {
reverse_proxy 192.168.178.192:8080
}
Replace 192.168.178.192 with the ip. And 8080 with the port and your domain obviously.
That's it.