Easy FoundryVTT setup using Docker (2024)

FoundryVTT has long been my VTT of choice, beating the outdated Roll20 and clunky desktop app Fantasy Grounds in all departments. I’d invested a fair bit of time and effort into both before discovering Foundry four years ago and haven’t looked back since.

Easy FoundryVTT setup using Docker (1)

Getting into Foundry is quite cost effective, it has a one off fee of £40 and there are often sales. Once you’ve paid for a licence you have three options for running it:

  1. Subscribe to The Forge (or similar services, listed here) to host your games from $3.99 a month. An attractive option if you don’t want to bother with tech set up and are prepared to pay the cost. You do have to upload all assets to the Forge, but that’s no different to Roll20.

  2. Self-host using another host such as AWS or Digital Ocean. This requires a fair bit more technical setup and you will incur usage costs.

  3. Self-host from your own computer. This can be a good option as you have no ongoing costs, but it can seem daunting to set up, but it’s how I have been running Foundry for the last 4 years (saving ££’s on hosting fees).

In this post I’m going to go through my set-up in the hopes it might help someone else run Foundry like this.

Considerations

You can download a desktop app to run Foundry, all you need to do is open up port 30000 to allow your players to connect to your computer; by default it will run over http (which we know is generally not a good thing as requests are not encrypted), but you can configure it to run over https. You can also run it as a node app if you know what you’re doing, it’s how I was running it for a while.

If I was running the client or node like this, I’d want to use https. While it’s unlikely, if there was a security loophole in the Foundry code it could be exploited to gain access to your computer.

Port Forwarding

By default your web browser has strict controls over which ports can connect to your machine, for example ports 80 for http and 443 for https. For Foundry you need to open port 30000, which you need to do on your router or hub device from your ISP. Foundry has a page explaining how to do it here. You should be setting up Port Forwarding to map requests to your computer to port 30000 to port 30000 on your computer, this is blocked by default, but Port Forwarding should allow it. You could map a different port if you wanted, but be aware that some other services use other ports (for example you could map 29999 to 30000 instead).

Data Folder

You also need to know about the Foundry Data folder. This starts with a default location for Windows and MacOS (and I imagine Linux as well), but you can change it which I’d advise. Moving it also means you can have different data folders for different Foundry versions running their own containers. However, the real benefit of moving the Data folder is you can move it to Cloud backup so that you always have a copy if something went wrong with your set up. I back mine up to Dropbox, but you should be able to use any Cloud service (although I did have some weird sync problems with Google Drive, so I’d avoid that one).

Docker

For the last year or two I’ve used Docker to run Foundry in a container. This isn’t quite the same as a virtual machine, but offers many of the same benefits including ring-fencing the potential damage if someone was got exploit a Foundry loophole. Another advantage of using Docker is you can create different containers for multiple versions of Foundry.

Before we get onto Docker config you need to know about the Foundry Data folder. This starts with a default location for Windows and MacOS (and I imagine Linux as well), but you can change it which I’d advise. Moving it also means you can have different data folders for different Foundry versions running their own containers. However, the real benefit of moving the Data folder is you can move it to Cloud backup so that you always have a copy if something went wrong with your set up. I back mine up to Dropbox, but you should be able to use any Cloud service (although I did have some weird sync problems with Google Drive, so I’d avoid that one).

So once you’ve decided to use Docker and understand where to place your Data folder you can get started on setting things up.

Download Docker

The next step is to download Docker Desktop for your operating system, you can grab it here.

Easy FoundryVTT setup using Docker (2)

Once installed you’ll need to create a docker-compose.yml file in a folder of your choosing with these contents:

