专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

factoriotools/factorio Docker 镜像 - 轩辕镜像

factorio
factoriotools/factorio
搭建《异星工厂》私人服务器,为好友打造稳定联机空间,共同进入危机与机遇并存的异星世界:协作采集矿石、提炼材料,设计精密自动化生产线,研发科技解锁高级设备,在抵御异星生物突袭时分工配合,于建造与生存的沉浸式体验中增进默契,尽情享受多人联机的策略布局与创造乐趣。
211 收藏0 次下载activefactoriotools镜像
🚀专业版镜像服务,面向生产环境设计
版本下载
🚀专业版镜像服务,面向生产环境设计

Factorio ![Docker Version]([] ![Docker Pulls]([] ![Docker Stars]([***]

[!NOTE] Support for ARM is experimental. Expect crashes and lag if you try to run this on a raspberry pi.

中文

  • latest, 2.0.72
  • 2, 2.0, 2.0.69, stable, stable-2.0.69

Tag descriptions

  • latest - most up-to-date version (may be experimental).
  • stable - version declared stable on factorio.com (FFF-435 Since 2.0 versions gets released as experimental first, once stable it will be marked as stable).
  • 0.x - latest version in a branch.
  • 0.x.y - a specific version.
  • 0.x-z - incremental fix for that version.

What is Factorio?

Factorio is a game in which you build and maintain factories.

You will be mining resources, researching technologies, building infrastructure, automating production and fighting enemies. Use your imagination to design your factory, combine simple elements into ingenious structures, apply management skills to keep it working and finally protect it from the creatures who don't really like you.

The game is very stable and optimized for building massive factories. You can create your own maps, write mods in Lua or play with friends via Multiplayer.

NOTE: This is only the server. The full game is available at Factorio.com, Steam, GOG.com and Humble Bundle.

Usage

Quick Start

Run the server to create the necessary folder structure and configuration files. For this example data is stored in /opt/factorio.

shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  --name factorio \
  --restart=unless-stopped \
  factoriotools/factorio

For those new to Docker, here is an explanation of the options:

  • -d - Run as a daemon ("detached").
  • -p - Expose ports.
  • -v - Mount /opt/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).

The chown command is needed because in 0.16+, we no longer run the game server as root for security reasons, but rather as a 'factorio' user with user id 845. The host must therefore allow these files to be written by that user.

Check the logs to see what happened:

shell
docker logs factorio

Stop the server:

shell
docker stop factorio

Now there's a server-settings.json file in the folder /opt/factorio/config. Modify this to your liking and restart the server:

shell
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.

shell
docker run -d -it  \
      --name factorio \
      factoriotools/factorio
docker attach factorio
RCON (2.0.18+)

Alternativly (e.g. for scripting) the RCON connection can be used to send commands to the running factorio server. This does not require the RCON connection to be exposed.

shell
docker exec factorio rcon /h
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 a data volume.

Delete the container and refresh the image:

shell
docker stop factorio
docker rm factorio
docker pull factoriotools/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 and map-settings.json files in /opt/factorio/config are used for the map settings. On subsequent runs the newest save is used.

To load an old save stop the server and run the command touch oldsave.zip. This resets the date. Then restart the server. Another option is to delete all saves except one.

To generate a new map stop the server, delete all of the saves and restart the server.

Specify a save directly (0.17.79-2+)

You can specify a specific save to load by configuring the server through a set of environment variables:

To load an existing save set SAVE_NAME to the name of your existing save file located within the saves directory, without the .zip extension:

shell
sudo docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  -e LOAD_LATEST_SAVE=false \
  -e SAVE_NAME=replaceme \
  --name factorio \
  --restart=unless-stopped \
  factoriotools/factorio

To generate a new map set GENERATE_NEW_SAVE=true and specify SAVE_NAME:

shell
sudo docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  -e LOAD_LATEST_SAVE=false \
  -e GENERATE_NEW_SAVE=true \
  -e SAVE_NAME=replaceme \
  --name factorio \
  --restart=unless-stopped \
  factoriotools/factorio

To generate a new map with a specific preset (e.g., death-world):

shell
sudo docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  -e LOAD_LATEST_SAVE=false \
  -e GENERATE_NEW_SAVE=true \
  -e SAVE_NAME=replaceme \
  -e PRESET=death-world \
  --name factorio \
  --restart=unless-stopped \
  factoriotools/factorio
Mods

Copy mods into the mods folder and restart the server.

As of 0.17 a new environment variable was added UPDATE_MODS_ON_START which if set to true will cause the mods get to updated on server start. If set a valid Factorio Username and Token must be supplied or else the server will not start. They can either be set as docker secrets, environment variables, or pulled from the server-settings.json file.

To prevent specific mods from being automatically updated, you can use the UPDATE_IGNORE environment variable with a comma-separated list of mod names. For example: UPDATE_IGNORE=mod1,mod2,mod3 will skip updates for those three mods. This can be useful to prevent compatibility issues when certain mods should remain at specific versions. Be warned that it can also create compatibility issues.

Note: When using the Space Age DLC, the built-in mods (elevated-rails, quality, and space-age) are automatically skipped during mod updates to prevent conflicts. These mods are included with the DLC and should not be downloaded separately.

Scenarios

If you want to launch a scenario from a clean start (not from a saved map) you'll need to start the docker image from an alternate entrypoint. To do this, use the example entrypoint file stored in the /factorio/entrypoints directory in the volume, and launch the image with the following syntax. Note that this is the normal syntax with the addition of the --entrypoint setting AND the additional argument at the end, which is the name of the Scenario in the Scenarios folder.

shell
docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  --name factorio \
  --restart=unless-stopped  \
  --entrypoint "/scenario.sh" \
  factoriotools/factorio \
  MyScenarioName
Converting Scenarios to Regular Maps

If you would like to export your scenario to a saved map, you can use the example entrypoint similar to the Scenario usage above. Factorio will run once, converting the Scenario to a saved Map in your saves directory. A restart of the docker image using the standard options will then load that map, just as if the scenario were just started by the Scenarios example noted above.

shell
docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  --name factorio \
  --restart=unless-stopped  \
  --entrypoint "/scenario2map.sh" \
  factoriotools/factorio
  MyScenarioName
RCON

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 "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.

Whitelisting (0.15.3+)

Create file config/server-whitelist.json and add the whitelisted users.

json
[
"you",
"friend"
]
Banlisting (0.17.1+)

Create file config/server-banlist.json and add the banlisted users.

json
[
"bad_person",
"other_bad_person"
]
Adminlisting (0.17.1+)

Create file config/server-adminlist.json and add the adminlisted users.

json
[
"you",
"friend"
]
Customize configuration files (0.17.x+)

Out-of-the box, factorio does not support environment variables inside the configuration files. A workaround is the usage of envsubst which generates the configuration files dynamically during startup from environment variables set in docker-compose:

Example which replaces the server-settings.json:

yaml
factorio_1:
  image: factoriotools/factorio
  ports:
    - "34197:34197/udp"
  volumes:
   - /opt/factorio:/factorio
   - ./server-settings.json:/server-settings.json
  environment:
    - INSTANCE_NAME=Your Instance's Name
    - INSTANCE_DESC=Your Instance's Description
  entrypoint: /bin/sh -c "mkdir -p /factorio/config && envsubst < /server-settings.json > /factorio/config/server-settings.json && exec /docker-entrypoint.sh"

The server-settings.json file may then contain the variable references like this:

json
"name": "${INSTANCE_NAME}",
"description": "${INSTANCE_DESC}",
Environment Variables

These are the environment variables which can be specified at container run time.

Variable NameDescriptionDefaultAvailable in
GENERATE_NEW_SAVEGenerate a new save if one does not exist before starting the serverfalse0.17+
LOAD_LATEST_SAVELoad latest when true. Otherwise load SAVE_NAMEtrue0.17+
PORTUDP port the server listens on341970.15+
BINDIP address (v4 or v6) the server listens on (IP[:PORT])0.15+
RCON_PORTTCP port the rcon server listens on270150.15+
SAVE_NAMEName to use for the save file_autosave10.17+
PRESETMap generation preset when GENERATE_NEW_SAVE is true0.17+
TOKENfactorio.com token0.17+
UPDATE_MODS_ON_STARTIf mods should be updated before starting the server0.17+
UPDATE_IGNOREComma-separated list of mod names to skip during automatic updates0.17+
USERNAMEfactorio.com username0.17+
CONSOLE_LOG_LOCATIONSaves the console log to the specifies location
DLC_SPACE_AGEEnables or disables the mods for DLC Space Age in mod-list.json1true2.0.8+
MODSMod directory to use/factorio/mods2.0.8+

Note: All environment variables are compared as strings

PRESET Values

The PRESET environment variable is used when generating a new map (when GENERATE_NEW_SAVE=true). It corresponds to Factorio's built-in map generation presets. Common values include:

  • default - Normal settings
  • rich-resources - Resources are more abundant
  • marathon - Recipes and technologies are more expensive
  • death-world - Biters are more aggressive and numerous
  • death-world-marathon - Combines death-world and marathon settings
  • rail-world - Resources are further apart, encouraging train usage
  • ribbon-world - Map height is limited for a unique challenge

If PRESET is not specified or left empty, the map will be generated using the settings from map-gen-settings.json and map-settings.json without a preset.

Container Details

The philosophy is to keep it simple.

  • The server should bootstrap itself.
  • Prefer configuration files over environment variables.
  • Use one volume for data.
Volumes

To keep things simple, the container uses a single volume mounted at /factorio. This volume stores configuration, mods, and saves.

The files in this volume should be owned by the factorio user, uid 845.

text
  factorio
  |-- config
  |   |-- map-gen-settings.json
  |   |-- map-settings.json
  |   |-- rconpw
  |   |-- server-adminlist.json
  |   |-- server-banlist.json
  |   |-- server-settings.json
  |   `-- server-whitelist.json
  |-- mods
  |   `-- fancymod.zip
  `-- saves
      `-- _autosave1.zip

Docker Compose

Docker Compose is an easy way to run Docker containers.

  • docker-engine >= 1.10.0 is required
  • docker-compose >=1.6.0 is required

First get a docker-compose.yml file. To get it from this repository:

shell
git clone [***]
cd factorio-docker/docker

Or make your own:

yaml
version: '2'
services:
  factorio:
    image: factoriotools/factorio
    ports:
     - "34197:34197/udp"
     - "27015:27015/tcp"
    volumes:
     - /opt/factorio:/factorio

Now cd to the directory with docker-compose.yml and run:

shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker-compose up -d
Ports
  • 34197/udp - Game server (required). This can be changed with the PORT environment variable.
  • 27015/tcp - RCON (optional).

LAN Games

Ensure the lan setting in server-settings.json is true.

json
  "visibility":
  {
    "public": false,
    "lan": true
  },

Start the container with the --network=host option so clients can automatically find LAN games. Refer to the Quick Start to create the /opt/factorio directory.

shell
sudo docker run -d \
  --network=host \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  --name factorio \
  --restart=unless-stopped  \
  factoriotools/factorio

Deploy to other plaforms

Vagrant

Vagrant is a easy way to setup a virtual machine (VM) to run Docker. The Factorio Vagrant box repository contains a sample Vagrantfile.

For LAN games the VM needs an internal IP in order for clients to connect. One way to do this is with a public network. The VM uses DHCP to acquire an IP address. The VM must also forward port 34197.

ruby
  config.vm.network "public_network"
  config.vm.network "forwarded_port", guest: 34197, host: 34197
Amazon Web Services (AWS) Deployment

If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the Factorio Server Deployment (CloudFormation) repository. This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use.

Using a reverse proxy

If you need to use a reverse proxy you can use the following nginx snippet:

stream {
  server {
      listen 34197 udp reuseport;
      proxy_pass my.upstream.host:34197;
  }
}

If your factorio host uses multiple IP addresses (very common with IPv6), you might additionally need to bind Factorio to a single IP (otherwise the UDP proxy might get confused with IP mismatches). To do that pass the BIND envvar to the container: docker run --network=host -e BIND=2a02:1234::5678 ...

Rootless Docker Support (Experimental)

Note: Rootless support is currently experimental. Please report any issues you encounter.

If you're experiencing permission issues or want better security, consider using the rootless images. These images are designed to work seamlessly with rootless Docker installations and avoid common permission problems.

What are Rootless Images?

The rootless images differ from regular images in several ways:

  • Run as UID 1000 (non-root) by default
  • No dynamic UID/GID mapping (PUID/PGID not supported)
  • No runtime chown operations
  • All directories created with open permissions during build
Rootless Image Tags

Each regular tag has a corresponding rootless version with the -rootless suffix:

  • latest-rootless (experimental)
  • stable-rootless (experimental)
  • 2.0.55-rootless (experimental)
Quick Start with Rootless
shell
docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v ~/factorio:/factorio \
  --name factorio \
  --restart=unless-stopped \
  factoriotools/factorio:stable-rootless

Key differences:

  • No chown command needed
  • No PUID/PGID environment variables
  • Runs as UID 1000 by default
  • No permission issues with volumes
When to Use Rootless Images

Consider using rootless images if you:

  • Are running Docker in rootless mode
  • Experience permission issues with volume mounts
  • Want to avoid containers running as root
  • Don't need dynamic UID/GID mapping via PUID/PGID
Limitations
  • PUID/PGID environment variables are not supported
  • Fixed to UID 1000 (may not match your host user)
  • Experimental feature - may have undiscovered issues

Troubleshooting

Permission Issues

If you're experiencing permission errors such as:

  • chown: Operation not permitted
  • Permission denied [/factorio/saves]
  • Util.cpp:81: Operation not permitted
  • Files owned by unexpected UIDs (like *** instead of 845)

Please refer to our comprehensive Permission Issues Guide for detailed solutions. Common fixes include:

  • Updating Docker to version 20.x or newer (this resolves many issues)
  • Using the rootless image variants (e.g., factoriotools/factorio:stable-rootless)
  • Setting correct ownership for your specific Docker configuration
My server is listed in the server browser, but nobody can 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.

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 for details.

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.

Contributors

  • dtandersen - Maintainer
  • Fank - Programmer of the Factorio watchdog that keeps the version up-to-date.
  • SuperSandro2000 - CI Guy, Maintainer and runner of the Factorio watchdog. Contributed version updates and wrote the Travis scripts.
  • DBendit - Coded admin list, ban list support and contributed version updates
  • Zopanix - Original Author
  • Rfvgyhn - Coded randomly generated RCON password
  • gnomus - Coded white listing support
  • bplein - Coded scenario support
  • jaredledvina - Contributed version updates
  • carlbennett - Contributed version updates and bugfixes

Footnotes

  1. Space Age mods can also be individually enabled by using their name separated by space.
    Example 1: Enable all by using true Example 2: Enable all by listing the mod names space-age elevated-rails quality
    Example 3: Enable only Elevated rails elevated-rails ↩

查看更多 factorio 相关镜像 →
goofball222/factorio logo
goofball222/factorio
by goofball222
异星工厂无头服务器Docker容器,用于运行无图形界面的游戏服务器,支持玩家联机,便于部署和后台稳定运行。
101M+ pulls
上次更新:1 个月前
einand/factorio logo
einand/factorio
by einand
Easy auto updating factorio image
10K+ pulls
上次更新:4 天前

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

oldzhang的头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
factoriotools/factorio
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
提交工单
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.