Simple vanilla terraria server
docker and docker-compose installed
Go into the same directoryFirst create a new world by running this command and following prompts.
sudo docker run --rm -it -v $PWD/config:/config --name=terraria beardedio/terraria
After answering a few prompts it will return to the world screen which shows your newly created world as option 1.
Ctrl+C to exit when you finish with all the prompts.
The newely created world file can be found in the config
folder in the same directory.
To set a password for the server or change any other settings go to config/serverconfig.txt
and uncomment any lines to change. Restart the server for the change to take effect.
Start the server running in the background.
docker-compose up -d
Open up terraria and go to Multiplayer. Select "Join via IP" then type the public IP of your server and port 7777.
After the server has started, you can check logs with docker logs terraria
.
-
Error: Garbage collector could not allocate 16384 bytes of memory for major heap section. This happens when the server does not have enough memory to create or load the given world size. To get around it, choose a smaller world size or allocate more RAM to the server.
-
NullReferenceException
Exception: System.NullReferenceException: Object reference not set to an instance of an object
Make sure tty
and stdin_open
fields are present in the docker-compose.yaml