> For the complete documentation index, see [llms.txt](https://gitbook.gpg123.vip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.gpg123.vip/ji-yu-docker-kuai-su-da-jian-fang-zhou-fu-wu-qi-jiao-cheng-hu-tong/ji-yu-docker-kuai-su-da-jian-fang-zhou-fu-wu-qi-jiao-cheng-zhi-chi-hu-tong.md).

# 基于Docker快速搭建方舟服务器教程（支持互通）

准备环境

* [x] 安装docker
* [x] 安装docker-compose
* [x] 下载镜像
* [x] 配置文件

## 操作步骤

安装docker、compose步骤省略，自行百度安装

### 1.配置环境变量文件

{% code title="models.env" lineNumbers="true" %}

```
## mods 传图，提高等级，不掉，转图纸
GAME_MOD_IDS=1404697612,751991809,761535755,1600012696,1315534671,821530042
ACTIVE_MODS=1404697612,751991809,761535755,1600012696,1315534671,821530042


```

{% endcode %}

### 2.创建docker-ompose脚本

{% code title="ark-demo.yml" lineNumbers="true" %}

```yaml
version: '3'
services:
  Fjordur:
    restart: always
    container_name: Fjordur_server
    image: registry.cn-hangzhou.aliyuncs.com/gpg_dev/ark-docker:1.1.6
    volumes:
      - /home/ark/ark-app:/app
      - /home/ark/ark-backup:/home/steam/ARK-Backups
      - ./ini/GameUserSettings.ini:/app/GameUserSettings.ini
    environment:
      ##主机服务名
      - SESSION_NAME=新开GPG-ARK永久档护肝mod高倍维京PVE
      ##地图名称
      - SERVER_MAP=Fjordur
      ##密码
      - SERVER_PASSWORD=${SERVER_PASSWORD}
      ##管理员密码
      - ADMIN_PASSWORD=gaopuguang
      ##最多玩家数
      - MAX_PLAYERS=120
      ## 游戏模式
      - SERVER_PVE=true
      #方舟集群id
      - CLUSTER_ID=gpg-ark-cluster-id
      ##激活活动事件，如圣诞、情人节、夏季、万圣
      - ACTIVE_EVENT=vay
      ##分开存放
      - ALT_SAVE_DIRECTORY_NAME=newofficialfjordur1163
      #禁用反作弊
      - DISABLE_BATTLEYE=true
      ##Port for connections from ARK game client
      - GAME_CLIENT_PORT=17001
      ##Steam's server-list port
      - SERVER_LIST_PORT=27011
      ##RCON_PORT
      - UDP_SOCKET_PORT=18001
      ##RCON management port
      - RCON_PORT=27021
    ports:
      # Port for connections from ARK game client
      - "17001:17001/udp"
      # Raw UDP socket port (always Game client port +1)
      - "18001:18001/udp"
      # RCON management port
      - "27021:27021/tcp"
      # Steam's server-list port
      - "27011:27011/udp"
    networks:
      - default
    env_file:
      - ./env/models.env


```

{% endcode %}

### `注意：想要互通集群id为必须，另外存放文件最好分开存放`

### 3.1使用docker-compose启动部署到目标服务器

<figure><img src="/files/GLmrFI9fyPdvqbdkszYA" alt=""><figcaption></figcaption></figure>

## 3.2或者将yaml文件和xxx.env文件上传到服务器

执行以下脚本

```
docker compose -f xxx.yaml up 
```

### 4.等待和查看日志内容情况

初次需要下载数据，需要等待一段时间（取决于你的网速），会下载服务端地图、modes等

```
chown: warning: '.' should be ':': 'steam.'
2024-05-31T15:26:05.592888844Z chown: warning: '.' should be ':': 'steam.'
2024-05-31T15:26:05.617504032Z Starting periodic command scheduler: cron.
2024-05-31T15:26:05.626365983Z _______________________________________
2024-05-31T15:26:05.626406187Z 
2024-05-31T15:26:05.628324251Z # Ark Server - Fri May 31 15:26:05 UTC 2024
2024-05-31T15:26:05.628361135Z # IMAGE_VERSION: '1716267709'
2024-05-31T15:26:05.629864563Z # RUNNING AS USER 'steam' - '1000'
2024-05-31T15:26:05.629882843Z # ARGS: --arkopt,-NoBattlEye -clusterid=gpg-cluster
2024-05-31T15:26:05.629888820Z _______________________________________
2024-05-31T15:26:05.630574486Z Setting up folder and file structure...
2024-05-31T15:26:05.633217263Z Installing mods: '1404697612,751991809,761535755,1600012696,1315534671,821530042' ...
2024-05-31T15:26:05.633243483Z ...installing '1404697612'
2024-05-31T15:26:05.633256830Z ...already installed
2024-05-31T15:26:05.633267791Z ...installing '751991809'
2024-05-31T15:26:05.633295474Z ...already installed
2024-05-31T15:26:05.633313483Z ...installing '761535755'
2024-05-31T15:26:05.633332449Z ...already installed
2024-05-31T15:26:05.633338676Z ...installing '1600012696'
2024-05-31T15:26:05.633386731Z ...already installed
2024-05-31T15:26:05.633411833Z ...installing '1315534671'
2024-05-31T15:26:05.633419855Z ...already installed
2024-05-31T15:26:05.633425104Z ...installing '821530042'
2024-05-31T15:26:05.633440413Z ...already installed
2024-05-31T15:26:05.633482651Z $UPDATE_ON_START is 'true'...
2024-05-31T15:26:05.653813372Z Running command 'update' for instance 'main'
2024-05-31T15:26:05.679758237Z Checking for update; PID: 47
2024-05-31T15:27:46.969095320Z steamcmd.sh[169]: Restarting steamcmd by request...
2024-05-31T15:29:19.429073166Z Your server is already up to date! The most recent version is 13834083.
2024-05-31T15:29:19.466708493Z Running command 'run' for instance 'main'
2024-05-31T15:29:19.501434626Z 2024-05-31 15:29:19: start
2024-05-31T15:29:19.505038515Z 2024-05-31 15:29:19: Running /app/server/ShooterGame/Binaries/Linux/ShooterGameServer $'Fjordur?SessionName=\346\226\260\345\274\200GPG-ARK\346\260\270\344\271\205\346\241\243\346\212\244\350\202\235mod\351\253\230\345\200\215\347\273\264\344\272\254PVE?ServerPassword?ServerAdminPassword=gaopuguang?MaxPlayers=120?GameModIds=1404697612,751991809,761535755,1600012696,1315534671,821530042?Port=7777?QueryPort=27015?RCONEnabled=True?RCONPort=27020?ServerPassword?listen' -log -NoBattlEye -log
2024-05-31T15:29:19.507884433Z 2024-05-31 15:29:19: Server PID: 236
2024-05-31T15:29:20.824076414Z [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
2024-05-31T15:29:20.878388611Z Setting breakpad minidump AppID = 346110
2024-05-31T15:30:25.023657510Z 2024-05-31 15:30:25: server is up
```

最后出现server is up 代表部署并启动成功

### 5.打开steam进行连接

填写服务器地址:127015，点击确定，等待响应后查看列表，有记录代表添加成功。

<figure><img src="/files/TO05kroQmzrWJoZ2vszt" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/dgAEpLZoIITaJhuKtg2j" alt=""><figcaption></figcaption></figure>

### 6.以上为单图配置，需要互通的话

在yaml脚本里配置相同的clusterId，不要使用中文等特赦字符！！

```
    command:
      - "-clusterid=gpg-cluster"
```

### 7.对于本地机器穿透到公网

xxx暂未尝试xxx


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.gpg123.vip/ji-yu-docker-kuai-su-da-jian-fang-zhou-fu-wu-qi-jiao-cheng-hu-tong/ji-yu-docker-kuai-su-da-jian-fang-zhou-fu-wu-qi-jiao-cheng-zhi-chi-hu-tong.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