services: foundry: image: felddy/foundryvtt:12.331 container_name: foundryvtt-v12-331-container hostname: your.hostname volumes: - type: bind source: /parent/folder/of/data target: /data bind: create_host_path: true environment: - FOUNDRY_PASSWORD=${FVTT_PASSWD} - FOUNDRY_USERNAME=${FVTT_USERNAME} - FOUNDRY_ADMIN_KEY=${FVTT_ADMIN_KEY} - FOUNDRY_MINIFY_STATIC_FILES=true - FOUNDRY_PROXY_SSL=true - FOUNDRY_HOSTNAME=your.hostname - CONTAINER_CACHE=/data/container_cache - CONTAINER_PRESERVE_CONFIG=true - TIMEZONE=Europe/London ports: - target: 30000 published: 30000 protocol: tcp

I use a .env file to store the password, username and admin key, but you can embed them direct into the docker-compose.yml file if you prefer.

FOUNDRY_PASSWORD=Your account password for foundryvtt.comFOUNDRY_USERNAME=Your account username for foundryvtt.comFOUNDRY_ADMIN_KEY=Your admin password for this foundry instance

Finally turn to the command line. You can access this from your start menu in Windows or use a Terminal app in MacOS and Linux.

Command Line

If you’re not familiar with command line, it’s just another way of issuing commands on your command other than clicking on things with your mouse. Although it may feel a little archaic if you’re not used to it, command line is still heavily used and can be much more powerful than point and click. It is more frequently called a Terminal.

Windows

I haven’t fired up my Windows machine for a while and I’m not going to just for this. Off the top of my head, you go to the start menu, type cmd and click the Command Prompt option. This will pop up the command line Window. This page has more info https://www.lifewire.com/how-to-open-command-prompt-2618089.

MacOS/Linux

Open the Terminal app from Launchpad or type Terminal into Spotlight Search.

Once you’ve opened the command line/terminal enter these commands one at a time, pressing the enter key after each one. You’ll need to know the location of your docker-compose.yml file for the cd command.

cd location/of/docker-compose.ymldocker-compose up -d

cd is the change directory command, so you’re changing to the directory where your docker-compose.yml file was created.

docker-compose up tells docker to follow the instructions in the docker-compose.yml file. The -d switch is for detached mode, so after the container has been built, control returns to the command line.

If you look in Docker Desktop you’ll see your container running in the containers tab.

With that you should be able to browse to http://localhost:30000 to access your new Foundry instance.

Some final bits of advice:

  • Test connecting to your local Foundry instance from outside your network by browsing to http://your_ip_address:30000. If that works it means your players will be able to connect when you run Docker.

  • Shut your Docker instance down when you’re not using it.

And a caveat with all this. It’s a while since I set this up, so I’ve probably missed something, let me know if that’s the case and I’ll update these instructions.

Easy FoundryVTT setup using Docker (2024)

FAQs

Is Docker easy to set up? ›

Docker Desktop is a free, easy-to-install, downstream application for a Mac or Windows environment. The application lets you build and share containerized applications and microservices. Docker consists of Docker Engine, Docker Compose, Docker CLI client, Docker Content Trust, Kubernetes, and Credential Helper.

Does Cloud Foundry use Docker? ›

When you supply a Docker image for your application, Cloud Foundry: fetches the Docker image. uses the image layers to construct a base filesystem.

How to create Minecraft server in Docker? ›

Build the Docker image: Open a terminal, navigate to the directory containing the `Dockerfile`, and run the following command to build the Docker image: docker build -t minecraft-server . This command will build the Docker image and tag it with the name `minecraft-server`.

How to setup a simple Apache web server in a Docker container? ›

Method 2 : Creating an Apache Web Server using Dockerfile.
  1. Step 1: Install Docker. ...
  2. Step 2: Create a Directory. ...
  3. Step 3: Navigate to the Directory. ...
  4. Step 4: Create Dockerfile. ...
  5. Step 5: Build Docker Image. ...
  6. Step 6: List Docker Images. ...
  7. Step 7: Run Docker Container. ...
  8. Step 8: Inside the Container, Start HTTPD.
Dec 14, 2023

