Mifki (http://mifki.com/df/) makes a great app for Dwarf Fortress (a video game https://en.wikipedia.org/wiki/Dwarf_Fortress) instead of having to sit at a computer to play the game, it allows you to setup 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 images are ephemeral, it means 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 setup the game and take it on the go with you using Mifki's app.
This tutorial can be done using an old laptop/computer running Linux on your home network, or through a cloud server provider like AWS which offers a free tier for one year (see this guide from AWS for help in setting that up https://repost.aws/knowledge-center/free-tier-windows-instance)
Make sure you have access to your server whether it be though a monitor, keyboard and mouse or through SSH access if you are using a dedicated server or cloud provider like AWS.
Docker is required for the game to run. Docker allows the game developers to package their program, along with all the necessary files, into on standardized "bundle" - known as a container - that can be easily transported and run on any computer, making it faster and more reliable to setup the program.
Mifiki 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 information on this see Dockers official documentation at: https://docs.docker.com/engine/install/
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 in 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
This is where docker comes into play use the following commands to start a container, copy the game files, and shutdown the temporary container
Start the temporary container - this might take a second to download and startup
sudo docker run --name df_remote_temp mifki/dfremote
Use docker copy the 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
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:
sudo - tells the computer to run the docker command with elevated privileges.
docker - is what we are using to run the container - the package of all the info needed for our game
run - means run the package!
--restart unless-stopped means that docker will start your game up even again automatically even if your computer restarts. Unless you manually stop the game
--name df_remote is specifying the name of your container to df_remote
-dp 1235:1235/udp is very important it tells the computer to map port 1235 in the container to 1235 on your computer. It allows you to open a door in your computer for your phone to be able to talk to it. (This is separate from any port forwarding or security setting in AWS you will still have to set that up separately)
-v ~/df_gamefiles/df_linux/:/df_linux This tells the docker container where to save the game files to
The technical name for this is a docker volume you can read more about that here
-v ~/df_gamefiles/df_linux/data/save/:/df_linux/data/save/ another volume configuring the container on where to save your world information
mifki/dfremote tells docker what container to use. In this case the handy container made by Mifki
To play on the go, get your servers ip address, you can do this using the command in 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!!
If it doesn't connect check the following:
Check the docker container is running use the command below and make sure your see the container called df_remote running
docker ps
Ensure your firewall is allowing port udp/1235, run the command to allow (see this page for more info http://mifki.com/df/support/firewall/)
sudo ufw allow 1235/udp
Ensure the correct port are forwarded
If you are running your own server or 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 though the security group setting for that ec2 instance, see this video (https://www.youtube.com/watch?v=j9oDMb7S6iw)
MAKE SURE TO ENTER YOUR CORRECT PORT INFORMATION THIS WILL MOST LIKELY BE UDP PORT NUMBER 1235. DO NOT OPEN A TCP PORT