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

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

官方QQ群: 1072982923

ryshe/terraria Docker 镜像 - 轩辕镜像

terraria
ryshe/terraria
自动构建
提供支持原版及移动设备的Terraria服务器,集成TShock工具以实现管理功能。
133 收藏0 次下载activeryshe镜像
🚀专业版镜像服务,面向生产环境设计
版本下载
🚀专业版镜像服务,面向生产环境设计

Terraria

[UPDATE] I know a lot of people are excited for Terraria v1.4 Journey's End! This source code is built around the pre-release of TShock. Will continue to update as new releases come out.

[UPDATE 2] Added a mobile-1.4.0.5 tag to for those that want a dedicated mobile server. It runs similar to the vanilla-* version, however the cli prompts were not listing the options. Following the instructions here helped me work through the prompts and a world was generated. This version is largely untested though since I do not have the mobile version of the game. PRs are always welcome!

This project is a Dockerfile to containerize TShock and Terraria TerrariaServer.exe to run on linux. Docker will remove the need for someone to worry about how to setup a server in linux with all the right dependencies to run. The installation and usage instructions are written with complete beginners in mind.

Quick start guide

First you need a linux machine with Docker installed. Everything from here on out assumes the docker service is running (you may need to start the service after install).

Create directory to save your world to

Next create a directory for your world file, configuration, and logs

bash
mkdir -p $HOME/terraria/world
Creating a fresh world

For the first run you will need to generate a new world with a size where: 1=Small, 2=Medium, 3=Large

bash
sudo docker run -it -p 7777:7777 --rm -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds ryshe/terraria:latest -world /root/.local/share/Terraria/Worlds/<world_name_here>.wld -autocreate <world_size_number_here>

Note: If you close the the terminal, the server will stop running. You will need to restart with a preexisting world. It may be worth while to close after creation anyway to update the initial config.json settings.

To create a world with a few more initial options, you can do so in an interactive mode.

bash
sudo docker run -it -p 7777:7777 --rm -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds ryshe/terraria:latest
To start with a preexisting world
bash
sudo docker run -d --rm -p 7777:7777 -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds --name="terraria" -e WORLD_FILENAME=<.wld world_filename_here> ryshe/terraria:latest

Note: This command is designed to run in the background, and it is safe to close the terminal window.

Any config.json in the directory will automatically be loaded. The <world_file_name>.wld should be the name of your wld file in your $HOME/terraria/world directory.

Updating your container

Updating is easy!

  1. Grab the latest terraria container

    bash
    docker pull ryshe/terraria:latest
    
  2. First we need to find our running container to stop, so we can later restart with the latest

    bash
    docker container ls | grep ryshe/terraria
    

    The first few numbers and letters, on a line, are the container hash. Remember the first 3 or so letters or numbers

    Example:

    bash
    f25261ac55a4        ryshe/terraria:latest   "/bin/sh bootstrap.s…"   3 minutes ago       Up 3 minutes        0.0.0.0:7777->7777/tcp, 7878/tcp   reverent_solomon
    

    f25 would be the first few letters/numbers of the container hash

    NOTE: If you see multiple lines, find the one that still has an up status.

  3. Stop and remove the container

    bash
    docker container rm -f xxx # xxx is the letters/numbers from the last step
    
  4. Start your container again with your world (see the Quick start)

[Virtual] Machine Setup

Provision a linux machine that can support docker and containerization. For more information visit docker. For a small or medium world with no more than 8 users a linux machine with 1-1.5GB of ram should suffice. If you are running a vm in the cloud, make sure to expose tcp port 7777 and udp port 7777.

Before starting the build process make sure the latest tshock version is specified in the Dockerfile under

Dockerfile
ADD [***] /

Building from source

Assuming git and docker are installed..

  1. Clone this repository

    bash
    git clone [***]
    
  2. Open a terminal window into the directory downloaded by the git

  3. Build the container

    bash
    docker build -t <name_here> .
    

Running a container image

Whether you build your own container, or use my container published to docker hub, we are ready to run our terraria server!

Note: For a full set of docker run options go here

First run

The first run of the server will give you the opportunity to create a world, and it will generate the server's config file. You may wish to add the config file for many reasons, but one of which is to add a password to your server.

bash
docker run -it --rm -p 7777:7777 -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds ryshe/terraria:latest

Let's break down this command:

Command PartDescription
docker runtells linux to run a docker image
-itrun interactively and output the text to terminal
--rmremove docker container when the container stops or fails
-p 7777:7777exposes terraria port <host machine side>:<container side>
-v $HOME/terraria/world:/root/.local/share/Terraria/Worldsmaps a folder on the host machine into the container for saving the .wld file. This does not have to be $HOME/terraria/world. Anything left of the : is host machine directory
ryshe/terrariathe name of the image. This could be your image if you build from source
:latestthe tag, which defaults to latest if not specified. latest is the most recently published container
  • The config file can be found in the directory specified by the -v volume.
  • If the terminal window is shut down, that will exit the process. Make sure to do so after the world is created!
Running with an existing generated world

After a world has been generated, you may want to load directly into it.

bash
docker run -d --rm -p 7777:7777 -v $HOME/terraria/world:/root/.local/share/Terraria/Worlds ryshe/terraria:latest -world /root/.local/share/Terraria/Worlds/<world_filename_here>.wld

Let's break down the command:

Command PartDescription
-drun this in the background. It is okay to close the terminal window, the container will continue to run
-world /root/.local/share/Terraria/Worlds/<world_filename_here>.wldspecifies the world file name you wish to immediately load into
  • for the other parts check out the First run section
  • check out additional server startup flags here. They go on after the ryshe/terraria:latest portion of the line

Plugin support

A volume exists to support plugins. Create a folder, not inside your /world folder, for your plugins

bash
mkdir ServerPlugins

Mount the plugins directory with an additional -v switch on your docker run ... command

bash
-v <path_to_your_ServerPlugins_folder>:/plugins

Logs

A separate directory can be volumed in for storing logs outside of the image

bash
-v <path_to_store_logs>:/tshock/logs

Notes

  • sudo may be required to run docker commands.

  • Please post to the TShock team with questions on how to run a server.

  • Any additional command-line instructions can be added to the end of either method for launching a server. Docker maps the $HOME/terraria/world linux-host folder to the /tshock/world container-folder.

  • Expecting your server to run for a while? Add --log-opt max-size=200k to limit your log file size. Otherwise one day you will wake up to see all your hdd space chewed up for a terraria docker setup!

Contributing

Email me rsheehan at gmail dot com if any of these instructions do not seem to work.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

TODO

  • Fork TShock and create a Dockerfile to build the project
查看更多 terraria 相关镜像 →
beardedio/terraria logo
beardedio/terraria
by beardedio
用于运行Terraria服务器的Docker镜像,提供TShock Server(服务器修改版)和Vanilla Server(原版服务器)两种版本选择。
471M+ pulls
上次更新:6 个月前

轩辕镜像配置手册

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

登录仓库拉取

通过 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访问体验非常流畅,大镜像也能快速完成下载。"

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