Search
Close this search box.

How to run FoundryVTT in Docker on RaspberryPi under 8 minutes

If you’re struggling with how to get your FoundryVTT up and running on your Raspberry Pi this guide will walk you through the exact steps you need to take.

This guide is part of miniseries on how to easily set up fully functioning FoundryVTT on your Raspberry Pi.

We are going to create a simple samba share to access and modify our FoundryVTT content from our PC or laptop.

We are going to create our first docker compose file with FoundryVTT definitions.

And we’ll modify our firewall rules to allow traffic to FoundryVTT and we’ll be launching our FoundryVTT server for the first time.

Log in to your Pi, update packages and follow:

				
					sudo apt update && sudo apt upgrade
				
			

Start with creating a directory where we will be storing FoundryVTT data. Let me be clear here – it’s not the Foundry server itself, that will be run in the Docker container – it’s the place where our game worlds and all our custom data will be stored.

And we want it to be easily accessible so we can upload staff here.

So we’ll create simple samba share here.

				
					sudo mkdir -m 1777 ~/share
				
			

Now install samba itself

				
					sudo apt install samba samba-common-bin
				
			

To edit Samba configuration open this file /etc/samba/smb.conf

				
					sudo vim /etc/samba/smb.conf
				
			

Jump to the end of the file and a create configuration for our shared directory.

				
					[share]
Comment = pi shared folder
Path = /home/pi/share # change pi for your actual user
Browseable = yes
Writeable = yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
				
			

Save the file.

Basically what this says is that we will use our “share” directory in our home directory which in my case is /home/pi/…
We will make it browsable, and writable, and set some permissions – if you want to make your share more strict on security please refer to the samba configuration manual and set it according to your preferences.

Now that we have our share directory created. We are going to set our samba password for our user.

				
					sudo smbpasswd -a pi #change pi for your actual user
				
			

Restart the samba service for the changes to take effect.

				
					sudo service smbd restart
				
			

Now let’s create folders for our future FoundryVTT data.

				
					mkdir ~/share/foundrydata
				
			

And create a folder for docker configurations files.

				
					mkdir ~/docker
				
			

Create a file named docker-compose.yml in the docker folder. It is the place where we will setup our Foundry docker server.

				
					nano ~/docker/docker-compose.yml
				
			

And paste the content I’ve prepared for you:

				
					version: '3.9'

services:
  
  foundry:
     image: felddy/foundryvtt:release
     hostname: my_foundry_host      # change
     network_mode: host             
     init: true
     restart: "unless-stopped"
     volumes:
       - type: bind
         source: ~/share/foundrydata
         target: /data
     environment:
       - FOUNDRY_PASSWORD=          # change
       - FOUNDRY_USERNAME=          # change
       - FOUNDRY_ADMIN_KEY=         # change

version: '3.9'
				
			

This configuration uses the FoundryVTT Docker image created by “Felddy”. I would like to thank him this way. He’s doing GREAT work!

Just a quick skim through this file:

The actual version of the docker file we’re using today is 3.9
We’re going to launch one service named foundry.

Hostname – you should specify here the hostname of the server where you want to run your foundry. For example, something like foundry.helping.ninja 

network_mode:  host – this means docker container will be using the same network as our host system. This has a few drawbacks like you can’t specify port mappings between container and host system and so on, but I found it to be a little bit faster than other modes. And we’ll use nginx reverse-proxy to solve the ports issue in the next guide.

init true – don’t worry about this one

restart: “unless-stopped” this means we want our docker container to be running all the time unless we manually stop it

volumes:
– type: bind
Bind option makes this volume bind to the filesystem of your raspberry pi – so you can access it from outside of the container

source: ~/share/foundrydata # change

Source is the directory on your Raspberry Pi – we’ll use the samba share directory which we created beforehand and

target: /data
Target is the directory location inside the Foundry container – don’t change this one.The last part is the environment section. This is the section where you’ll need to put your credentials from the FoundryVTT website. To be clear, the one from where you’ve purchased your Foundry’s license.

That’s it for the foundry configuration. Save the changes and exit the file.

 

Now let’s move to the docker folder and launch our Foundry docker service.

				
					cd ~/docker
docker-compose up -d
				
			

This will download the proper images of FoundryVTT and launch it with our configuration.

One last thing. If you are running any kind of firewall you need to allow connections to your Raspberry Pi on port 30000 for the Foundry server and allow connections to your Samba share on samba port (445). 

The most common simple firewall is UFW. If you do want to allow connections to the Foundry server run these commands:

				
					sudo ufw allow 30000
sudo ufw allow samba
sudo ufw reload
				
			

Now that everything is set up head on the web browser and put in the address of our pi with port 30000.
In my case http://10.0.0.101:30000

And that’s it, if you followed my guides now you have FoundryVTT up and running on your Raspberry Pi. 

Hope it helped!

If you find these guides at least a little bit helpful please do check out my YouTube channel.

Share the Post:

Related Posts