10 10 月 2026

星界边境的 Linux 服务端是原生版本,而且官方建议在 Linux 上跑长期服(更稳定、资源占用低)。

这篇讲 Linux 下的完整搭建流程。

📌 系统选错了?→ 星界边境开服教程(Windows 版)
Linux 环境还没准备?→ Linux 开服通用前置教程

一、开服前必须知道的三件事

  1. ⚠️ 不能用匿名登录下载,必须用拥有这款游戏的 Steam 账号(AppID 211820)
  2. 端口只有一个:TCP 21025(是 TCP,不是 UDP)
  3. 配置是 sbboot.config(JSON),服务器程序是 linux64/starbound_server

配置建议:

项目2-6 人8-20 人
CPU2 核4 核
内存4 GB8 GB
磁盘10 GB SSD20 GB SSD
系统Ubuntu 20.04+ / Debian 11+同左

二、端口规划

用途端口协议
游戏主连接21025TCP
SSH22(映射成别的)TCP

三、准备环境

1. 建专用用户

sudo adduser --disabled-password --gecos "" starbound
sudo su - starbound

2. 装依赖

sudo apt update
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 lib32stdc++6 steamcmd

3. 放行防火墙

sudo ufw allow 22/tcp
sudo ufw allow 21025/tcp
sudo ufw enable

四、下载服务端(需要 Steam 账号)

su - starbound
steamcmd +login 你的Steam账号 +force_install_dir /home/starbound/server +app_update 211820 validate +quit
只写账号不写密码,命令行会单独提示输入,更安全。
开了 Steam Guard 会要求邮箱验证码,按提示输入。

小技巧:如果你在 Windows 机器上操作,但服务器是 Linux,可以强制下载 Linux 版本:

steamcmd +login 你的账号 +@sSteamCmdForcePlatformType linux +force_install_dir ./starbound_linux +app_update 211820 +quit

完成后:

/home/starbound/server/
├── linux64/
│   ├── starbound_server      ← 服务端主程序
│   └── sbboot.config         ← 主配置
├── assets/
│   └── packed.pak
└── storage/                  ← 存档(首次启动生成)

五、配置服务器

cd /home/starbound/server/linux64
cp sbboot.config sbboot.config.bak     # 先备份
nano sbboot.config
{
  "assetDirectories" : [
    "../assets/",
    "../mods/"
  ],
  "storageDirectory" : "../storage/",
  "defaultConfiguration" : {
    "gameServerBind" : "*",
    "queryServerBind" : "*",
    "rconServerBind" : "*",
    "serverName" : "我的星界边境服",
    "maxPlayers" : 8,
    "maxTeamSize" : 8,
    "serverUsers" : {
      "你的管理员账号" : {
        "admin" : true,
        "password" : "管理员密码"
      }
    },
    "serverPassword" : "",
    "allowAnonymousConnections" : true,
    "checkAssets" : false
  }
}

关键项:

项说明
gameServerBind设 *,:: 可能只监听 IPv6
maxPlayers最大人数
serverUsers管理员账号
serverPassword进服密码

六、启动服务器

启动脚本

nano /home/starbound/server/start.sh
#!/bin/bash
cd /home/starbound/server/linux64
./starbound_server
chmod +x /home/starbound/server/start.sh
chmod +x /home/starbound/server/linux64/starbound_server

方式一:screen

sudo apt install -y screen
screen -S starbound
./start.sh
# Ctrl+A 然后 D

方式二:systemd(推荐)

sudo nano /etc/systemd/system/starbound.service
[Unit]
Description=Starbound Dedicated Server
After=network.target

[Service]
Type=simple
User=starbound
WorkingDirectory=/home/starbound/server/linux64
ExecStart=/home/starbound/server/linux64/starbound_server
Restart=on-failure
RestartSec=15
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now starbound
sudo systemctl status starbound
sudo journalctl -u starbound -f
KillSignal=SIGINT 很重要:让服务端能优雅退出并保存宇宙数据,直接 SIGKILL 可能损坏存档。

七、加载 MOD(可选)

把 .pak 放到 /home/starbound/server/mods/,并在 assetDirectories 加上 "../mods/"。

⚠️ assetDirectories 不递归搜索,MOD 不要放在子文件夹里,直接平铺 .pak 文件。

改完重启生效。


八、玩家怎么进服

游戏内 Multiplayer → 输入 IP:21025。

连不上?

ss -tulnp | grep 21025      # 确认在监听(应为 tcp)
sudo ufw status             # 确认 21025/tcp 放行

九、常见问题排查

现象原因解决
下载失败用了 anonymous必须登录 Steam 账号
玩家连不上只开了 UDP21025 是 TCP
服务端秒退sbboot.config JSON 错检查逗号引号,恢复 .bak
Permission denied没执行权限chmod +x starbound_server
只监听 IPv6bind 是 ::改 *
存档损坏被 SIGKILL 强杀用 SIGINT 停止;定期备份
MOD 不生效目录路径没加 / 没重启加 assetDirectories + 重启
宇宙加载慢磁盘慢换 SSD

十、日常维护

# 更新(需要账号)
sudo systemctl stop starbound
su - starbound
steamcmd +login 你的账号 +force_install_dir /home/starbound/server +app_update 211820 validate +quit
exit
sudo systemctl start starbound

# 备份宇宙存档
tar -czf /backup/starbound_$(date +%Y%m%d).tar.gz /home/starbound/server/storage

十一、总结

星界边境 Linux 开服要点:

  1. 必须用自己的 Steam 账号下载
  2. 端口是 TCP 21025
  3. 配置在 linux64/sbboot.config(JSON)
  4. systemd 里设 KillSignal=SIGINT,优雅退出保存档
  5. 备份 storage 目录 = 备份整个宇宙
📌 觉得有用请点赞收藏,遇到问题评论区交流。
想省掉命令行折腾,可以看看 财富云计算 的游戏云服务器,NAT 型性价比高,适合长期挂服。
延伸阅读
  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. 上一篇:星界边境Starbound开服保姆级教程(Windows版):宇宙沙盒长期服
  2. 下一篇:太空工程师Space Engineers开服保姆级教程(Windows版):官方原生长期服
发表评论 1

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

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