A Guide to Self Hosting Foundry VTT on Windows 11

How I did it, anyway.

Preface

Disclaimer: This is not the most elegant or technical method to get a self-hosted Foundry VTT setup running. Reddit, the Foundry Discord, and even GitHub are bound to have more elegant, and likely more complete, guides to achieving what I do here. This site started as a way for me to log my journey into more advanced technical spaces (self hosting, virtual machines, reverse proxies, etc.) as well as learning basic HTML and CSS. It was an incredibly fun and rewarding journey that I am very glad I took. I also plan on creating a series of videos showing the steps I took. These will come in the future.

Along with this, there are some techniques that I came across after I had things set up in a way that worked for me that would have saved a significant amount of time and energy. I will point it out later when it is more appropriate, but I HIGHLY suggest watching Network Chuck's video on Cloudflare Zero Trust Tunnels. It eliminates the need for both port forwarding and reverse proxies since Cloudflare handles those on their end; its amazing. By the time I learned about it I already had Caddy set up to do the same thing so there were some conlifcts and I didn't take the time to change my process. Once I lean more into hypervisors, I plan to revisit this

With that out of the way, let’s get into this mess.

Domains and Registrars

There are several ways to get a domain to self host. In my case, I bought a domain from Cloudflare. It was recommended to me by some Cybersecurity friends and, more importantly, the prices were reasonable. The domain was around $10 USD per year. The underlying concepts are the same regardless of which registrar (Cloudflare, GoDaddy, etc) you use. Again, in my case, I used Cloudflare so the steps I will be going over will show the Cloudflare interface.

Internal Vs External IPs

I want to quickly mention internal versus external IP addresses. An internal IP address is an IP address of the devices on your home network. Its likely something along the lines of 192.168.1.101 or 10.1.10.101.

An external, or public, IP address is the IP address that your router uses to send/receive data OUTSIDE of the firewall that is part of the router. When it comes to port forwarding we are going to need to know our external IP address so we can forward connections from our website domain to the machine hosting Foundry.

I am going to reference Network Chuck's video here as well. Again, I highly recommend checking out his video and giving that process a whirl as getting things working using a zero trust tunnel will save a large amount of work and hassle.

Hardware that I Used

I use a mini PC for all of my hosting. Obiviously, you can use whatever hardware you have available to you. An old laptop? Sure, as long as it meets the minium requirements for Foundry and has a decent amount of storage space. You could even set up a VM on your main machine for incoming connections. This way connections aren't connecting directly to your main computer. I would not suggest using you main machine to host anything.

I would suggest getting all the hard drive space you can. Do you need 1TB for this? Probably not, but I'd rather have extra hard drive space instead of not enough.

Software that I Used

The list of software used is rather short:

REQUIRED

Foundry (download the linux/NodeJS version)

Node.js (Node actually runs the server)

Caddy (Handles the reverse proxy and SSL cert. Might not be necessary due to Zero Trust Tunnels)

OPTIONAL

PM2 (for running Node in the background)

Installation

The first step is to download the Linux/NodeJS version of Froundry. There is no executeable for this since we will be using Node to run Foundry on a web server. Just extract the files to the desktop.

The next step is install Node.js. This is the webserver that will run Foundry.

We will be installing Caddy through Chocolatey since, to be blunt, I'm too lazy to mess with %PATH% variables and all that. It likely isn't all that hard, but I just went the Chocolatey route.

I am going to reference Network Chuck's video here as well. Again, I highly recommend checking out his video and giving that process a whirl as getting things working using a zero trust tunnel will save a large amount of work and hassle. It essentially elimates the need for Caddy.

Running Node

Installing Node, while not hard, goes to some interesting places. This is why it is a good idea to host on a machine that isn't your every-day-use machine. Go ahead and run the installer for Node.

On the fourth page of the install wizard you will be asked if you want to automatically install the necessary tools for Node. It also mentions this will install Chocolatey. Chocolatey is a software automation management tool. For our purposes, installing Chocolatey will help in the long run since we can use it to install Caddy. If this is something you aren’t comfortable with, you can follow the instructions at the link in the installer. I will proceed assuming you have selected to automatically install the tools and Chocolatey.

This process will consume over three gigs of space and will take some time. It might even error out. If it does error out, just press ctrl+c a few times to close the window then move on

Once we have node installed and our Foundry files extracted we are going to run a quick test to make sure everything we've done so far is correct. We are going to navigate to your Foundry folder. Then enter the "resources folder". Then enter the "app" folder. Make sure no files or folders are selected or highlighted, move your cursor to an empty space, hold the SHIFT key and right click. This should bring up a context menu. In that context menu you should see "Open in Terminal" or something similar. Powershell should work fine but if you have the Linux subsystem installed you might also see an option for Linux shell but we don't want that. We are looking for either "terminal" or "powershell".

