Mifki makes a great app for Dwarf Fortress. Instead of having to sit at a computer to play the game, it allows you to set up a server and take the game on the go with a remote controller app.
Mifki provides a Docker image that contains all the files required to run the game and start the server connection. However, since Docker containers are ephemeral, all your in-game progress will be lost once your computer restarts or the container is stopped. This guide is for the community looking for an easy way to set up the game and take it on the go with you using Mifki's app.
Step 1: Set up a Linux server
This tutorial can be done using an old laptop/computer running Linux on your home network, or through a cloud provider like AWS, which offers a free tier for one year (see this guide from AWS for help setting that up).
Make sure you have access to your server, whether through a monitor, keyboard and mouse, or through SSH if you are using a dedicated server or a cloud provider like AWS.
Step 2: Install Docker
Docker is required for the game to run. Docker allows the game developers to package their program, along with all the necessary files, into one standardized "bundle" (known as a container) that can be easily transported and run on any computer, making it faster and more reliable to set up the program.
Mifki gives us a Docker container that contains all the files required to run the game and the remote server.
For the most up-to-date installation instructions see Docker's official documentation: https://docs.docker.com/engine/install/
Step 3: Set up your save directory
We need a folder to save your game data to. These steps will guide you through setting up that directory. I will be using a Linux Bash terminal for this; copy and paste the commands into the terminal to do this on your computer.
Make a directory called df_gamefiles in your home directory:
mkdir ~/df_gamefiles
Enter your directory using:
cd ~/df_gamefiles
Step 4: Start a temporary game to grab the required files
This is where Docker comes into play. Use the following commands to start a container, copy the game files, and shut down the temporary container.
Start the temporary container (this might take a moment to download and start up):
sudo docker run --name df_remote_temp mifki/dfremote
Use docker cp to copy the required game files from the container to the folder we created earlier:
sudo docker cp df_remote_temp:/df_linux ~/df_gamefiles
Stop and delete your temporary container:
sudo docker rm -f df_remote_temp
Step 5: Launch a new container specifying the path of the game files
We will now officially launch our game Docker image. This time, we will specify a few options with our Docker command to help the game know where to look for and where to save our game files.
The command is:
sudo docker run --restart unless-stopped --name df_remote -dp 1235:1235/udp \
-v ~/df_gamefiles/df_linux/:/df_linux \
-v ~/df_gamefiles/df_linux/data/save/:/df_linux/data/save/ \
mifki/dfremote
Breaking the command down:
sudotells the computer to run the Docker command with elevated privileges.dockeris what we are using to run the container, the package of all the info needed for our game.runmeans run the package!--restart unless-stoppedmeans that Docker will start your game up again automatically, even if your computer restarts, unless you manually stop the game.--name df_remotesets the name of your container todf_remote.-dp 1235:1235/udpis very important. It tells the computer to map port 1235 in the container to 1235 on your computer. It opens a door in your computer so your phone can talk to it. (This is separate from any port forwarding or security settings in AWS; you will still have to set that up separately.)-v ~/df_gamefiles/df_linux/:/df_linuxtells the Docker container where to save the game files. The technical name for this is a Docker volume.-v ~/df_gamefiles/df_linux/data/save/:/df_linux/data/save/is another volume, configuring where the container saves your world information.mifki/dfremotetells Docker which image to use. In this case, the handy image made by Mifki.
Step 6: Try connecting in the app
To play on the go, get your server's IP address. You can do this using the following command on your server:
curl https://checkip.amazonaws.com
Enter the IP address in the app, specify a name for your server, and leave the port number blank (this will make the app use the default UDP port of 1235).
Hit connect and start playing!!
Troubleshooting
If it doesn't connect, check the following:
- Check that the Docker container is running. Use the command below and make sure you see the container called
df_remoterunning:docker ps - Ensure your firewall is allowing port udp/1235. Run the command below to allow it (see Mifki's firewall page for more info):
sudo ufw allow 1235/udp - Ensure the correct ports are forwarded. If you are running your own server, check your port forwarding. This requires access to your router admin page and is different for every router.
- If you are running an EC2 instance you need to open the port through the security group settings for that instance. See this video for a walkthrough.