Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2341,"date":"2019-11-26T07:58:53","date_gmt":"2019-11-26T07:58:53","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2341"},"modified":"2019-12-06T00:11:17","modified_gmt":"2019-12-06T00:11:17","slug":"terraria-server-with-tshock-on-linux","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/terraria-server-with-tshock-on-linux\/","title":{"rendered":"Terraria Server with TShock on Linux"},"content":{"rendered":"

Terraria<\/strong>\u00a0is a\u00a0MMORPG<\/strong>\u00a0based on mining, building, and fighting. Some people say its a 2D version of Minecraft, but that wouldn’t do justice to Terraria’s offerings – not by a long shot.<\/p>\n

In this guide, I’ll show you step by step how to make a\u00a0Terraria server<\/strong>\u00a0with TShock on Linux. You could even setup multiple Terraria servers.<\/p>\n

Some basic Linux knowledge is recommended. At the very least, you should understand how to use SSH.<\/p>\n

By the end of the tutorial, you will be able to invite friends over to join your epic quests.<\/p>\n

Prerequisites<\/strong><\/h3>\n

This tutorial is based on Ubuntu 14.10, but more recent Ubuntu or Debian flavors will work. For other Linux versions, the package names may differ but most of the steps and configuration will be the same.<\/p>\n

We will start off with a new Ubuntu 14.10 server on Aklwebhost.<\/p>\n

Terraria uses quite a bit of memory, especially for large worlds. For instance, a\u00a0Aklwebhost\u00a0server with 1024MB RAM will only support a small world with a few players.<\/p>\n

Security<\/strong><\/h3>\n

A clean Ubuntu-based image on\u00a0Aklwebhost\u00a0starts with access to basic services. Only NTP and SSH ports are opened. If you want to host other services, then you might want to secure your incoming traffic and move your SSH port to something other than the default port.<\/p>\n

This guide doesn’t cover all the changes needed to secure your server – there are other guides on\u00a0Aklwebhost\u00a0Docs for that. Remember, Terraria uses\u00a0TCP port 7777<\/strong>\u00a0by default.<\/p>\n

Basic Setup<\/strong><\/h3>\n

We’ll create a basic user to run the Terraria server, since we don’t want to run the server as root. After that, we’ll install the necessary packages.<\/p>\n

Creating A User<\/strong><\/h3>\n

Log in to your server as root and create a new user for your Terraria server. You may receive some error messages about missing locales. Ignore those for now.<\/p>\n

adduser terraria\r\n<\/code><\/pre>\n

The system will ask for a new UNIX password. Enter a fairly secure random password and remember it (or jot it down).<\/p>\n

Now, the system will ask for some user details. You can just press\u00a0Enter<\/strong>\u00a0to leave these empty.<\/p>\n

When the system asks you to confirm the information (“Is the information correct?”), press\u00a0Y<\/strong>\u00a0followed by\u00a0Enter<\/strong>.<\/p>\n

Installing Packages<\/strong><\/h3>\n

Terraria is a game based on the Microsoft “.NET” framework. The Linux implementation of “.NET” is called “mono”. We’ll install only the necessary packages to get the game running and some support packages.<\/p>\n

apt-get -y install wget unzip screen \\\r\n    libmono-corlib4.0-cil libmono-sqlite4.0-cil libmono-system-core4.0-cil libmono-system-net4.0-cil \\\r\n    libmono-system-runtime4.0-cil mono-runtime mono-runtime-sgen libmono-corlib4.0-cil \\\r\n    libmono-sqlite4.0-cil libmono-system-core4.0-cil libmono-system-net4.0-cil \\\r\n    libmono-system-runtime4.0-cil  mono-runtime mono-runtime-sgen libmono-data-tds4.0-cil \\\r\n    libmysql6.4-cil libmono-system-runtime-serialization4.0-cil \\\r\n    libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-data-linq4.0-cil \\\r\n    libmono-system-xml-linq4.0-cil libmono-system-xml-serialization4.0-cil libmono-system-xml4.0-cil\r\n<\/code><\/pre>\n

Your system is now ready to run Terraria.<\/p>\n

Installing TShock<\/strong><\/h3>\n

At this point, you need to be logged into your server as user “terraria”.<\/p>\n

su terraria\r\n<\/code><\/pre>\n

Download and unzip a release of TShock. You can check the official TShock website for newer releases. The Terraria server download is included with TShock.<\/p>\n

wget -O tshock.zip 'https:\/\/github.com\/NyxStudios\/TShock\/releases\/download\/v4.2.9\/tshock_4.2.9.zip'\r\nunzip tshock.zip -d ~\/tshock\r\n<\/code><\/pre>\n

Starting TShock For The First Ttime<\/strong><\/h3>\n

The first time you start TShock, you must join your server to make yourself the administrator. Start the server.<\/p>\n

cd ~\/tshock\r\nmono TerrariaServer.exe\r\n<\/code><\/pre>\n

The gameserver will start and show you the server version. After that, it will ask you what world you would like to start. Since this is a new server, there are no previous worlds. We’ll create a new one.<\/p>\n

The larger the world, the more memory you’ll need. Remember, a basic\u00a0Aklwebhost\u00a0server with 1024MB RAM will only support a small world.<\/p>\n

    \n
  • Press\u00a0N<\/strong>\u00a0followed by\u00a0Enter<\/strong>\u00a0for a new world.<\/li>\n
  • Choose the size that you would like.<\/li>\n
  • Type a (short) name for your world, followed by\u00a0Enter<\/strong>.<\/li>\n<\/ul>\n

    The server will now start generating your new world. When it has finished, you’ll be back in the main selection menu.<\/p>\n

      \n
    • Choose your newly generated world by pressing\u00a01<\/strong>, followed by\u00a0Enter<\/strong>.<\/li>\n
    • Enter a port to listen on, or just press\u00a0Enter<\/strong>\u00a0to use the default Terraria port 7777.<\/li>\n<\/ul>\n

      Your world will be loaded and TShock will show you an authorization code.<\/p>\n

      TShock Notice: To become SuperAdmin, join the game and type \/auth 2044111<\/p>\n

      This token will display until disabled by verification. (\/auth-verify)<\/p><\/blockquote>\n

      Write this code down and start Terraria.<\/p>\n

      Tip: Use windowed mode in Terraria so that you can switch between your SSH session and the game.<\/p><\/blockquote>\n

        \n
      • Go to\u00a0Multiplayer -> Join<\/code>.<\/li>\n
      • Select or create a character.<\/li>\n
      • Enter the IP of your\u00a0Aklwebhost\u00a0server.<\/li>\n
      • For the server port, use the default 7777 or the port configured on your server.<\/li>\n<\/ul>\n

        Congratulations, you’ve just entered your new world. Now it’s time to authenticate as the administrator.<\/p>\n

          \n
        • In your game window, press\u00a0Enter<\/strong>.<\/li>\n
        • Type\u00a0\/auth XXXXXXX<\/code>\u00a0replacing\u00a0XXXXXXX<\/code>\u00a0with the authentication code displayed when your server was started.<\/li>\n<\/ul>\n

          The server will confirm your authentication code and display a message.<\/p>\n

          You are now superadmin, please do the following to finish your install:\r\n\/user add <username> <password> superadmin\r\nCreates: <username> with the password <password> as part of the superadmin\r\ngroup.\r\nPlease use \/login <username> <password> to login from now on.\r\nIf you understand, please \/login <username <password> now, and type\r\n\/auth-verify\r\n<\/code><\/pre>\n

          Note: If the text went away too fast, press\u00a0Enter<\/strong>\u00a0to show it again.<\/p><\/blockquote>\n

          The server wants us to create a new admin user so that we can gain admin permissions the next time we join our server.<\/p>\n

            \n
          • Press\u00a0Enter<\/strong>\u00a0in your game window.<\/li>\n
          • Type\u00a0\/user add <username> <password> superadmin<\/code>\u00a0replacing\u00a0<username><\/code>\u00a0and\u00a0<password><\/code>\u00a0with your own username and a new password.<\/li>\n
          • Press\u00a0Enter<\/strong>\u00a0again and log in using\u00a0\/login username password<\/code>.<\/li>\n
          • If this all works correctly, you can confirm everything with\u00a0\/auth-verify<\/code>.<\/li>\n<\/ul>\n

            Now that the configuration is done. We’ll shutdown the server and have it save everything.<\/p>\n

            First, disconnect your Terraria client from the server.<\/p>\n

              \n
            • Press\u00a0Escape<\/strong>.<\/li>\n
            • Go to “Settings”.<\/li>\n
            • Select “Save & Exit”.<\/li>\n<\/ul>\n

              Now, shutdown the server. This is accomplished in your SSH session by typing “off” in the server console, then pressing\u00a0Enter<\/strong>.<\/p>\n

              The initial configuration is now complete.<\/p>\n

              Running Your Server<\/strong><\/h3>\n

              We want the server to keep running, even when we disconnect our SSH session. So we’ll use a\u00a0screen<\/code>\u00a0session to do so.<\/p>\n

              As the “terraria” user, start screen:<\/p>\n

              screen\r\n<\/code><\/pre>\n

              Press\u00a0Enter<\/strong>\u00a0to close the credits screen. Now, start the TShock server again.<\/p>\n

              cd ~\/tshock\r\nmono TerrariaServer.exe\r\n<\/code><\/pre>\n

              Load your world.<\/p>\n

                \n
              • Press\u00a01<\/strong>\u00a0followed by\u00a0Enter<\/strong>\u00a0to select your world.<\/li>\n
              • Enter a port or press\u00a0Enter<\/strong>\u00a0to use the default port of 7777.<\/li>\n<\/ul>\n

                You are now in the server console, for a list of commands, type “help”, then press\u00a0Enter<\/strong>. You can enter Terraria server commands in this console.<\/p>\n

                To close your SSH session and keep the server running, use the following key sequence:<\/p>\n

                  \n
                • Press\u00a0Ctrl + A<\/strong>.<\/li>\n
                • Press\u00a0D<\/strong>.<\/li>\n<\/ul>\n

                  You won’t get any feedback until you press the\u00a0D<\/strong>\u00a0key.<\/p>\n

                  After this, your screen will be cleared and you will see output similar to the following.<\/p>\n

                  [detached from 1298.pts-2.aklwebhost]<\/p><\/blockquote>\n

                  You can now safely close your SSH session and the server will keep running in the background.<\/p>\n

                  When you reconnect to your server, you can type the following to enter the server console again:<\/p>\n

                  screen -r\r\n<\/code><\/pre>\n

                  Closing Notes<\/strong><\/h3>\n

                  There are lots of options and things to change with the TShock server. Please read the documentation for more details. Enjoy!<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[105,242,247],"manual_kb_tag":[225],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2341"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2341"}],"version-history":[{"count":2,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2341\/revisions"}],"predecessor-version":[{"id":2343,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2341\/revisions\/2343"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2341"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2341"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}