Once you have the terminal window open and you are inside the "app" folder, enter the following into the terminal window, (without quotes) "node main.js". This is telling Node to start up a webserver to host the main.js file. The main.js file is what engages Foundry to run.

Some time might go by but you should eventually see serveral lines of text and at the bottom of those lines you should see "server started and listening on port 30000". If you can see that, congratulations! You are now self hosting Fourndry VTT! Open a browser window and enter 127.0.0.1:30000 or localhost:30000. You should see the Foundry License Key Activation window. Now, if you are going to be hosting your groups locally, you can stop here. All your players need is your internal IP address (192.168.1.XXX or 10.1.10.XXX). While they are connected to your network, they can just open a browser window, enter your internal IP addres and add ":30000" (192.168.1.XXX:30000) at the end and they should be able to access your Foundry server. Remember, this assumes your Node server is running. If you are planning to have folks connect from the Internet, we have a few more steps to go.

Keep in mind, if you restart the machine Node is running on or stop Node manually, you will need to restart it. This guide will not be getting into automation in any real depth. I will leave that for you to discover!

Setting Up and Running Caddy

Caddy was, in my experience, the largest hassle in this whole journey. It is primarily developed for Linux and so most of the documentation out there uses Linux for examples. Now, this isn’t a show-stopper or anything, but I did end up getting bogged down in the minutiae of adjusting commands for Windows. This is where Network Chuck's video can really shine. So you can avoid all of the issues I had and have everything set up and ready to go in a few minutes. All that said…let’s go over what we need to do for Caddy.

We are going to use Chocolatey to install Caddy. Open a terminal window and enter “choco install caddy”. This will download some packages and ask you if you want to install them. Press “y” to install.

At this point Caddy is installed in a hidden folder called program data. Admittedly, this isn’t a huge deal but if you want to move it you could. The more important thing is creating your Caddy file so we can tell Caddy what to do when folks try to connect to our Foundry Node server. The caddy file needs to not have an extension so we might need to enable file extension in Windows Explorer.

By default, file extensions are hidden in Windows. This is to prevent people from accidentally changing a file extension and making it unusable. In our case, if you only have regular ol’ Notepad, you are going to need to remove the extension of our Caddyfile.

In a Windows Explorer window, select the “view” button along the top. From that menu find “show” at the bottom, then select “file name extensions”. This will let us change the extensions on our Caddy file and allow Caddy to use it properly. While we are at it, you might as well enable “hidden items” as well. It’s not necessary for us right now but it’s good to be able to see everything on your machines.

We are now going to create a text file called caddyfile - it should not have an extension. This means you will likely have to remove the .txt extension. Copy the text below into the file, save it, then remove the extension if you have to.

NOTE: I truly don’t remember where I got this config from. It’s most likely from the Foundry Reddit, but I can’t find it. Thanks, whoever you are out there.

# A CONFIG SECTION FOR YOUR HOSTNAME

your.hostname.com {

# PROXY ALL REQUEST TO PORT 30000

reverse_proxy localhost:30000

}

Save the file as caddyfile and remove the extension if necessary. For our purposes, you can save it to the desktop. We are going to need to point Caddy to this caddyfile when we launch it. Open a terminal window as administrator and type

“caddy run --config c:\users\youraccountname\desktop\caddyfile”.

Obviously, youaccountname needs to be changed to whatever the name of your account on your machine is.

This caddyfile is going to tell Caddy to run our reverse proxy for connections on port 30000, which is the default port that Foundry listens on. In grossly oversimplified terms, a reverse proxy encrypts and decrypts traffic and provides a layer of abstraction and control to help manage network traffic between clients and server.

And with that we should have our Caddy reverse proxy server setup along with SSL! Yay! “Can people connect to my Foundry server and play yet?” you might ask. Sadly, the answer is “not yet”. The last thing we need to tackle is port forwarding.

Port Forwarding

Final Tests

Nulla venenatis felis aliquet, sodales urna nec, laoreet nisi. Duis vitae condimentum metus, vitae pellentesque tellus. Cras vitae magna elit. Etiam porttitor bibendum ligula quis aliquam. Pellentesque quis metus scelerisque est blandit scelerisque. Nunc finibus, mi a tincidunt lacinia, enim metus elementum mi, at tincidunt orci quam quis sapien. Donec sollicitudin augue feugiat, commodo risus ac, luctus massa. Phasellus suscipit nulla nunc. Phasellus euismod in arcu id pulvinar. Etiam varius purus quis efficitur commodo. Fusce fermentum dictum sapien.

Final Tests