Back to Blog

How to Make a Terraria Server, Step by Step

How to make a Terraria server: dedicated server setup on Linux, serverconfig.txt settings, port 7777, moving your world, TShock and tModLoader.

Nodesty Team7 min readGame servers
The word Terraria with serverconfig, TShock and 7777 on a dark Nodesty background

Making a Terraria server takes just a few steps: you download the free dedicated server files from terraria.org, write the server settings to a serverconfig.txt file, start the server and open port 7777. On your own server, the world stays online even when nobody is playing; your friends can join whenever they want and pick up their boss fights and builds where they left off.

This guide covers setting up a Terraria server on Linux from scratch, the basic settings, moving your world, console commands and the TShock and tModLoader options.

Requirements

  • Operating system: The Terraria dedicated server runs on Windows, Linux and macOS. We use Ubuntu and Debian in this guide.
  • RAM: 1–2 GB is enough for a vanilla server. If you'll use large mod packs with tModLoader, set aside 4–8 GB.
  • CPU: The server calculates the enemies, liquids and mechanisms in the world largely on a single core. In crowded boss fights, single-core speed determines how smooth the game feels.
  • Game version: The server and the players must run the same game version. The PC versions (Steam and GOG) can connect to the server; the mobile and console versions can't.

All you need to know is how to connect to a server over SSH; we give the rest of the commands step by step.

Downloading the server files

For security, run the server as a separate user instead of root:

sudo apt update
sudo apt install unzip wget tmux
sudo useradd -m -s /bin/bash terraria
sudo su - terraria

The PC Dedicated Server link at the bottom of the terraria.org site is a .zip archive containing the server files for the current version of the game. Copy the link address, then download and extract it on the server:

wget -O server.zip "https://terraria.org/api/download/pc-dedicated-server/terraria-server-XXXX.zip"
unzip server.zip -d ~/server

Replace XXXX with the current version number from the site. Inside the archive there is a folder named after the version number, with Windows, Linux and Mac folders under it. Make the Linux files executable:

