|
|
|
@ -1,18 +1,9 @@
|
|
|
|
|
# Factorio [](https://microbadger.com/images/dtandersen/factorio "Get your own image badge on microbadger.com") [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
|
|
|
|
|
|
|
|
|
* `0.15.8`, `latest` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
|
|
|
|
* `0.15.6`, `0.15` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
|
|
|
|
* `0.14.23`, `0.14`, `stable` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.14/Dockerfile)
|
|
|
|
|
* `0.13.20`, `0.13` [(0.13/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.13/Dockerfile)
|
|
|
|
|
|
|
|
|
|
*Tag descriptions*
|
|
|
|
|
|
|
|
|
|
* `latest` - highest version: may be experimental.
|
|
|
|
|
* `stable` - highest version declared stable.
|
|
|
|
|
* `0.x` - highest version in a branch: may be experimental.
|
|
|
|
|
* `0.x.y` - a specific version.
|
|
|
|
|
* `0.x-dev` - whatever is in master for that version.
|
|
|
|
|
# Factorio [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
|
|
|
|
|
|
|
|
|
* `0.14.18`, `0.14`, `latest` [(0.14.18/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.18/0.14/Dockerfile)
|
|
|
|
|
* `0.14.17` [(0.14.17/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.17/0.14/Dockerfile)
|
|
|
|
|
* `0.14.16` [(0.14.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.16/0.14/Dockerfile)
|
|
|
|
|
* `0.13.20`, `0.13`, `stable` [(0.13.20/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.13.20/0.13/Dockerfile)
|
|
|
|
|
|
|
|
|
|
# What is Factorio?
|
|
|
|
|
|
|
|
|
@ -32,19 +23,14 @@ NOTE: This is only the server. The game is available at [factorio.com](https://w
|
|
|
|
|
Run the server to create the necessary folder structure and configuration files. For this example data is stored in `/tmp/factorio`.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
docker run -d -p 34197:34197/udp -p 27015:27015/tcp \
|
|
|
|
|
-v /tmp/factorio:/factorio \
|
|
|
|
|
--name factorio \
|
|
|
|
|
--restart=always \
|
|
|
|
|
dtandersen/factorio
|
|
|
|
|
docker run -d -P -v /tmp/factorio:/factorio --name factorio dtandersen/factorio
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For those new to Docker, here is an explanation of the options:
|
|
|
|
|
|
|
|
|
|
* `-d` - Run as a daemon ("detached").
|
|
|
|
|
* `-p` - Expose ports.
|
|
|
|
|
* `-P` - Expose all ports.
|
|
|
|
|
* `-v` - Mount `/tmp/factorio` on the local file system to `/factorio` in the container.
|
|
|
|
|
* `--restart` - Restart the server if it crashes and at system start
|
|
|
|
|
* `--name` - Name the container "factorio" (otherwise it has a funny random name).
|
|
|
|
|
|
|
|
|
|
Check the logs to see what happened:
|
|
|
|
@ -68,31 +54,6 @@ docker start factorio
|
|
|
|
|
Try to connect to the server. Check the logs if it isn't working.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Console
|
|
|
|
|
|
|
|
|
|
To issue console commands to the server, start the server in interactive mode with `-it`. Open the console with `docker attach` and then type commands.
|
|
|
|
|
|
|
|
|
|
docker run -d -it \
|
|
|
|
|
--name factorio \
|
|
|
|
|
dtandersen/factorio
|
|
|
|
|
docker attach factorio
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Upgrading
|
|
|
|
|
|
|
|
|
|
Before upgrading backup the save. It's easy to make a save in the client.
|
|
|
|
|
|
|
|
|
|
Ensure `-v` was used to run the server so the save is outside of the Docker container. The `docker rm` command completely destroys the container, which includes the save if it isn't stored in an data volume.
|
|
|
|
|
|
|
|
|
|
Delete the container and refresh the image:
|
|
|
|
|
|
|
|
|
|
docker stop factorio
|
|
|
|
|
docker rm factorio
|
|
|
|
|
docker pull dtandersen/factorio
|
|
|
|
|
|
|
|
|
|
Now run the server as before. In about a minute the new version of Factorio should be up and running, complete with saves and config!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Saves
|
|
|
|
|
|
|
|
|
|
A new map named `_autosave1.zip` is generated the first time the server is started. The `map-gen-settings.json` file in `/tmp/factorio/config` is used for the map settings. On subsequent runs the newest save is used.
|
|
|
|
@ -111,20 +72,11 @@ Copy mods into the mods folder and restart the server.
|
|
|
|
|
|
|
|
|
|
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
|
|
|
|
|
|
|
|
|
|
To change the password, stop the server, modify `rconpw`, and restart the server.
|
|
|
|
|
To change the password stop the server, modify `rconpw`, and restart the server.
|
|
|
|
|
|
|
|
|
|
To "disable" RCON don't expose port 27015, i.e. start the server without `-p 27015:27015/tcp`. RCON is still running, but nobody can to connect to it.
|
|
|
|
|
To "disable" RCON don't expose port 27015, i.e. start the server with `-p 34197:34197/udp` instead of `-P`. RCON still runs, but nobody is able to connect to it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Whitelisting (0.15.3+)
|
|
|
|
|
|
|
|
|
|
Create file `config/server-whitelist.json` and add the whitelisted users.
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"you",
|
|
|
|
|
"friend"
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Container Details
|
|
|
|
|
|
|
|
|
|
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
|
|
|
@ -142,8 +94,7 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|
|
|
|
|-- config
|
|
|
|
|
| |-- map-gen-settings.json
|
|
|
|
|
| |-- rconpw
|
|
|
|
|
| |-- server-settings.json
|
|
|
|
|
| `-- server-whitelist.json
|
|
|
|
|
| `-- server-settings.json
|
|
|
|
|
|-- mods
|
|
|
|
|
| `-- fancymod.zip
|
|
|
|
|
`-- saves
|
|
|
|
@ -152,34 +103,24 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|
|
|
|
|
|
|
|
|
## Ports
|
|
|
|
|
|
|
|
|
|
* `34197/udp` - Game server (required).
|
|
|
|
|
* `34197/udp` - Factorio clients (required).
|
|
|
|
|
* `27015/tcp` - RCON (optional).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Environment Variables
|
|
|
|
|
|
|
|
|
|
* `PORT` (0.15+) - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
|
|
**My server is listed in the server browser, but nobody can connect**
|
|
|
|
|
**Server is listed in the in-game server browser, but users can't connect**
|
|
|
|
|
|
|
|
|
|
Check the logs. If there is the line `Own address is RIGHT IP:WRONG PORT`, then this could be caused by the Docker proxy. If the the IP and port is correct it's probably a port forwarding or firewall issue instead.
|
|
|
|
|
If the logs say `Own address is RIGHT IP:WRONG PORT`, then this could be the problem.
|
|
|
|
|
|
|
|
|
|
By default, Docker routes traffic through a proxy. The proxy changes the source UDP port, so the wrong port is detected. See the forum post *[Incorrect port detected for docker hosted server](https://forums.factorio.com/viewtopic.php?f=49&t=35255)* for details.
|
|
|
|
|
By default, Docker routes outbound traffic through a proxy. The proxy changes the source UDP port, so the server list detects the wrong port. See [Incorrect port detected for docker hosted server](https://forums.factorio.com/viewtopic.php?f=49&t=35255).
|
|
|
|
|
|
|
|
|
|
To fix the incorrect port, start the Docker service with the `--userland-proxy=false` switch. Docker will route traffic with iptables rules instead of a proxy. Add the switch to the `DOCKER_OPTS` environment variable or `ExecStart` in the Docker systemd service definition. The specifics vary by operating system.
|
|
|
|
|
|
|
|
|
|
**When I run a server on a port besides 34197 nobody can connect from the server browser**
|
|
|
|
|
|
|
|
|
|
Use the `PORT` environment variable to start the server on the a different port, .e.g. `docker run -e "PORT=34198"`. This changes the source port on the packets used for port detection. `-p 34198:34197` works fine for private servers, but the server browser detects the wrong port.
|
|
|
|
|
To fix this port problem, start the Docker service with the `--userland-proxy=false` switch. This tells Docker to use iptables rules instead of a proxy. Add the switch to the `DOCKER_OPTS` variable or `ExecStart` in the Docker systemd service definition. The location of these files varies by OS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Contributors
|
|
|
|
|
# Credits
|
|
|
|
|
|
|
|
|
|
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
|
|
|
|
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
|
|
|
|
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
|
|
|
|
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
|
|
|
|
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update
|
|
|
|
|
Ideas borrowed from:
|
|
|
|
|
|
|
|
|
|
* [Zopanix](https://github.com/zopanix/docker_factorio_server)
|
|
|
|
|
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio)
|
|
|
|
|