部署Terraria服务器
部署Terraria服务器
Zgfnye本文给出了通过VPS搭建游戏Terraria的服务器端的具体流程:
部署原版terraria服务器
购买/试用以及配置VPS
VPS的试用链接:
阿里云:https://free.aliyun.com
300元优惠券领取:https://university.aliyun.com
流量使用情况查询:https://billing-cost.console.aliyun.com/finance/expense-report/expense-detail-by-instance
CDT每月免费20GB流量升级:https://cdt.console.aliyun.com/overview
VPS的选择
镜像:选择系统镜像 Ubuntu20.04
配置:2CPU、2 GB RAM 和 40 GB 磁盘
配置VPS
放行端口:TCP:7777
配置Terraria服务器
连接服务器
下载安装FinalShell:https://www.hostbuf.com/t/988.html
打开FinalShell,点击左上角文件夹图标,在弹出的窗口内点击左上角白色文件夹图标,点击SSH连接(linux)
SSH连接填写细则:
名称:随意填写
主机:VPS的
公网IP
端口:22
用户名:root
密码:VPS的
登入密码
在FinalShell上配置服务器端
安装.NET
1 | wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb |
安装.screen
1 | sudo apt-get install screen |
安装Terraria服务器
1 | wget https://gh-proxy.zgfnye.ggff.net/https://github.com/Pryaxis/TShock/releases/download/v5.1.3/TShock-5.1.3-for-Terraria-1.4.4.9-linux-x64-Release.zip |
启动Terraria服务器
1 | cd Tshock |
查看进程以及杀死进程
1 | free -h # 查看系统的内存使用情况 |
部署tModLoader服务器
由于前置准备和部署原版Terraria一致,这里着重介绍如何部署服务器端
安装tModLoader
1 | wget https://github.com/tModLoader/tModLoader/releases/download/v2025.03.3.1/tModLoader.zip |
下载并上传Mods
进入steam/tModLoader/创意工坊,在下载模组内下载Mod,在管理模组内启用所有Mods,然后在模组整合包内将Mods生成整合包并命名
打开模组整合包文件夹,将整合包对于的文件夹打包成zip,并复制文件路径
打开powershell,输入:
1 | scp "D:\ZGFNYE\Documents\My Games\Terraria\tModLoader\Mods\ModPacks\server.zip" root@<IP of your server>:~ |
然后输入服务器密码就可以将整合包传输到服务器内
安装Mods
进入服务器界面,输入:
1 | cd |
启动服务器
1 | cd tModLoader |