Setting up a Raspberry Pi as a FoundryVTT server.
Note: My Amazon links do not have any affiliate IDs associated and I don't benefit from you clicking them, buying through them, etc. They're provided only for convienence.
I wanted a new project just to keep busy and read about the new Foundry VTT and self hosting options. I've wanted to play around with Raspberry Pi and my project was decided. I would setup a Raspberry Pi running Foundry VTT and learn how to use Foundry VTT.
The first thing I did was research the recent releases of Raspberry Pi boards, and the various vendors that sold them and kits. After some research, I settled on a Vilros Raspberry Pi 4 Basic Start Kit. This included the Raspberry Pi Model 4b with 4GB of RAM, a case, cables, heat syncs and a fan. It did not have a MicroSD card for the OS, but I already had one of those.
Putting it all together in the case, sticking on the heat syncs, and so forth, was ridiculously easy. I think I it took me all of 20 minutes and that was because I was being meticulously cautious. Installing the OS was more problematic until I realized my MicroSD card was bad.
I went and researched various MicroSD cards, specifically for use in Raspberry Pi devices. After some deliveration, I settled on a Silicon Power 32GB 3D NAND High Speed MicroSD Card which reviews indicated the best speeds, etc.
The installation of the Raspbian OS via Noobs was pretty speedy after that and I finally had an operational Raspberry Pi. Having a fair bit of Linux knowledge (I'm a Senior Linux Systems Engineer after all), I set about securing the OS.
- Added two users, one for general use, one for admin, and disabled the default pi user. I updated sudoers to add my admin user sudo permissions.
- I turned off password login and switched everything to SSH key only authorizations and installed my public keys in the user's .ssh folder in the authorized_keys file.
- I turned off the GUI as I was running this as a server and didn't want to use the overhead leaving it running.
- Installed nodejs (required to run Foundry)
- Installed and Configured:
- Installed some needed utilities (from my perspective): vim, bsd-mailx
- Installed some security apps (iptables-persistant, fail2ban, logwatch)
- Because I wanted the server to self-update, I installed (apt-config-auto-update)
- Because I wanted a legit SSL cert, but wanted it inexpensively, I installed (certbot and apache2)
- The former allows ease of obtaining a free letsencrypt cert
- The latter because I needed to run a web server temporarily to validate the cert. I disabled apache2 afterwards.
- A few other standard things that should be done to secure the server.
I spent some time experimenting with Foundry VTT at this point and read and watched a few videos. I didn't want to go too far, because some things you decide make it difficult to change later. I'm glad I did because it helped me make a few decisions on art work, music, etc.
I installed the Savage Worlds System option, and a couple of related modules. I wanted a set of tokens and battlemaps available to any world I may run as a game. This required me creating an art folder under $HOME/foundrydata/Data and under that images, maps, and tokens. Under tokens, I created a folder for fantasy tokens and for sci-fi tokens. Because I might also play D&D, I created a set of folders under fantasy for each of the monster types (aberration, humanoids, etc.) and copied up a bunch of tokens I created with TokenTool and PNGGauntlet into their respective folders (I wanted a good set to start with.) I put a few battle maps under the maps folder and backgrounds images under images.
The Savage Worlds system includes compendiums for the edges, hindrances, and skills of SWADE, but the descriptions are empty because there isn't official support from Pinnacle Entertain Group (PEG). I could just duplicate them and then edit and fill in the details myself, however, then they are specific to the world I created. I run multiple Savage Worlds game and wanted them in a place that is available to all my games.
After more research, in the $HOME/foundrydata/Data/modules folder I created a MySavageWorlds folder. I knew I would want some compendiums that I would use in any Savage World game I ran, so I didn't want to create them all under the world (my understanding is exporting them, etc was a pain.) Under the $HOME/foundrydata/Data/modules/MySavageWorlds folder, I created a packs folder and a module.json file. In that file, I entered:
"title": "My Savage Worlds",
"description": "Shared Savage Worlds data across worlds",
"author": "Robert L Beaver",
"label": "My Edges",
"label": "My Hindrances",
"label": "My Skills",
This will give me three additional compendiums to store edges, hindrances, and skills. Because there is no official support for Savage Worlds, the System compendiums, just have "See Page X" references and they are not editable (you'd lose them on a module update if they were). I copied the dbs out of the $HOME/foundrydata/systems/swade/packs, renaming them to match the names in the path given above. This at least gives me a good place to start with the official edges, hindrances, and skills if I want to fill in the descriptions.
Now, I needed to start and run foundry vtt, but wanted an easy way to do that, auto launching the worlds, turning off unpnp, and stopping it. While I could leave it running, for security sake since my players would be remote, I turn it off at night. So I wrote a generic startvtt and stopvtt script, then a modified one to launch my world on run. I added a cron job to run stopvtt every night in case I forget to shut it down.
I updated the ports in the software firewall, configured my router to point to the port I was running the server on, and configured a domain DNS record to go to my router Internet IP address.
I launched a browser and tested the external connection and internal.
Overall, I'm pretty pleased with the setup. All I need is another firewall to create a DMZ network to protect my home network, and a reverse proxy server to eliminate the need for adding to the port number to the URL, but that's a different project.
Onward to learn how to use FoundryVTT...