Docker is not an officially supported installation method. If you need support while using a docker container you will need to contact the container author.
You can use Docker to run Foundry VTT. You may use several different approaches.
Here is a table of the approaches detailed within as well as notes on their complexity and extra features.
Author | Difficulty | Extra Features | Notes |
---|---|---|---|
mikysan | simple | Simple Dockerfile | |
Jake | simple | Updated version of mikysan's | |
Felddy | moderate | Set and Forget, Configurable | |
trotroyanas | moderate | ||
thomasfa18 | moderate | ||
DireckHit | complex | Traefik, Portainer | Good for Remote Hosting |
Vicknesh | complex | Caddy for TLS | |
MBRound18's | simple | auto restarts on issues | Simple drop in link and ready to go |
BTBTravis' | moderate | fly.io deploy | Deploy to fly.io via Dockerfile |
Dockerfile and guides for manual and docker-compose setup available at https://github.com/mikysan/simple-fvtt-dockerfile.
You can get a Foundry Virtual Tabletop instance up and
running in minutes using this container. This Docker container is designed to
be secure, reliable, compact, and simple to use. It only requires that you
provide the credentials or URL needed to download a Foundry Virtual Tabletop
release.
You can use the following command to start up a Foundry Virtual Tabletop server.
Your foundryvtt.com credentials are required so the
container can install and license your server.
docker run \
--env FOUNDRY_USERNAME='<your_username>' \
--env FOUNDRY_PASSWORD='<your_password>' \
--publish 30000:30000/tcp \
--volume <your_data_dir>:/data \
felddy/foundryvtt:release
If you are using bash
, or a similar shell, consider pre-pending the Docker
command with a space to prevent your credentials from being committed to the
shell history list. See:
HISTCONTROL
Alternatively, you may acquire a temporary download token from your user profile
page on the Foundry website. On the "Purchased Licenses" page, click the [🔗]
icon to the right of the standard Node.js
download link to obtain a temporary
download URL for the software.
docker run \
--env FOUNDRY_RELEASE_URL='<temporary_url>' \
--publish 30000:30000/tcp \
--volume <your_data_dir>:/data \
felddy/foundryvtt:release
For more information about the available configuration options please see the project README. If you have any questions please feel free to contact me on the FoundryVTT discord: @felddy
We wrote a full guide for setting up this Docker image on a Synology NAS. The guide also covers HTTPS configuration.
Please visit DirecktHit's blog for the most up to date directions.
docker-compose
Please visit the README in the fvtt-docker repository for the most up to date directions.
* Dockerfile
* docker-compose.yml
* foundryvtt-x.x.x.zip (Available on [https://foundryvtt.com](foundryvtt.com))
Dockerfile describe installation of your container
FROM alpine:3.13
# Set the foundry install home
RUN adduser -D foundry
RUN mkdir -p /home/foundry/fvtt
RUN mkdir -p /home/foundry/fvttdata
ENV FOUNDRY_HOME=/home/foundry/fvtt
ENV FOUNDRY_DATA=/home/foundry/fvttdata
RUN apk add --update nodejs=14.16.1-r1
# Set the current working directory
WORKDIR "${FOUNDRY_HOME}"
#copy found
COPY ./foundryvtt-0.8.5.zip .
#unzip
RUN unzip foundryvtt*.zip
RUN rm foundryvtt*.zip
EXPOSE 30000
CMD node ${FOUNDRY_HOME}/resources/app/main.js --dataPath=${FOUNDRY_DATA}
version: '3.3'
services:
fvtt:
container_name: Fvtt
build:
context: ./
dockerfile: ./Dockerfile
image: fvtt:3.0
volumes:
- /data/your/folder/app:/home/foundry/fvtt
- /data/your/folder/data:/home/foundry/fvttdata
ports:
- "30000:30000"
copy your foundryvtt-x.8.5.zip file to the same level as the other files
sudo docker-compose build
After build image you can use or test your container with this commands :
Run the container (for test no save modifications)
sudo docker run --restart=unless-stopped --name Fvtt -p 30000:30000 -d fvtt:3.0
sudo docker run \
--restart=unless-stopped \
--name Fvtt \
-p 30000:30000 \
-v /data/your/folder/app:/home/foundry/fvttd \
-v /data/your/folder/data:/home/foundry/fvttdata \
-d fvtt:3.0
updated version of mikysan's dockerfile.
Using the node version zip. Extract the contents into foundryvtt directory below. This dockerfile will copy your modules, worlds, assets, etc. into your docker image.
I created a directory structure as:
* FoundryVtt
* foundryvtt
* foundrydata
* Config
* Data
* Logs
* Dockerfile
FROM node:12-alpine
ENV UID=1000
ENV GUID=1000
RUN deluser node
RUN adduser -u $UID -D foundry
USER foundry
RUN mkdir -p /home/foundry/data
RUN mkdir -p /home/foundry/app
WORKDIR /home/foundry/data
COPY --chown=$UID /foundrydata/ .
WORKDIR /home/foundry/app
COPY /foundryvtt/ .
EXPOSE 80:30000
CMD ["node", "/home/foundry/app/resources/app/main.js", "--headless", "--dataPath=/home/foundry/data" ]
docker build . -t {something/something}
after the build is finished
docker run --rm -it -p 80:30000/tcp {something/something}:latest
This is a prebuilt node image that expects to have two paths (pkg & data) mounted to it:
/pkg - which is the contents of the node.js foundryvtt.zip from foundryvtt.com
/data - this is/will be your userdata folder. (If you are migrating from an existing install you can copy your existing data or target that folder)
The benefit of this image is that your app and data is decoupled from the node.js instance so you can place them on a shared folder if you like, and because ts a dockerhub image is can be easily pulled and run by many standalone home NAS devices (synology and qnap for instance).
Firstly configure you app and data directories (if you are using a NAS, create these folder on your NAS)
Docker
foundry
pkg
and another folder called data
pkg
folderdata
folderTo download and run the container on a synology NAS
docker/foundry/data
as mount path /data
and docker/foundry/pkg
as /pkg
It is a similar process to achieve the same using a computer, assuming you have already installed docker
docker pull thomasfa18/node-foundry:latest
docker run -v [your windows path to foundry data]:/data -v [your windows path to the extracted node.js foundry package]:/pkg -it -p 30000:30000 thomasfa18/node-foundry:latest
-it
runs the container interactively, if you close the command window you will shut down the container. If you omit the -it
form the command you will need to find the container name using docker stats
or something to be able to shut it down via docker kill [container name]
Guide for setting up FoundryVTT with Caddy for TLS can be found https://github.com/svicknesh/foundryvtt-docker-deploy
docker run --rm -it \
-p 4444:4444 \
-e HOSTNAME="127.0.0.1" \
-e SSL_PROXY="false" \
-v ${PWD}/foundry/data:/foundrydata \
-v ${PWD}/foundry/app:/foundryvtt \
mbround18/foundryvtt-docker:latest
Please visit the README in the travisshears/foundry-vtt repository for the most up to date instructions.