Why I don't use Docker? ›

Docker is great for developing web applications, but if your end-product is a desktop application, then we would suggest you not to use Docker. As it doesn't provide the environment for running the software with a graphical interface, you would need to perform additional workarounds.

Is Docker still worth learning? ›

It's true that Docker and Kubernetes have become increasingly popular in the world of web development and are considered valuable skills for a full stack developer. Docker allows for containerization, making it easier to deploy and manage applications across different environments.

Is Cloud Foundry deprecated? ›

Cloud Foundry is deprecated on IBM Cloud as of October 2022.

Where not to use Docker? ›

An application designed to run in a Docker container on Windows can't run on Linux, and vice versa. Virtual machines are not subject to this limitation. In highly heterogeneous environments composed of both both Windows and Linux servers, this makes Docker less attractive. Run applications with graphical interfaces.

Does Cloud Foundry use containers? ›

It uses a container-based architecture to run, update, and deploy apps in any programming language over a variety of cloud service providers – public or private.

Is Docker good for Minecraft servers? ›

Rather than running it just per the directions, I decided to make a Docker image to simplify the deployment. That way, so long as I have Docker running on a machine, I can download and install a Minecraft server with a few easy commands. That alone makes Docker a really great tool for this application.

What is the difficulty in Docker Minecraft server? ›

The difficulty level (default: easy ) can be set like: docker run -d -e DIFFICULTY=hard ... Valid values are: peaceful , easy , normal , and hard , and an error message will be output in the logs if it's not one of these values.

How do you host a simple Minecraft server? ›

Make a Minecraft server on your Windows PC
  1. Get the latest version of Java. Open the Windows Control Panel. ...
  2. Choose a location for your Minecraft server files. ...
  3. Download and start the Minecraft server software. ...
  4. Enable port forwarding on your router. ...
  5. Start the Minecraft server. ...
  6. Connecting to your server.
Feb 12, 2024

Why is nginx better than Apache? ›

Since NGINX is designed to be efficient, it doesn't need to search for . htaccess files and interpret them, allowing it to serve a request faster than Apache. NGINX keeps your server secure by disallowing additional configuration since only users with root permission can alter the server and site settings.

How to use docker as a server? ›

The steps to create and run containers on Windows Server using Docker can be summarized as follows:
  1. Install Docker. In PowerShell (run as Administrator) enter: ...
  2. Create a Docker file and download a container image. ...
  3. Build and run the container.
Jan 8, 2024

How to setup a webserver with docker? ›

You can download it from the official Docker website.
  1. Step 1: Create a Directory. Create a directory and navigate to it in the terminal. ...
  2. Step 2: Create a Dockerfile. ...
  3. Step 3: setup your Dockerfile. ...
  4. Step 4: Build the Docker Image. ...
  5. Step 5: Run the Docker Container. ...
  6. Step 6: Access Your Apache Web Server.
Jan 5, 2024

Is Docker difficult to learn? ›

Whether you are learning it for your development, operation, or infrastructure needs, Docker is pretty simple.

How long does it take to install Docker? ›

Run through the installation instructions and initial setup page; they are straightforward and should take only a few minutes (not counting download time). Below are instructions for all steps after that first page, so you shouldn't need to go to any other pages in the Docker documentation.

How long will it take to learn Docker? ›

If you are learning to use Docker, I'd give you around 4–16 hours of playing with it, to be able to create your own image, build it, run it and understand what is going on. Depending on your experience and enthusiasm, you might find yourself at the lower end of the spectrum in terms of learning time…

How long does Docker take to start? ›

Starting Docker can take a while — up to 5 minutes. While it's doing so, an animation runs in the notification area: Another notification appears when it's finished. When Docker has finished starting up, share your hard drive with Docker: click the system tray docker icon; select "settings"; select "shared drives".

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Manual Maggio

Last Updated:

Views: 6217

Rating: 4.9 / 5 (49 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.