Quickly deploy a dedicated Terraria server via Docker
- Your host is ready to run docker containers
- You have a world file already
If you don't have a world file already, checkout the beardedio/terraria GitHub page for instructions on creating a world.
Included in this repo are two files:
- serverconfig.txt
- banlist.txt
Copy these files as well as your world file to a destination path you'd like to store your world.
My path: /mnt/media/games/terraria/rakara
Things you may want to modify in serverconfig.txt before running the server:
- motd (message of the day)
- password
Take a look at the other options in the file as well.
If you want to use a hostname to connect to your server instead of IP address, and if you use Cloudflare as your nameserver, do this:
mv ddclient-sample.conf ddclient.conf
Then edit the ddclient.conf
file for your needs
Set the location of your world file:
export HOST_WORLD_PATH=/mnt/media/games/terraria/rakara
export HOST_WORLD_FILENAME=Rakara.wld
docker run -dit \
--name=terraria-rakara \
-v $HOST_WORLD_PATH:/config \
-e world=$HOST_WORLD_FILENAME \
-p 7777:7777 \
beardedio/terraria:vanilla-latest
Create the env file
cp .env-sample .env
Modify .env
:
vim .env
If you dont want to use ddclient, just delete that container from the docker-compose.yml
file.
Start it:
docker-compose up -d
Helpful resources:
MIT License