Cloudflare tunnels provide a way for users of your Foundry VTT server to access it securely via a domain name without needing Dynamic DNS, port forwarding, firewall rules, or dealing with SSL certificates. This works equally well on Windows, Mac, or Linux. It also allows you to host Foundry behind a Carrier Grade NAT.
At the end of this you will have:
Before getting started, you need to have at least a few things:
The logical flow from start to finish is to move an existing domain or purchase a new one in Cloudflare. Then, we'll set up a tunnel from your server to Cloudflare and test connectivity.
1. If you already own a domain, log into your Cloudflare account and begin linking your domain through Cloudflare by following these instructions. You can decline any offer of paid plans, as everything you need is in the free plan.
2. If you don't already own a domain, purchase one through Cloudflare here. Cloudflare sells them at cost, which ranges from $6 (US) per year to $30 per year.
Note: Wait at least 15 minutes before continuing. Sometimes you may have to wait up to 24 hours before the DNS settings are successfully changed. You will be notified when the nameservers are properly navigated to Cloudflare. Continue AFTER these have successfully been changed.
1. Follow the instructions here through step 1 to install cloudflared
on the same computer/server as your Foundry installation.
2. After cloudflared
is installed and connected, choose the “Public Hostname” option, select your domain name, leave the path blank, set the Type to “HTTP" and enter “localhost:30000” where 30000 is the port Foundry is running on. If you plan on using your domain for anything other than foundry, you can add a subdomain if you wish, such as foundry.example.com
.
3. Assuming everything went to plan, you should be able to refresh the webpage that has the named tunnel you just created and you should see a status of “Active”. If not, you may have to look up the docs, here and see if something may have gone wrong.
1. Ensure your foundry server is running.
2. Navigate in your web browser to domain URL.
And that should be it! If you get any errors, please refer to any of the linked documentation from Cloudflare or search Google for your specific error.