Sign inSign up

corespace/factorio

By corespace

•Updated almost 2 years ago

Headless factorio gameserver with webui support

Image
Networking
Languages & frameworks
0

364

corespace/factorio repository overview

⁠Factorio Docker Game Server Documentation

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:

ParameterDescriptionExample Value
docker runInitializes a new Docker container based on an image. In this case, the corespace/factorio image.-
-tiEnables interactive mode (-i) and attach the tty terminal (-t). This allows for live monitoring.-
--name CONTAINER_NAMEProvides 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
--rmRemoves the container once it has stopped running (cleans up after itself).-
-p 8080:8080Maps 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/udpMaps 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-vProvides 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:/serverfilesMounts 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-beta1Specifies 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:

  1. Open a terminal or command prompt in your preferred working directory (where you want to store your server files).
  2. Replace all placeholder values with the desired options, such as changing "CONTAINER_NAME" and "SAVENAME" to custom names of your choice.
  3. Run the modified command to start the container and launch the Factorio game server.
  4. To access the game in your web browser, open http://localhost:8080.
  5. Once finished playing or testing, stop the container using docker stop CONTAINER_NAME (replace with your actual container name), then remove it with docker rm CONTAINER_NAME.
  6. If you want to upload mods and other files to your server, place them in your working directory on the host and ensure the $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

Tag summary

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