Headless factorio gameserver with webui support
364
This documentation will guide you through setting up a Factorio game server using Docker. The provided command allows you to easily run the server with custom options, such as saving your game progress and mapping ports for gameplay. Here is the original command:
docker run -ti --name CONTAINER_NAME --rm -p 8080:8080 -p 34197:34197/udp -e factorio_save=SAVENAME-v $PWD:/serverfiles corespace/factorio:1.1.107-b2406002-beta1
Let's break down the command and explain each parameter:
| Parameter | Description | Example Value |
|---|---|---|
docker run | Initializes a new Docker container based on an image. In this case, the corespace/factorio image. | - |
-ti | Enables interactive mode (-i) and attach the tty terminal (-t). This allows for live monitoring. | - |
--name CONTAINER_NAME | Provides a name for the container for easier identification. Here, we'll use "CONTAINER_NAME" as a placeholder. You can change this to any custom name. | --name myfactorio-server |
--rm | Removes the container once it has stopped running (cleans up after itself). | - |
-p 8080:8080 | Maps a host port to the container's port. Here, we map the host port 8080 to the game server's default port 8080, allowing for easy access via web browser. | - |
-p 34197:34197/udp | Maps a UDP port from the host to the container. In this case, we map the host's port 34197 to the game server's default LAN port 34197 for network play. | - |
-e factorio_save=SAVENAME-v | Provides an environment variable that sets the save game name and version to SAVENAME-v. Here, replace SAVENAME with your desired save file name (without extension). The -v suffix ensures versioning for multiple saves. | -e factorio_save=mygame-v |
$PWD:/serverfiles | Mounts the current working directory on the host to a volume in the container, named "serverfiles". This allows you to upload mods and other files directly to the server. You can replace $PWD with the desired path if needed. | - |
corespace/factorio:1.1.107-b2406002-beta1 | Specifies the Docker image to use for running the game server, including its tag version. The tag 1.1.107-b2406002-beta1 corresponds to a specific build of the Factorio game server. | - |
To set up your own Factorio Docker game server:
Factorio game server.http://localhost:8080.docker stop CONTAINER_NAME (replace with your actual container name), then remove it with docker rm CONTAINER_NAME.$PWD:/serverfiles parameter remains unchanged.Example Usage:
docker run -ti --name myfactorio-server --rm -p 8080:8080 -p 34197:34197/udp -e factorio_save=mygame-v $PWD:/serverfiles corespace/factorio:1.1.107-b2406002-beta1
Content type
Image
Digest
sha256:b461b9a6c…
Size
115.5 MB
Last updated
almost 2 years ago
docker pull corespace/factorio:2.0.15-b2411001-beta