Skip to Content

Installing TDSM Terraria Server Mod on Debian 8

Installing TDSM Terraria Server Mod on Debian 8

TDSM is one of several open-source server mods available for the online action-adventure game Terraria. This modification is developed to allow the Terraria server software to be run on Linux like operating systems, and opens up many other potential benefits for players using the server.

  • External plugin support.
  • Administrative permissions system.
  • MySQL & SQLite databases.
  • New & custom in-game commands.
  • Remote console administration.

It’s also updated relatively quickly by the maintainers after a new Terraria client version is released.

Requirements

  • A Terraria game client for connection to the server after installation.
  • For a small-sized world, a VPS that has at least 1GB RAM.
  • For a medium-sized world, a VPS that has at least 1GB RAM.
  • For a large-sized world, a VPS that has at least 2GB RAM.

1 — Update System Packages

Ensure the packages are up to date on the system with the command:

[alert-announce]

  1. $ sudo apt-get update && sudo apt-get upgrade

[/alert-announce]

Confirm the action by entering y for any prompts in this step.


2 — Install Screen

The screen will be used to keep the TDSM server running in a persistent shell session, and allows us to disconnect or re-attach to the session when needed.

Install Screen with the command:

[alert-announce]

  1. $ sudo apt-get install screen

[/alert-announce]

3 — Install Mono

Mono is the open-source implementation of Microsoft’s .NET Framework, and we need it to successfully run and start the TDSM server later on.

Install Mono and all its packages with the command:

[alert-announce]

  1. $ sudo apt-get install mono-complete

[/alert-announce]

4 — Install Unzip

The server software comes packaged in a .zip file. So install the unzip package which we’ll use in the next step, to extract the files.

[alert-announce]

  1. $ sudo apt-get install unzip

[/alert-announce]

5 — Add Swap Space

The server mod requires adequate swap space to be allocated by the system. Otherwise, this can result in crashing and instability with TDSM whilst it is running.

Create the base swap file:

[alert-announce]

  1. $ sudo fallocate -l <^>4G<^> /swapfile

[/alert-announce]

Give it the correct permissions it needs:

[alert-announce]

  1. $ sudo chmod 600 /swapfile

[/alert-announce]

Have the system build the file:

[alert-announce]

  1. $ sudo mkswap /swapfile

[/alert-announce]

Then enable it with the swapon command:

[alert-announce]

  1. $ sudo swapon /swapfile

[/alert-announce]

To automate the mounting of the swap file on boot we need to include its details into the /etc/fstab file.

[alert-announce]

  1. $ sudo nano /etc/fstab

[/alert-announce]

Insert this top-line show in the next code snippet into the file.

[alert-announce]

  1. /swapfile none swap s w 0 0

[/alert-announce]

6 — Download the TDSM Server Software

The TDSM server software that we’ll download in this step will be stored and run from your user’s home directory.

Make sure this is your current working directory by entering:

[alert-announce]

  1. $ cd ~

[/alert-announce]

As of writing this tutorial the current TDSM server build release is number: 005

For newer versions than the current 005 release, and to download the most up to date version.
You’ll need to change the URL passed to wget in the next code snippet.

[alert-announce]

  1. $ wget https://github.com/DeathCradle/Terraria-s-Dedicated-Server-Mod/releases/download/Build-5/tdsm-b5.zip

[/alert-announce]

The TDSM server releases and their file URL’s can be found on the project’s GitHub page: Here.

7 — Run the Terraria Server Binary

Next, unzip the downloaded archive file and extract the contents into a new folder named tdsm-terraria-server using the -d option:

Note: The downloaded .zip file name will differ for future release downloads.

[alert-announce]

  1. $ unzip tdsm-b5.zip -d tdsm-terraria-server

[/alert-announce]

Change into the unpacked tdsm-terraria-server directory with:

[alert-announce]

  1. $ cd tdsm-terraria-server

[/alert-announce]

Now to run the server software in it’s most basic form without any arguments or parameters, enter the following command:

[alert-announce]

  1. screen mono tdsm.exe

[/alert-announce]

Note the inclusion of Screen in the last command. This runs the Mono program and server in a separate shell session to our original one.


