10 10 月 2026
本文只讲 Linux 系统开服。用 Windows 的朋友请转:《森林开服保姆级教程(Windows版)》→ https://z0w.cn/wiki/the-forest-server-guide-windows.html
Linux 系统准备见:《Linux 云服务器开服通用前置教程》→ https://z0w.cn/wiki/linux-gameserver-setup.html

一、先说清楚:官方只有 Windows 版

《森林》的专用服务端(AppID 556450)只有 Windows 二进制,没有 Linux 原生版。Linux 上跑需要 Wine。

如果你不想折腾,直接选 Windows 系统镜像是最省心的路。


二、开服前必读:三个坑

坑 1:initType 默认是 New,不存档
必须改成 Continue,否则每次重启都是新世界。

坑 2:Server.cfg 用空格分隔
serverName My Server 是对的,serverName=My Server 是错的。

坑 3:收藏夹要填查询端口
游戏里没有直连输入框,加 Steam 收藏夹时要填 27016(查询端口),不是 27015。


三、配置与端口规划

项目要求
系统Ubuntu 22.04 / Debian 12
CPU2-4 核
内存3-4G
硬盘10G
额外Wine + xvfb

端口:UDP 8766(Steam)、27015(游戏)、27016(查询)


四、安装 Wine 与依赖

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y wine wine32 wine64 winetricks xvfb screen
wine --version

准备运行库:

winetricks -q vcrun2015 dotnet48

五、SteamCMD 下载(强制 Windows 平台)

sudo useradd -m -s /bin/bash forest
sudo passwd forest
sudo su - forest

mkdir -p ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
./steamcmd.sh +quit

./steamcmd.sh +@sSteamCmdForcePlatformType windows \
  +force_install_dir /home/forest/forestserver \
  +login anonymous \
  +app_update 556450 validate \
  +quit

@sSteamCmdForcePlatformType windows 必须放在 force_install_dir 之前,且变量名开头有两个 s。


六、首次启动生成配置

cd /home/forest/forestserver
WINEDEBUG=-all xvfb-run -a wine TheForestDedicatedServer.exe

Wine 下配置文件生成在:

~/.wine/drive_c/users/你的Wine用户/AppData/LocalLow/SKS/TheForestDedicatedServer/ds/Server.cfg

找一下:

find ~/.wine -name "Server.cfg" 2>/dev/null

七、编辑 Server.cfg

nano "$(find ~/.wine -name 'Server.cfg' | head -1)"
serverIP 0.0.0.0
serverSteamPort 8766
serverGamePort 27015
serverQueryPort 27016
serverName 我的森林服
serverPlayers 8
serverPassword 进服密码
serverPasswordAdmin 管理员密码
difficulty Normal
initType Continue
slot 1
showLogs on

重点:

  • 空格分隔,不是等号
  • initType Continue 必须改,否则不存档
  • slot 是存档槽位(1-5)

八、启动脚本

/home/forest/start.sh:

#!/bin/bash
cd /home/forest/forestserver
export WINEDEBUG=-all
exec xvfb-run -a wine TheForestDedicatedServer.exe
chmod +x /home/forest/start.sh

用 screen 常驻:

screen -S forest
/home/forest/start.sh
# Ctrl+A 然后 D

九、放行端口

sudo ufw allow 8766/udp
sudo ufw allow 27015/udp
sudo ufw allow 27016/udp
sudo ufw reload

NAT 型服务器还要在服务商控制台映射。详见:《NAT 端口映射完全指南》→ https://z0w.cn/wiki/nat-port-forwarding-guide.html


十、systemd 自启(可选)

[Unit]
Description=The Forest Dedicated Server
After=network-online.target

[Service]
Type=simple
User=forest
WorkingDirectory=/home/forest/forestserver
Environment="WINEDEBUG=-all"
ExecStart=/usr/bin/xvfb-run -a /usr/bin/wine /home/forest/forestserver/TheForestDedicatedServer.exe
Restart=on-failure
RestartSec=20

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now forest
sudo journalctl -u forest -f

十一、客户端进服

游戏内 → Multiplayer → Join → Dedicated (Internet) → 搜 serverName。

搜不到就在 Steam → 视图 → 游戏服务器 → 收藏夹 → 添加 IP:27016。


十二、常见问题

Q:Wine 启动报缺运行库?
winetricks vcrun2015 dotnet48;或换用 GE-Proton 版 Wine。

Q:报 "Display not available"?
无头 Linux 需要 xvfb-run 提供虚拟显示。

Q:重启后世界重置?
initType 改 Continue。

Q:收藏夹加了连不上?
确认填的是 27016(查询端口)。

Q:服务端崩了看不到原因?
showLogs on,日志在 Wine 的 ds 目录或 ~/.wine 下找。

Q:更新?

screen -X -S forest quit
/home/forest/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType windows +force_install_dir /home/forest/forestserver +login anonymous +app_update 556450 +quit
screen -dmS forest /home/forest/start.sh

更新前备份存档(Wine 下的 SKS 目录)。


十三、总结

项目值
AppID556450
端口UDP 8766 / 27015 / 27016(查询)
Linux 支持❌ 需 Wine
启动方式xvfb-run wine TheForestDedicatedServer.exe
必改项initType Continue
配置格式空格分隔

📌 想省事直接选 Windows 镜像,官方路径最稳。
我们家的云服务器 Windows / Linux 镜像自由选择,NAT 型价格更省 → 财富云计算 https://z0w.cn
延伸阅读
  1. 网站环境怎么选:LNMP 手动 / 宝塔面板 / Docker / 云开发
  2. 问卷表单系统搭建:SurveyKing / Formbricks,数据自己收
  3. 图床搭建:Lsky Pro / Lychee,自托管图片托管方案
  4. 邮件列表搭建:listmonk 自托管 Newsletter,把读者握在自己手里
  5. 文档站点搭建:MkDocs / VuePress / Docsify,产品文档与技术手册方案
  6. RSS 阅读器搭建:FreshRSS 自托管,把信息流拿回自己手里
  7. 短链接服务搭建:Shlink 自托管,链接数据自己掌握
  8. 网站状态监控页搭建:Uptime Kuma,服务器挂了第一时间知道
更多阅读
  1. 上一篇:森林The Forest开服保姆级教程(Windows版):8人野人岛长期服
  2. 下一篇:V Rising夜族崛起开服保姆级教程(Windows版):40人吸血鬼城堡服
发表评论 1

    1. Steam 游戏配置与开服教程总索引:一页查清要吃多少配置、教程在哪 - 			财富云计算 - 维基百科的头像

      [...]这是本站长期维护的游戏配置与教程总索引。想开服,先在这页搞清楚两件事:你的游戏要吃多少配置、你的系统该看哪篇教程。建议收藏——换游戏、加 MOD、人数变多时,回来核对一遍能省掉大部分"卡爆了"和"连不上"。搭配阅读:还没买服务器?先看购前决策索引(预算分级 / NAT vs 独立 IP / 避坑清单);端口映射看不懂?先看端口速查表(40+ 游戏端口协议一页查清)。一、全游戏配置需求速查表下表按"[...]