Host Foundry VTT on your NixOS server using NodeJS and Caddy. Caddy will take care of setting up and updating an SSL certificate automatically.
- NixOS server.
- Foundry VTT license.
- Domain name with DNS configured.
-
Log in to your account on https://foundryvtt.com, go to Purchased Licenses, select Linux/NodeJS as your Operating system, and click on Download.
-
Copy the
.zip
file over to your server using e.g. scp or rsync and run the following (edit the version number).mkdir -p /opt/foundry/vtt /opt/foundry/data/Config /opt/livekit unzip FoundryVTT-xx.xxx.zip -d /opt/foundry/vtt
-
Copy the contents of options.json to your server and replace the two mentions of
domain.tld
with your own domain name.nano /opt/foundry/data/Config/options.json
-
Copy the contents of config.yaml to your server and replace the API key and secret with your own.
nix-shell -p livekit --command "livekit-server generate-keys" > /opt/livekit/config.yaml nano /opt/livekit/config.yaml
-
Copy the contents of caddy.nix to your server and replace
domain.tld
with your own domain name.nano /etc/nixos/caddy.nix
-
Copy the contents of foundry.nix to your server.
nano /etc/nixos/foundry.nix
-
Add the two new
.nix
files to yourconfiguration.nix
file's import section.nano /etc/nixos/configuration.nix
imports = [ ./caddy.nix ./foundry.nix ];
-
Rebuild NixOS to enable the new
caddy
,foundryvtt
, andlivekit
services and your new Foundry VTT server should now be online and accessible!nixos-rebuild switch
-
Lastly, when configuring your Foundry server, be sure to install the LiveKit AVClient module and enable it to use LiveKit instead of the built-in A/V client. The LiveKit Server Address will be
your-domain.tld/livekit
.