A simple and configurable Docker setup for hosting a dedicated vanilla Terraria server.
- โ๏ธ Fully configurable via
.envandserverconfig.txt - ๐พ Automatic start via
screenfor 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.
Note
To download the project on your VPS server, follow the instructions below.
- Install
git:
sudo apt update
sudo apt install git
- Download the repository:
git clone --branch vanilla https://github.com/ArtoriasCode/docker-terraria.git
Note
To create the necessary files for the Terraria server and configure it according to your preferences, follow the instructions below.
- Navigate to the project directory:
cd docker-terraria
- Create a
.envfile:
cp .env.example .env
- Install the package for editing files:
sudo apt install nano
- Open the
.envfile for editing:
nano .env
- Specify the desired version of Terraria (without dots).
- Save the file by pressing
Ctrl + O, then close the file by pressingCtrl + X. - Open the
serverconfig.txtfile for editing:
nano data/serverconfig.txt
- Specify the desired settings such as password, world name, number of players, etc.
- Save the file by pressing
Ctrl + O, then close the file by pressingCtrl + X.
Note
If you want to install your own pre-generated world on the server, follow the instructions below.
- Create a directory with Terraria worlds in the project root directory:
mkdir -p Terraria/Worlds
- 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
- Change the name of the world in
serverconfig.txtin theworldfield.
Note
To start the automatic installation of the Terraria server in Docker, follow the instructions below.
- Grant execution rights to the installation script:
chmod +x scripts/install.sh
- Run the installation script:
./scripts/install.sh
- 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.