Skip to content

ArtoriasCode/docker-terraria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›  Terraria dedicated server in Docker

A simple and configurable Docker setup for hosting a dedicated vanilla Terraria server.

  • โš™๏ธ Fully configurable via .env and serverconfig.txt
  • ๐Ÿ’พ Automatic start via screen for auto-saves
  • ๐Ÿ—บ๏ธ The ability to generate worlds and upload your own
  • ๐Ÿš€ Simple and fast deployment using Docker Compose
  • ๐Ÿ” Automatic startup after VPS startup / restart

Important

For a server with mods, use the tmodloader branch.

๐Ÿ“ฅ Project download

Note

To download the project on your VPS server, follow the instructions below.

  1. Install git:
sudo apt update
sudo apt install git
  1. Download the repository:
git clone --branch vanilla https://github.com/ArtoriasCode/docker-terraria.git

โš™๏ธ Server configuration

Note

To create the necessary files for the Terraria server and configure it according to your preferences, follow the instructions below.

  1. Navigate to the project directory:
cd docker-terraria
  1. Create a .env file:
cp .env.example .env
  1. Install the package for editing files:
sudo apt install nano
  1. Open the .env file for editing:
nano .env
  1. Specify the desired version of Terraria (without dots).
  2. Save the file by pressing Ctrl + O, then close the file by pressing Ctrl + X.
  3. Open the serverconfig.txt file for editing:
nano data/serverconfig.txt
  1. Specify the desired settings such as password, world name, number of players, etc.
  2. Save the file by pressing Ctrl + O, then close the file by pressing Ctrl + X.

๐ŸŒ Custom world

Note

If you want to install your own pre-generated world on the server, follow the instructions below.

  1. Create a directory with Terraria worlds in the project root directory:
mkdir -p Terraria/Worlds
  1. Upload your world files (.wld, .bak, etc.) to it:
scp path_to_file server_user@server_id:/path_to_project/Terraria/Worlds

Tip

Example: scp /home/artorias/myworld.wld root@127.0.0.1:/root/docker-terraria/Terraria/Worlds

  1. Change the name of the world in serverconfig.txt in the world field.

๐Ÿ”จ Installation

Note

To start the automatic installation of the Terraria server in Docker, follow the instructions below.

  1. Grant execution rights to the installation script:
chmod +x scripts/install.sh
  1. Run the installation script:
./scripts/install.sh
  1. Wait until the installation is complete.

To access the server in the game, enter the IP address of your VPS server, the port specified in .env, and the password specified in serverconfig.txt, if specified.

About

๐Ÿ› ๏ธ A simple Terraria server in Docker with persistent worlds, customisable configuration, automatic mod installation and support for any game version.

Topics

Resources

License

Stars

Watchers

Forks

Contributors