A dedicated Terraria server keeps your shared world online even when the original host is not playing. You control the world, password, player limit, and server rules. If you want to use gameplay mods, you need a separate tModLoader server instead of the standard vanilla dedicated server.
You can host Terraria on a Windows PC or Linux server, but the machine and internet connection must remain available. A hosted Terraria server avoids home-router forwarding, public-IP limitations, and operating-system maintenance.

What you will learn
- how to choose between vanilla Terraria and tModLoader
- how to install a Terraria dedicated server on Windows or Linux
- how to configure
serverconfig.txtand create or import a world - how to open port 7777 in the firewall and router
- how to manage mods, commands, backups, and updates
- how to fix common connection and version errors
Create a Terraria server in eight steps
- Choose vanilla for an unmodified game or tModLoader for mods.
- Get the vanilla dedicated server from the Terraria installation folder or the official standalone server package.
- Create
serverconfig.txtwith the world path, port, player limit, and optional password. - Start vanilla with
TerrariaServer.exe -config serverconfig.txton Windows or./TerrariaServer.bin.x86_64 -config serverconfig.txton Linux. - Allow at least port 7777/TCP through the firewall and forward it in your router when hosting from home.
- Join through Multiplayer → Join via IP and enter the address and port.
- For mods, install tModLoader instead and copy
install.txtandenabled.jsonto the server. - Stop the server before backups and regularly protect the world, configuration, and tModLoader data.
1281930 belongs to tModLoader only.Table of contents
- Requirements and hardware
- Vanilla server or tModLoader
- Install the vanilla Terraria server
- Create a Terraria server on Windows
- Create a Terraria server on Linux
- Start Terraria automatically with systemd
- Configure the Terraria server
- Create or load a Terraria world
- Configure the Terraria port and firewall
- Connect to the Terraria server
- Create a tModLoader server for mods
- Terraria server commands and administration
- Back up the Terraria server
- Update the Terraria server
- Troubleshooting
- Frequently asked questions
- Related guides
- Summary
Requirements and hardware
Terraria is relatively lightweight compared with many modern survival games. A small vanilla world can run on a modest system, while large groups and modded servers need more memory and CPU time.
| Use case | Suggested RAM | Notes |
|---|---|---|
| 1–4 players, vanilla | 1 GB | small or medium world |
| 5–8 players, vanilla | 1–2 GB | SSD and a modern CPU core recommended |
| 9–16 players, vanilla | 2–3 GB | good single-core performance helps |
| tModLoader with a few mods | 2–4 GB | actual use depends on the mods |
| large modpack or many players | 4–6 GB or more | monitor memory use under load |
The server configuration accepts up to 255 players, but this is not a realistic performance target for most home systems or small virtual servers. Eight to sixteen players is a practical range for private worlds. Active enemies, projectiles, wiring, farms, and mods all affect performance.
You will also need:
| Requirement | Why it matters |
|---|---|
| Windows or x86-64 Linux | The official server files target conventional desktop and server systems. |
| stable internet connection | The server must remain reachable. |
| at least port 7777/TCP | This is the default game connection port. |
| public IPv4 or working public IPv6 | Incoming players must be able to reach the host. |
| router access for home hosting | Required to forward the port to the server. |
| write access to the world directory | Terraria must be able to create and save the world. |
Self-hosting compared with a hosted server
| Self-hosting | Hosted server |
|---|---|
| full operating-system control | no home PC running around the clock |
| no monthly hosting fee | public network reachability is already available |
| you configure the firewall and router | management through a server panel |
| depends on your local power and internet | independent of your home connection |
| you maintain updates, security, and backups | less system administration |
For a ready-to-use setup without home-network configuration, you can rent a Terraria server from DeinServerHost.
Vanilla server or tModLoader
Vanilla and tModLoader are separate server installations. Select the correct one before downloading files.
| Server type | Best for | Installation source | Required client |
|---|---|---|---|
| Vanilla dedicated server | unmodified Terraria | Terraria game folder or official standalone package | standard Terraria client |
| tModLoader server | Workshop mods and modpacks | SteamCMD app 1281930 or official tModLoader tools | tModLoader with matching mods |
Choose vanilla when the group wants the standard game without server-side mods. Client-side resource packs do not by themselves require tModLoader.
Choose tModLoader for gameplay mods and modpacks. The server and every player need compatible tModLoader builds, mod lists, dependencies, and mod versions.
Install the vanilla Terraria server
On Windows, the normal dedicated server is included with Terraria. Re-Logic also provides an official standalone package for Linux and separate server installations.
Create a Terraria server on Windows
- Open the Steam library.
- Right-click Terraria.
- Select Manage → Browse local files.
- Find
TerrariaServer.exein the Terraria folder. - Create
serverconfig.txtin the same directory. - Open PowerShell in that folder and launch the server with the configuration file.
.\TerrariaServer.exe -config .\serverconfig.txt
The -config parameter selects the configuration file. Use a full path when the file is stored elsewhere:
.\TerrariaServer.exe -config "C:\Terraria-Server\serverconfig.txt"
You can alternatively download the official dedicated-server package from the Terraria website and extract it to a separate folder. This keeps the game client and server installation independent.
start-server.bat file so the command is easy to run again.@echo off
TerrariaServer.exe -config serverconfig.txt
pause
Create a Terraria server on Linux
Download the current official Terraria dedicated-server package and copy its Linux files to a directory such as /opt/terraria. Run the service through a dedicated account rather than root whenever possible.
Example layout:
/opt/terraria/
├── TerrariaServer.bin.x86_64
├── serverconfig.txt
└── worlds/
Assign ownership and make the binary executable:
sudo chown -R terraria:terraria /opt/terraria
sudo -u terraria chmod +x /opt/terraria/TerrariaServer.bin.x86_64
Start the server with the configuration file:
cd /opt/terraria
sudo -u terraria ./TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt
If the file does not launch, check the architecture and permissions first:
file /opt/terraria/TerrariaServer.bin.x86_64
ls -l /opt/terraria/TerrariaServer.bin.x86_64
Start Terraria automatically with systemd
Create /etc/systemd/system/terraria.service:
[Unit]
Description=Terraria Dedicated Server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=terraria
Group=terraria
WorkingDirectory=/opt/terraria
ExecStart=/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt
Restart=on-failure
RestartSec=5
KillSignal=SIGINT
TimeoutStopSec=60
[Install]
WantedBy=multi-user.target
Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable --now terraria.service
Check its state and live log:
sudo systemctl status terraria.service
sudo journalctl -u terraria.service -f
For similar self-hosted survival-game setups, see How to create a Valheim server and How to create a Project Zomboid server.
Configure the Terraria server
serverconfig.txt stores the main server options and is loaded with -config serverconfig.txt. Lines beginning with # are comments and are ignored.
Important serverconfig.txt options
| Setting | Purpose | Example |
|---|---|---|
world= | full path to an existing or new .wld file | world=/opt/terraria/worlds/my-world.wld |
autocreate=1/2/3 | creates a missing world: 1 small, 2 medium, 3 large | autocreate=2 |
worldname= | name used for an automatically created world | worldname=FriendsWorld |
worldpath= | directory used to store world files | worldpath=/opt/terraria/worlds |
port= | listening port | port=7777 |
maxplayers= | maximum player count from 1 to 255 | maxplayers=8 |
password= | join password; leave empty for none | password=ChangeThisPassword |
motd= | message shown to joining players | motd=Welcome to our world! |
difficulty= | world difficulty used during automatic creation | difficulty=1 |
secure=1 | enables additional cheat protection | secure=1 |
language= | language code for server messages | language=en-US |
banlist= | path to the ban list | banlist=banlist.txt |
upnp= | automatic UPnP port forwarding | upnp=0 |
Difficulty values used when creating a world:
| Value | Difficulty |
|---|---|
0 | Classic |
1 | Expert |
2 | Master |
3 | Journey |
difficulty is applied when the world is created. Changing the value does not convert an existing world to another difficulty.Linux serverconfig.txt example
# World file and directory
world=/opt/terraria/worlds/friends-world.wld
worldpath=/opt/terraria/worlds
autocreate=2
worldname=FriendsWorld
difficulty=0
# Network and players
port=7777
maxplayers=8
password=ChangeThisPassword
# Messages and protection
motd=Welcome to our Terraria server!
secure=1
language=en-US
banlist=/opt/terraria/banlist.txt
upnp=0
Use Windows paths when hosting on Windows:
world=C:\Terraria-Server\Worlds\FriendsWorld.wld
worldpath=C:\Terraria-Server\Worlds
serverconfig.txt can see the password.serverconfig.txt take effect only after a server restart. Run save, then close the server cleanly with exit before restarting it.Create or load a Terraria world
The server can generate a new world during its first launch or load an existing .wld file.
Automatically create a new world
Set a target path, world size, and name:
world=/opt/terraria/worlds/new-world.wld
autocreate=2
worldname=NewWorld
difficulty=0
World size values:
| Value | Size |
|---|---|
1 | small |
2 | medium |
3 | large |
At startup, Terraria checks the file set under world=. If no file exists and autocreate is enabled, it generates a new world.
Import an existing world
- Fully stop the game or old server.
- Locate the required
.wldfile. - Copy it to the new server's world directory.
- Set
world=to the file's full path. - Give the server account read and write permission.
- Start the server and confirm the world name in the console.
Common local world locations:
| System | Default path |
|---|---|
| Windows | %USERPROFILE%\Documents\My Games\Terraria\Worlds\ |
| Linux | ~/.local/share/Terraria/Worlds/ |
| dedicated server | the path configured under world= or worldpath= |
A world may also have .wld.bak or other .bak backup files. tModLoader commonly stores mod-specific world data in a matching .twld file. Always transfer the .wld and .twld pair together for a modded world.
Configure the Terraria port and firewall
The default Terraria server port is 7777. Standard direct connections use TCP.
| Purpose | Port | Protocol | Required |
|---|---|---|---|
| Terraria game connection | 7777 | TCP | yes |
| extra rule used by some hosting templates | 7777 | UDP | usually not required for a normal direct connection |
Allow the port in Windows Firewall
Open PowerShell as Administrator:
New-NetFirewallRule -DisplayName "Terraria Server TCP 7777" -Direction Inbound -Protocol TCP -LocalPort 7777 -Action Allow
Optional UDP rule:
New-NetFirewallRule -DisplayName "Terraria Server UDP 7777" -Direction Inbound -Protocol UDP -LocalPort 7777 -Action Allow
Allow the port with UFW on Linux
sudo ufw allow 7777/tcp
sudo ufw status
Optional UDP rule:
sudo ufw allow 7777/udp
Forward the port in a home router
Create a forwarding rule to the local IP address of the Terraria host:
| Router field | Example |
|---|---|
| external port | 7777 |
| internal port | 7777 |
| protocol | TCP |
| destination | local server address, for example 192.168.1.50 |
Reserve the server's local address through DHCP so it does not change later.
If the public address fails only from inside the same network, try the local address. Some routers do not support NAT loopback.
Connect to the Terraria server
- Launch the same Terraria version used by the server.
- Open Multiplayer.
- Select a character.
- Choose Join via IP.
- Enter the server address.
- Confirm port
7777unless it was changed. - Enter the server password when required.
| Player location | Address to use |
|---|---|
| same computer | 127.0.0.1 or localhost |
| same home network | local server address, for example 192.168.1.50 |
| over the internet | public IP address or a domain pointing to it |
Create a tModLoader server for mods
Terraria gameplay mods require tModLoader, which is installed separately from vanilla Terraria. You can install the server through SteamCMD app ID 1281930 or use the official tModLoader management script.
Install tModLoader with SteamCMD
Install SteamCMD using Valve's official instructions. Create an installation directory and download tModLoader with a Steam account:
mkdir -p /opt/tmodloader/server
steamcmd +force_install_dir /opt/tmodloader/server +login YOUR_STEAM_USERNAME +app_update 1281930 validate +quit
Steam may request Steam Guard or two-factor verification during the first sign-in. Make the launch script executable and start the server:
cd /opt/tmodloader/server
chmod +x start-tModLoaderServer.sh
./start-tModLoaderServer.sh -config /opt/tmodloader/serverconfig.txt
On Windows, use the batch file:
start-tModLoaderServer.bat -config C:\tModLoader-Server\serverconfig.txt
Install with manage-tModLoaderServer.sh
The official management script can install tModLoader, Workshop mods, and updates. Place manage-tModLoaderServer.sh in the main server directory and prepare the expected folder structure.
chmod +x manage-tModLoaderServer.sh
./manage-tModLoaderServer.sh install-tml --username YOUR_STEAM_USERNAME
After adding the mod lists, install the mods:
./manage-tModLoaderServer.sh install-mods
Start the server with:
./manage-tModLoaderServer.sh start
When using a custom location, repeat the same --folder argument in later commands.
Install mods on the tModLoader server
The easiest method is to export a mod pack from a tModLoader client:
- Open Workshop → Mod Packs in tModLoader.
- Enable the required mods.
- Select Save Enabled as New Mod Pack.
- Select Open Mod Pack Folder.
- Copy
install.txtandenabled.jsonto the server'sModsdirectory. - Run
./manage-tModLoaderServer.sh install-modsor use the equivalent installation function in your server manager. - Restart the server and check the log for missing dependencies.
| File | Purpose |
|---|---|
install.txt | Steam Workshop IDs to download |
enabled.json | internal mod names enabled at startup |
.tmod | locally stored mod file |
.twld | modded world data paired with the .wld file |
Example layout:
/opt/tmodloader/
├── manage-tModLoaderServer.sh
├── serverconfig.txt
├── Mods/
│ ├── install.txt
│ └── enabled.json
├── Worlds/
│ ├── modded-world.wld
│ └── modded-world.twld
└── server/
└── start-tModLoaderServer.sh
enabled.json, Workshop IDs in install.txt, the tModLoader build, and every missing dependency reported in the server log.Terraria server commands and administration
Enter commands directly in the running server console. No leading slash is required there.
| Command | Function |
|---|---|
help | displays available console commands |
playing | lists connected players |
save | saves the world |
exit | saves and shuts down the server |
exit-nosave | shuts down without saving |
kick PlayerName | removes a player |
ban PlayerName | adds a player to the ban list |
password | displays the current password |
password NewPassword | changes the password for the running session |
say Message | broadcasts a server message |
motd | displays the current message of the day |
motd New message | changes the message of the day |
version | prints the server version |
time | displays the world time |
port | displays the listening port |
maxplayers | displays the player limit |
dawn, noon, dusk, midnight | changes the time of day |
exit-nosave discards progress since the last save. Use it only when you intentionally want to return to an earlier state.Setting secure=1 adds protection against certain cheats, but it does not replace current software, secure file permissions, or proper network administration.
Back up the Terraria server
The world is the most important server data. Stop the server before copying files, or run save followed by exit, so the backup does not capture a file while it is being written.
Files to include
| File or directory | Reason |
|---|---|
*.wld | main Terraria world |
*.wld.bak and other .bak files | automatic backup copies |
*.twld for tModLoader | mod-specific world data |
serverconfig.txt | server settings |
banlist.txt | banned players |
Mods/install.txt | Workshop IDs in the mod pack |
Mods/enabled.json | enabled mods |
local .tmod files and mod configuration | content that might not be recoverable from Workshop alone |
Linux backup example
sudo systemctl stop terraria.service
sudo tar -czf /srv/backups/terraria-$(date +%F-%H%M).tar.gz \
/opt/terraria/worlds \
/opt/terraria/serverconfig.txt \
/opt/terraria/banlist.txt
sudo systemctl start terraria.service
Adjust paths and the service name to match your installation.
Windows backup example
$Date = Get-Date -Format "yyyy-MM-dd-HHmm"
New-Item -ItemType Directory -Force "D:\Terraria-Backups\$Date" | Out-Null
Copy-Item "C:\Terraria-Server\Worlds" "D:\Terraria-Backups\$Date\Worlds" -Recurse
Copy-Item "C:\Terraria-Server\serverconfig.txt" "D:\Terraria-Backups\$Date\serverconfig.txt"
Update the Terraria server
Update vanilla Terraria
- Create a complete backup.
- Shut down the server cleanly.
- Update Terraria through Steam or download the current official dedicated-server package.
- Replace program files without overwriting the world,
serverconfig.txt, or ban list. - Start the server and confirm the version printed in the console.
- Join with a client running the same Terraria version.
Update tModLoader and mods
With the management script, update tModLoader and the mods listed in install.txt:
./manage-tModLoaderServer.sh install
Update mods only:
./manage-tModLoaderServer.sh install-mods
Update tModLoader only:
./manage-tModLoaderServer.sh install-tml
For a direct SteamCMD installation, run the app update again:
steamcmd +force_install_dir /opt/tmodloader/server +login YOUR_STEAM_USERNAME +app_update 1281930 validate +quit
Before the first post-update launch, verify that all mods support the installed tModLoader build. For a major migration, archive the entire old server directory as well as the normal world backup.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Server cannot be reached from the internet | firewall or forwarding rule is missing | allow 7777/TCP in the host firewall and router; verify the destination IP |
| Port test says closed | server is stopped or listening on another port | start the server, check port in the console, and test again |
| Connection works only inside the home network | no public IPv4, CGNAT, or DS-Lite | request public IPv4, use public IPv6, or host externally |
| Public IP fails only from the same LAN | router lacks NAT loopback | use the local server address from inside the LAN |
| Wrong world loads | world= points to another file or relative path | use a full path and read the startup log |
| World cannot be saved | server account lacks write access | correct ownership and permissions on the world directory |
| Configuration changes do not apply | server was not restarted or another file is loaded | stop with save and exit; check the -config path |
| Password is rejected | old configuration is still active or the entry is wrong | restart the server and check the exact password line |
| Vanilla client cannot join | server is running tModLoader | launch tModLoader or run a vanilla server |
| tModLoader reports a mod mismatch | missing or different mods and versions | compare enabled.json, install.txt, dependencies, and tModLoader build |
| Modded world has missing content | .twld is missing or required mods are disabled | restore .wld and .twld together and enable the mods |
| Server fails after an update | incompatible mod or incomplete files | restore the backup, read the log, test mods individually, validate files |
| Players receive “Lost connection” | version mismatch, unstable connection, or mod failure | compare client/server versions and inspect the log and network |
| Linux server exits immediately | wrong architecture, permissions, or paths | check file, ls -l, working directory, and the systemd journal |
Frequently asked questions
How much RAM does a Terraria server need?
A small vanilla Terraria server usually needs about 1 to 2 GB of RAM. Plan for 2 to 4 GB or more for larger groups, big worlds, and tModLoader, then monitor actual use.
Which port does a Terraria server use?
A Terraria server uses port 7777/TCP by default. Allow the port in the firewall and forward it to the local server address when hosting from home.
What is the difference between the normal server and tModLoader?
The normal dedicated server runs unmodified Terraria, while tModLoader provides server-side mods and modpacks. tModLoader servers and players need compatible builds and matching mods.
How do I install mods on a Terraria server?
Install mods on a tModLoader server through Steam Workshop and the mod-pack files install.txt and enabled.json. Copy them into the server's Mods directory, install the Workshop items, and restart the server.
How many players can a Terraria server support?
The server configuration supports a maximum of 255 players. Eight to sixteen players is much more practical for a typical private server because world activity, networking, and mods affect performance.
Where are Terraria world files stored?
Terraria worlds are .wld files stored in the configured world or worldpath location. Local defaults are commonly %USERPROFILE%\Documents\My Games\Terraria\Worlds\ on Windows and ~/.local/share/Terraria/Worlds/ on Linux.
How do I create a new world on the server?
Set autocreate=1, 2, or 3, add worldname=, and define the target file under world=. Terraria creates the world during startup when no file exists at that path.
Related guides
More dedicated-server setup guides:
Planned Terraria topics include a complete serverconfig.txt reference, tModLoader administration, mod installation, world transfers, backups, console commands, and performance tuning.
Summary
For a normal Terraria server, run TerrariaServer.exe on Windows or TerrariaServer.bin.x86_64 on Linux. Store settings in serverconfig.txt, use port 7777/TCP, and select a world with world= or generate one through autocreate. Mods require a separate tModLoader installation with compatible versions on the server and every client.
Back up the world and configuration before every update, and stop the server before manually copying world files. To avoid router setup, public-IP restrictions, and operating-system maintenance, you can use a hosted Terraria server.