8 — Create a New World

The below output (or similar) is seen upon successfully running the server binary in “Step 7 — Run the Terraria Server Binary“.

Type n and press ENTER to create a new world.

[alert-announce]

  1. 10/2/2015 2:05:20 PM Run> TDSM Rebind API build 5lr running on Mono
  2. 10/2/2015 2:05:20 PM Run> Logging started to file “/home/<username>/src/tdsm-terraria-server/Data/server_20151002_1405.log”.
  3. 10/2/2015 2:05:20 PM Run> Loading plugin from TDSM.Core.dll.
  4. 10/2/2015 2:05:20 PM Run> TDSM Rebind core build 5lr
  5. 10/2/2015 2:05:20 PM Run> TDSM Rebind core enabled
  6. 10/2/2015 2:05:21 PM Run> Server state changed to: Initialising
  7. 10/2/2015 2:05:23 PM Run> Server state changed to: Starting
  8. Terraria Server v1.3.0.8

     

  9. n New World
  10. d <number> Delete World

     

  11. Choose World:

[/alert-announce]

Enter 1 , 2 , or 3 depending upon your preference and suitability of world size.

The requirements section at the start of this article indicates what world size is suitable for your VPS.

Here it is again:

  • For a small sized world, a VPS that has at least 1GB RAM.
  • For a medium sized world, a VPS that has at least 1GB RAM.
  • For a large sized world, a VPS that has at least 2GB RAM.

Warning: Be aware that the larger the world the more memory and CPU your server will need to consume whilst the server is up and running, so be sure to select a suitable world size.

[alert-announce]

  1. Terraria Server v1.3.0.8

     

  2.      1 Small
  3.      2 Medium
  4.      3 Large

     

  5. Choose size

[/alert-announce]

Enter 1 , 2 , or 3 again once more depending upon your desired level of in-game difficulty.

[alert-announce]

  1. Terraria Server v1.3.0.8

     

  2.       1 Normal
  3.       2 Expert

     

  4. Choose difficulty:

[/alert-announce]

Now give the new world a suitable name.

For example purposes, we’re calling ours test-tdsm-server in this guide.

[alert-announce]

  1. Terraria Server v1.3.0.8

     

  2. Enter world name:

[/alert-announce]

Wait for the new world to be generated as it outputs its progress and percentage completion.

9 — Set World Details

Once the world is created and has finished generating, choose your previously created world by entering 1 into the prompt:

[alert-announce]

  1. 1 test-tdsm-server norm, crim, exp Last used: 10/02/2015 10:27 AM

     

  2. n New World
  3. d <number> Delete World

     

  4. Choose World:

[/alert-announce]

Provide the world with a max number of players that can join the server at any one time. If you are unsure on a value, the default of 8 is a sensible choice.

Warning: Once again be aware that the more players the world has connected the more memory and CPU your server will need to consume whilst running.

[alert-announce]

  1. Terraria Server v1.3.0.8
  2. Max players (press enter for 8):

[/alert-announce]

Enter a suitable port the server can transmit on, go for the default choice of 7777 if you don’t have a specific port you want to use:

[alert-announce]

  1. Terraria Server v1.3.0.8
  2. Server port (press enter for 7777):

[/alert-announce]

The final two questions are up to you (forwarding and password). Forwarding with iptables is covered in this next section, however.

Wait for the server to load as it outputs its progress.


10 — iptables Firewall

Now the server is up running you’ll need to de-attach from the currently active screen session with:

CTRL + a then c

If using iptables (or you intend to use it) as a firewall solution on the VPS, then open up the port number you chose in “ 9 — Set World Details”

To do this use:

[alert-announce]

  1. $ sudo iptables -A INPUT -p tcp –dport 7777 -j ACCEPT -m comment –comment “allow connections on port 7777 Terraria server”

[/alert-announce]

Replacing 7777 for your own chosen port number.

For any other firewall program you may use in its place perform the equivalent port forwarding/opening actions.

To now connect back to the previous screen session press:

CTRL + a then n


Conclusion

The server itself is now ready and should be open for connections via the Terraria client.

To learn how to administer, run, and configure the server properly alongside what configuration files it uses, see the Github wiki: Click here.