How to Fix the “Lost Connection” Error in Terraria
The “Lost Connection” error in Terraria occurs when the link between the host and player is interrupted. The game continuously exchanges small data packets. If this flow is delayed, blocked, or unstable, the connection breaks and the session closes.
There are several technical reasons why this happens so often:
Cause | Description |
---|---|
Steam relay lag | Using Host & Play routes traffic through Steam relay servers instead of a direct link. This adds delay and increases the risk of packet loss, causing disconnects. |
Network blocks | NAT rules, closed ports, or strict firewall settings interfere with traffic. Terraria uses port 7777, and blocked or delayed packets make the handshake fail. |
Version or mod mismatch | Different game versions or conflicting mods create inconsistent data between host and client, forcing the game to end the session. |
Low tolerance for unstable packets | Steam hosting is sensitive to delayed or corrupted packets. Even short bursts of instability can cause a disconnect, especially when using mods. |
Now that you know what causes this issue, here are the steps you can take to fix it.
Before You Start
Before applying any fixes, it’s important to understand the nature of this error and what to expect during troubleshooting.
- If you are using mods, even a small version difference can cause an instant disconnection. Some of the solutions below involve verifying, deleting, or replacing mod files. You may lose local mod data if you don’t back it up. So make a backup of your worlds, characters, and mod folders.
- Check whether the game is modded or vanilla. The steps may differ depending on this.
- Identify whether you’re the one hosting or joining the world. The fixes can differ for both sides. To make this clearer, each solution is labeled as (Host) or (Client) so you know which ones apply to you. If there’s no label, it means the solution applies to both users.
Once these points are clear and your game data is safe, you can begin troubleshooting.
Solution 1. Run the Game as Administrator
The game needs to create and manage network connections to keep players linked. Some of these actions, such as binding ports or adjusting firewall rules, require elevated permissions. Without admin rights, these actions can fail silently and trigger the “Lost Connection” error.
Running the game as an administrator gives it full network access, allowing it to open ports and communicate without being blocked by Windows. This is especially important when hosting a world or running a dedicated server.
Right-click Terraria.exe in the installation folder → Properties → Compatibility → check “Run this program as an administrator.”
If you don’t know where the file is, right-click the game in Steam → Manage → Browse local files to open the folder directly.
Solution 2. Host Through a Dedicated Server (Host)
Hosting through a dedicated server removes Steam’s relay layer, which is often unstable and prone to packet loss. A dedicated server uses a direct connection, making it more stable and less likely to trigger the “Lost Connection” error, especially when multiple players or mods are involved.
You can host through either IP join or Steam join, depending on what’s easier for your group.
First, go to your Terraria installation folder (usually Steam\steamapps\common\Terraria
) then choose:
- Option A (Classic Dedicated Server): Run
TerrariaServer.exe
, select your world, player slots, and optional password. - Option B (Steam Friends / Private): Run either:
start-server-steam-friends.bat
(allows friends to join through Steam)start-server-steam-private.bat
(restricts access to invited players only)
Prerequisites
- All players must have the same game version.
- If using tModLoader, mods and their versions must be identical.
- World type and character mode must match.
Once everything is set, follow these steps to host the server:
- Open Command Prompt and run
ipconfig
. - Find your active adapter and note your IPv4 Address.
- If players are outside your network, forward port 7777 on your router (you can ask your ISP to assist you with this).
- Share your public IP (from whatismyipaddress.com) with the joiners.
- Players joining through IP should go to Multiplayer → Join via IP, enter the public IPv4 address and the port (default: 7777), then enter the password if required.
For Steam Joiners:
- Start Steam and launch Terraria.
- Your friends open Multiplayer → Join via Steam.
- If the server is private, they’ll need an invite.
- If the server is friends-only, they can join from your Steam profile or the multiplayer lobby.
Do not close the server console while playing. It must stay open for the world to remain active. You can play on the same machine while hosting as long as the server window stays open in the background.
Solution 2. Lower the MTU Value(Client)
MTU (Maximum Transmission Unit) controls the maximum size of data packets your network adapter can send. If the MTU is too high for your network, packets can get fragmented or dropped, which causes Terraria to lose sync with the host. Reducing the MTU creates smaller, more stable packets that travel more reliably, which can fix the “Lost Connection” error.
Before making changes, you should check your current MTU value. This is important for two reasons:
- You might not need to change it if it’s already lower than the default.
- It gives you a safe backup value so you can revert to your original settings if needed.
Step 1: Check Your Current MTU
- Open Command Prompt as Administrator.
- Type:
netsh interface ipv4 show subinterfaces
and press Enter.
- Find your active network adapter (for example, Wi-Fi or Ethernet) and note the number in the MTU column. Write this value down somewhere safe.
Step 2: Decide If You Should Lower It
- If the value is already below 1500 (for example, 1480), lowering it further might not be necessary.
- If it’s set to 1500, lowering it slightly (such as to 1480 or 1472) can improve packet stability on weaker networks.
Step 3: Change the MTU
- In the same Command Prompt window, type:
netsh interface ipv4 set subinterface "Wi-Fi" mtu=1480 store=persistent
(Replace Wi-Fi with your adapter’s name and 1480 with your chosen value.)
- Restart your PC or disable and enable the adapter for the change to take effect.
If you face issues or want to revert, use:
netsh interface ipv4 set subinterface "Wi-Fi" mtu=YOUR_ORIGINAL_VALUE store=persistent
This ensures you only change what’s necessary and can easily return to your original settings later.
Solution 3. Allow Terraria Through Firewall
When Terraria tries to host or join a world, it needs to send and receive data through specific network ports. If Windows Firewall or third-party security software blocks this traffic, the game either fails to connect or suddenly drops the connection mid-session. Allowing Terraria through the firewall lets its connection requests pass without being filtered or blocked.
- Press Win + R, type
control firewall.cpl
and press Enter.
- Click “Allow an app or feature through Windows Defender Firewall.”
- Click “Change settings” in the top-right corner.
- Find Terraria and TerrariaServer in the list. If they’re already there, make sure both Private and Public boxes are checked.
- If they’re not listed, click “Allow another app…”, browse to the game folder, and add both
Terraria.exe
andTerrariaServer.exe
.
- After selecting the apps, click OK to apply the changes.
- Restart Terraria and test the connection again.
Optional Tip: If you use a third-party antivirus, it likely has its own firewall that can block Terraria even if Windows Firewall is set up. Open your antivirus settings, add Terraria.exe
and TerrariaServer.exe
as trusted apps, and allow both inbound and outbound traffic. Suites like Avast, Kaspersky, Bitdefender, and Norton often require this step. I personally rely on Microsoft Defender, but it’s worth checking if your antivirus is interfering.
Solution 4. Verify or Update the Game
If your game version doesn’t match the host’s version, or your local files are corrupted or outdated, Terraria can’t maintain a stable connection and will trigger the “Lost Connection” error. Verifying or updating ensures everyone is running the same clean build of the game.
ModLoader
and Mods
folders before doing this step if you don’t want to lose them.- Open Steam.
- Right-click Terraria in your Library.
- Click Properties → Installed Files.
- Click “Verify integrity of game files”. Steam will check and replace any damaged or missing files.
- If there’s an update available, let Steam download and install it fully before joining or hosting a server.
- If you use tModLoader, make sure it’s also updated to match the host’s version.