Recently I decided to install Terraria server on Ubuntu Linux, but didn't find any completed instructions, so I decided to make my own, to help pure Terraria fans like me. This arcticle is relevant on 15.02.2019.
- So first of all, you need a dedicated server. I used vps server from Heztner guys, but you can use any kind of tech you want (like raspberry pi or old pc with Ubuntu Server installed. Just make sure its minimal configuration fits Terraria Server).
- After you first powered up your device and created password, we'll install SSH to make our setting up process a little bit comfy. You will be able to access server with any other device, if you have ssh installed in cmd or terminal.
Has SSH preinstalled in cmd. So all you need to do is
ssh-keygen(it will ask you to point the folder to extract keys, you can do it or just press enter)
[email protected])(In username type
- Enter root password and you're in ')
You may need to enable SSH in terminal. Use this instruction. Process is the same as in cmd on Windows 10.
You can use SSH clients like Termius, you just need to create new Host with enabled SSH and put your server ip. Then choose user and enter password, and you're in.
Finally we're done with SSH and begining to setup our working environment. To fully operate with our system, we need to install several programs, as
mono-complete (to emulate windows shell environment, so TShock can work properly)
screen (to detach our terraria server screen)
And finally our Terraria server
First we create different user, so we store Terraria files separately of root.
Then add it to sudo group, so you can launch several admin commands
adduser terraria sudo
Then install programs
sudo apt-get install mono-complete screen unzip
Enter as terraria user
Go to your home folder
Download latest TShock file, for me it's 4.3.25. If there is newer version, just go to their github page and copy zip file download link and paste it instead of mine.
sudo wget https://github.com/Pryaxis/TShock/releases/download/v4.3.25/tshock_4.3.25.zip
Execute server one time to create the map
mono-sgen TerrariaServer.exe(type it every time you want to launch the server)
And now, when the map created and launched, you simply press
ctrl+ato start screen, and then press
d. Now your screen is detached and you can use your console regardless of server. Also this wont let your Terraria process shut down because of inactivity.
And this part will be for people who want to transfer their local map to server. I did it because first time I played Terraria with friends through Steam, and then I created server so map can run 24/7.
All you need to do is create ssh connection from device you store your local map. If you did it previously, then go to your Steam folder, find Terraria worlds, right click, properties and copy the path. Then go to cmd and type
scp "yourworldpath" terraria@*yourserverip*:~
It will copy your local world to home section, then go back to your ssh with terraria user and type
mv "yourworldname" .local/share/Terraria/Worlds/
That thing will move your world file to hidden .local folder, where all world files store. Aaaand that's all. Just go to number 8 and do it again. Hope this guide will help you:) If you find any mistakes or face with problems, just comment this section, so I can fix it.