cd ~/server/*/Linux
chmod +x TerrariaServer.bin.x86_64

Settings with serverconfig.txt

To start the server without it asking questions every time, write the settings to a configuration file. Create or edit the serverconfig.txt file in the Linux folder:

world=/home/terraria/worlds/MyWorld.wld
autocreate=2
worldname=MyWorld
difficulty=1
maxplayers=8
port=7777
password=secret123
motd=Welcome to our server!
worldpath=/home/terraria/worlds/
secure=1
language=en-US
  • world: The full path of the world file to load.
  • autocreate: Creates a new world if the world file doesn't exist. 1 means a small, 2 a medium and 3 a large world.
  • worldname: The name of the new world to create.
  • difficulty: The difficulty of the new world. 0 Classic, 1 Expert, 2 Master, 3 Journey.
  • maxplayers: The maximum number of players (default 8, up to 255).
  • password: The server password. If you leave it empty, anyone can connect.
  • secure: 1 turns on extra cheat protection.

Create the worlds folder and start the server. Use a tmux session so the server keeps running when you close the SSH connection:

mkdir -p ~/worlds
tmux new -s terraria ./TerrariaServer.bin.x86_64 -config serverconfig.txt

On the first start the world is generated, which takes a minute or two depending on the world size. When you see "Server started" in the console, the server is ready. Press Ctrl + B and then D to detach from the session, and use tmux attach -t terraria to go back.

Port and firewall

The Terraria server uses TCP port 7777 by default. If you use ufw on Ubuntu:

sudo ufw allow 7777/tcp

To run a second server on the same machine, give it a different port such as port=7778 and open that one too. We explained how ports work in our What is a port? post.

Connecting to the server

In the game, go to Multiplayer → Join via IP, choose your character and enter the server's IP address and port 7777. If you set a password, enter it too and you'll connect to the world.

Moving your existing world to the server

You can move the world you started with your friends on your own computer to the server:

  1. Close the world in the game. On Windows, world files are in the Documents\My Games\Terraria\Worlds folder.
  2. Stop the server with the exit command.
  3. Copy the world's .wld file to the /home/terraria/worlds/ folder on the server with WinSCP or scp.
  4. Change the world line in serverconfig.txt to point to this file and start the server.

Console commands

You can use these commands in the server console (in the tmux session):

CommandWhat it does
helpLists all commands
playingShows the players in the game
saveSaves the world
exitSaves the world and shuts down the server
kick nameKicks a player from the server
ban nameBans a player
say messageSends a message to players
passwordShows or changes the server password
dawn, noonSets the game time to dawn or noon

Always use exit when shutting down the server; closing the tmux session or killing the process can lose the progress made since the last save.

Management and plugins with TShock

The vanilla server's management tools are limited. TShock is the most widely used server mod, installed on top of the Terraria server, and it adds:

  • An account system, groups and detailed permissions
  • Admin commands used from inside the game, such as /kick, /ban, /tp and /give
  • Protection for specific areas (regions), plus cheat and griefing protection
  • Plugin support

TShock bundles Terraria's server files. Download the package for your server's operating system from the releases page on GitHub, extract it to a separate folder and install the .NET runtime TShock requires. On the first start a setup code appears in the console; join the game and type /setup code, then give yourself owner rights with /user add name password owner and log in with /login. The TShock version you use must be compatible with the players' game version.

Modded server: tModLoader

If you want to play large content mods such as Calamity or Thorium, you use tModLoader. tModLoader is a separate, free app on Steam and comes with its own dedicated server files; you run it instead of the vanilla server. Players also need to use the same mods with tModLoader; the server offers to download missing mods to players who connect. Large mod packs noticeably increase RAM requirements.

Backups and updates

A Terraria world is a single .wld file and easy to back up. When saving, the server keeps the previous save as .wld.bak; even so, take a separate copy of the world before a major update or boss fight:

cp ~/worlds/MyWorld.wld ~/worlds/MyWorld-$(date +%F).wld

We covered taking regular backups that are independent of the server in our Server backups guide. When the game updates, just download the new server version from terraria.org and copy your serverconfig.txt file to the new folder; the worlds aren't affected because they're in a separate folder.

Nodesty for your Terraria server

Because a Terraria server runs on few resources, it can comfortably be hosted even on a small virtual server; you can also run a Discord bot or a second game server on the same machine. Nodesty AMD Ryzen 9 9950X VPS plans deliver smooth gameplay even in crowded boss fights with their high single-core speed, and run in Frankfurt and New York with NVMe storage, L3–L7 nShield DDoS protection and free daily backups kept for 7 days. For other games, take a look at our Minecraft, Valheim and Rust guides, and for a ready-made server, check out our game server plans.

Terraria is a trademark of Re-Logic. Nodesty is not affiliated with or endorsed by Re-Logic.

Frequently Asked Questions

Does it cost anything to make a Terraria server?

No. The Terraria dedicated server software is free and downloads from terraria.org; no game license is needed on the server side. You only pay for the machine that keeps the server online 24/7. Players need to own the game.

How many players can join a Terraria server?

The default limit is 8 players, and it can be raised to 255 with the maxplayers setting in serverconfig.txt. The realistic limit depends on the server's power and the activity in the world; on busy servers, adding management and protection features with TShock makes your life easier.

How much RAM does a Terraria server need?

A vanilla server usually stays under 1 GB on small and medium worlds; for a large world and a big group of players, 2 GB is a comfortable start. If you use many large mods with tModLoader, set aside 4–8 GB.

Can mobile and console players join a PC server?

No. In Terraria, the PC versions (Steam and GOG) can play together, but the mobile and console versions can't connect to a dedicated server on PC. The server and the players also need to use the same game version.

Can I move my own world to the server?

Yes. Just copy your world's .wld file from your computer to the server and point the world line in serverconfig.txt to that file. On Windows, worlds are in the Documents\My Games\Terraria\Worlds folder.

I get a Lost connection error when connecting to the server. Why?

The most common causes are the server and game versions not matching, TCP port 7777 being closed and a wrong password. If the game was updated, download the new server version from terraria.org; if you use TShock or tModLoader, switch to their latest versions too.

Nodesty

About the author

Nodesty Team · Infrastructure & Support

The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.

Related articles

Launch your server now.

Build, scale, and conquer without limits on Nodesty's premium infrastructure.

                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                             ············································                                                   
                                                ··································································································..........···························                                     
                                       ················..........................................................................................................................··············                             
                                  ·············.................::::::::::::::::::::::::::::::::::::::::::::::....................:::::::::::::::::::::::::::::::::::::::................···········                        
                             ············................:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::............·········                     
                         ············.................:::::::::::::::::::::::::::::::::::::::::::::::::::------------::::::::::::::::::::::::::::::----------------:::::::::::::::::::::..........········                  
                    ············......................::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------:::::::::::::.........········                
                ··········.............................................::::::::::::::::::-------------==========================================-----------------------------------:::::::::::........·······               
             ········..................:.....................................::::::::::--------=======+++++++++++++++++++++++++++++++++++++=========================------------------::::::::::.......·······              
           ······.........::::::::::::::::::::................................:::::::-----=====++++xxxxxx**************************xxxxxxxxx++++++++++++++===================------------::::::::.......·······             
          ·····.......:::::::::::::::::::::::::::.............................:::::----===+++xxx****%%%%&&&&&&#############&&&&&&&%%%%%*******xxxxxxxx++++++++++++++==============----------:::::::......······             
         ····......::::::::-------------:::::::::::..........................::::---===+++xx***%%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@####&&&&&%%%%*******xxxxxxxxx+++++++++++++===========--------::::::......·····             
        ····.....:::::::--------------------:::::::::.......................::::---===++xxx**%%&&&###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&%%%%%********xxxxxxxxxxx++++++++++++========------::::::.....······            
        ····.....:::::--------------------------::::::::....................::::---===++xx***%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&&%%%%%**********xxxxxxxxxxxxx+++++++++=======------:::::.....·····            
        ····....::::::-------=============---------:::::::::................:::::---===+++xx***%%%&&&#####@@@@@@@@@@@@@@@@@@@@@@@@@#####&&&&&%%%%%%*************xxxxxxxxxxxxxx+++++++++======-----:::::....·····            
         ····....:::::-------================---------:::::::::...............:::::----===++++xxx***%%%%&&&&&&#################&&&&&&%%%%%%%*******************xxxxxxxxxxxxxxxxx++++++++======----:::::....·····            
         ·····....:::::--------=================---------::::::::::..............:::::::-----====+++++xxxxxx**************************xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++++++++=====-----::::....·····            
          ·····.....:::::--------=================----------:::::::::::.................:::::::::-------=============++++++++++++++++++++++++++++++++++++xxxxxxxxxxxxxxxxxxxxxxx++++++++======-----::::....·····            
            ·····.....:::::::----------===========-------------::::::::::::.........................::::::::::::::::::------------------=============+++++++++++++++++++++++++++++++++=======-----::::.....·····            
              ······......:::::::---------------------------------:::::::::::::........................................:::::::::::::::-----------============+++++++++++++++++++++========------:::::.....·····             
                 ······........:::::::::---------------------------:::::::::::::::::...........................................:::::::::::::------------=============================--------::::::.....······              
                    ·········.........:::::::::::::::-------------::::::::::::::::::::::::.......................................::::::::::::::::--------------------------------------::::::::......·······                
                          ··········............::::::::::::::::::::::::::::::::::::::::::::::::::................................::::::::::::::::::::::::::-------------:::::::::::::::.........········                   
                                  ············..................:::::::::::::::::::::::::::::::::::::::::::.........................:::::::::::::::::::::::::::::::::::::................···········                        
                                             ················.............................................................................................................·················                                 
                                                           ······················................................................................···························                                                
                                                                               ·········································································