The quickest way to host a short Terraria session is Multiplayer > Host & Play. For a world that should remain available without the owner staying in the game, run the separate Terraria dedicated-server program, select a world, configure a port (7777 by default), and give players the correct local or public IP address. Internet hosting also requires a firewall rule and usually router port forwarding; LAN hosting does not need exposure to the public internet.
This guide covers both methods, Windows, Linux, and macOS, configuration files, port forwarding, security, multiple worlds, and the connection problems that account for most failed setups. Server options can change between Terraria releases, so confirm commands against the server files installed on your version.
What is the difference between Host & Play and a dedicated Terraria server?
Host & Play is the low-effort choice for a temporary co-op game. A dedicated server runs the server software separately from the Terraria game client, making it better for an independently administered or always-on world.
| Consideration | Host & Play | Dedicated server |
|---|---|---|
| Setup effort | Start Terraria, choose Multiplayer > Host & Play, then select or create a world. | Install or download server files, start the server, choose a world, configure networking, and keep the server process running. |
| Does the host need to stay in the game? | Yes. The session is tied to the host’s running game. | No. Players connect to the separate server process while the administrator can use the game client—or leave it closed. |
| Persistence after logout | Ends when the host leaves the session. | Continues while the server process and host machine remain online. |
| Administration | Basic controls through the hosted game. | Console commands, configuration files, player limits, passwords, messages of the day, security settings, and separate worlds or ports. |
| Networking complexity | Usually the simplest for a small group, but Internet players can still require router and firewall access. | More initial work, especially for port forwarding, but predictable addresses and settings once configured. |
Choose Host & Play when everyone is available for one session. Choose a dedicated server when the world should be available on a schedule, several people should be able to administer it, or the host should not have to keep Terraria open.
What do I need before making a Terraria server?
- A Terraria installation for the players. The server program is separate from the game client in a dedicated setup.
- A world file, or permission to create a new world during first startup.
- A computer that can stay powered on and connected for the duration of the session. An always-on machine is needed for a continuously available world.
- Permission to change the host computer’s firewall and, for Internet play, the router’s port-forwarding rules.
- The server’s listening port. Terraria uses TCP port 7777 by default; use another port only when you configure it consistently everywhere.
- A stable local address for the host is strongly recommended on a LAN. A router that changes the host’s address can make a previously working forwarding rule point to the wrong computer.
The Official Terraria Wiki lists a default maximum of 16 players. Your configured maxplayers value can be lower, and practical performance depends on the host computer and connection.
How do I host a quick Terraria game with Host & Play?
Host & Play is the fastest route when the host will remain in Terraria for the whole session.
- Launch Terraria.
- Choose Multiplayer, then Host & Play.
- Select an existing world or create a new one.
- Set a password if you do not want anyone with network access to join.
- Have local players join through the host’s LAN address, or configure the router and firewall if players are connecting over the Internet.
The world is available only while the host’s game session remains active. If the host exits, the dedicated server alternative is the way to keep the world running independently.
How do I install the Terraria dedicated-server files?
On Windows, an existing Terraria installation normally contains TerrariaServer.exe in the Terraria folder. If you need standalone files, the official Terraria site provides a PC Dedicated Server download entry. The server package may include a Windows executable and Unix-compatible files or scripts, depending on the release.
Windows
Open the Terraria folder and locate TerrariaServer.exe. Keep the executable, your world files, and any configuration files in locations you can back up. Do not rename a world casually after placing its path in a configuration file; the value must resolve to the actual file.
Linux
Extract the server package to a directory owned by the account that will run it. Grant execute permission to the supplied script or binary, then start the server from a terminal. Use tmux or screen when the process must survive an SSH or terminal logout.
macOS
macOS may block an executable downloaded from the Internet through Gatekeeper. The Terraria server reference documents the additional Gatekeeper approval and executable-permission steps for the supplied files. Apply those steps to the package for your installed version rather than assuming a Windows command will work unchanged.
How do I start a dedicated server for the first time?
Run the server executable without a configuration file for the initial setup. A startup wizard asks you to select an existing world or create one, then requests the values needed to bring the server online.
- Open a terminal or command prompt in the directory containing the server program.
- Run the executable without
-config. On Windows this is usuallyTerrariaServer.exe; on Linux or macOS it is commonlyTerrariaServeror the package’s supplied launcher. - Choose a world. If you create one, follow the prompts for world size and other world-generation choices.
- Enter the maximum player count, listening port, password, and other startup values when prompted.
- Wait for the console to indicate that the server is listening. Leave this window open while players connect.
The first run is useful for confirming that the binary works and for learning the prompts. A configuration file is more repeatable: it lets you restart with the same world, port, player limit, and security settings.
How do I create and use a Terraria server configuration file?
Create a plain-text file such as serverconfig.txt, put one setting on each line, and start the server with the file. On Windows use TerrariaServer.exe -config serverconfig.txt. On Linux or macOS use the corresponding TerrariaServer -config serverconfig.txt command.
Minimal configuration
world=/path/to/world.wld
maxplayers=8
port=7777
password=choose-a-password
secure=1
motd=Welcome to the server
Replace the world path and password with your own values. A relative path can work when the server is started from the expected directory, but an absolute path is easier to diagnose if a launcher or service starts the process elsewhere.
Important settings
| Setting | Purpose | Practical guidance |
|---|---|---|
world= |
Selects the .wld file to load. |
Use the complete path when possible and verify that the file exists. |
worldpath= |
Sets the directory used for world files. | Useful when worlds are stored separately from the server executable. |
maxplayers= |
Sets the connection limit. | Keep it at or below the capacity your host can handle; the documented default maximum is 16. |
port= |
Sets the listening TCP port. | 7777 is the default. Every client, firewall rule, and forwarding rule must use a non-default value if you change it. |
password= |
Requires a password to join. | Use a value that is not reused for another account or service. |
motd= |
Displays a message of the day to connecting players. | Use it for rules, restart times, or contact information. |
secure=1 |
Enables the server’s secure mode. | Keep it enabled unless you have a specific, understood reason to change it. |
language= |
Sets the server language where supported. | Available values can vary by installed version. |
upnp=1 |
Requests automatic router port mapping through UPnP. | It may reduce manual setup, but it depends on router support and security policy. |
The documented configuration also covers banlists and Journey-mode permissions. Exact option names and accepted values can vary with the installed server version, so treat the package’s reference or help output as authoritative when an option is rejected.
How do I set up a Terraria server on a LAN?
LAN hosting keeps traffic inside your home or office network and normally avoids public port forwarding.
- Connect the host and every player to the same router or local network. A wired Ethernet connection is preferable when available, especially for the host or for several local players.
- Give the host a stable local IPv4 address, either by configuring a static address or by creating a DHCP reservation in the router.
- Start the server and confirm its configured port, normally 7777.
- On each other computer, open Multiplayer > Join via IP, choose a character, enter the host’s LAN IPv4 address, and enter the server port.
- If a player cannot connect, allow the server executable and the configured port through the host operating system’s firewall.
Do not give LAN players the public address when they are on the same network unless your router specifically supports that form of loopback. The local IPv4 address is the appropriate destination for local connections.
How do I port forward Terraria 7777 for Internet players?
Port forwarding sends incoming traffic on the router’s public interface to the computer running Terraria. Forward the server’s configured TCP port—7777 by default—to the host’s stable local IPv4 address, then allow the same executable and port through the host firewall.
- Find the host’s local IPv4 address and reserve it in the router’s DHCP settings, if possible.
- Open the router’s administration page and locate Port Forwarding, NAT, or a similarly named section.
- Create a rule for TCP 7777 (or your configured port), pointing to the host’s local IPv4 address. If the router asks for an external and internal port, use the same number for both unless you intentionally map a different external port.
- Save or apply the rule. Some routers require a reboot; others apply changes immediately.
- On the host computer, create or approve a firewall rule for
TerrariaServer.exeor the Unix server process and the same TCP port. - Start the server and have an off-network player use the host’s external IP address and port in Multiplayer > Join via IP.
UPnP can request the mapping automatically when upnp=1 is supported and enabled, but manual forwarding is easier to audit. If the Internet connection uses carrier-grade NAT, or if the router is controlled by an upstream network, a local forwarding rule may not be reachable from outside.
How do players connect to my Terraria server?
The menu path is Multiplayer > Join via IP. After selecting a character, use the address that matches the player’s location:
| Player location | Address to enter | Port |
|---|---|---|
| Same computer as the server | localhost |
The configured port, 7777 unless changed |
| Same LAN | The host’s LAN IPv4 address, such as the address reserved in the router | The configured port |
| Different network | The host’s external/public IP address | The forwarded and configured port |
If you changed port=, players must enter that non-default port; forwarding 7777 will not reach a server listening elsewhere. The host can test locally with localhost, but that test does not prove that Internet forwarding works.
How do I keep a Terraria server running on Linux or macOS?
A server launched in an ordinary terminal often stops when that terminal closes or the remote session logs out. Start it inside a persistent terminal multiplexer.
- Open a shell in the server directory.
- Start a session with
tmuxorscreen. - Launch the server command, for example
TerrariaServer -config serverconfig.txt. - Detach from the session using the multiplexer’s detach command; leave the process running.
- Reconnect later with the multiplexer’s attach command to read the console or issue an administrative command.
Make sure the Unix binary or supplied script has execute permission before starting it. macOS may also require the Gatekeeper approval described in the server reference. For an always-on public world, a separate machine or paid managed hosting service can reduce dependence on a personal computer, but verify the provider’s supported Terraria version, port policy, backups, and mod support before committing.
What server console commands should an administrator know?
The server console accepts administration commands while the process is running. The core commands documented for routine operation include:
help— display available commands and syntax.playing— show connected players.save— save the current world.exit— save and shut down cleanly.exit-nosave— shut down without saving the current changes.
Use save before planned maintenance and exit for ordinary shutdowns. Reserve exit-nosave for situations where you deliberately need to discard unsaved changes.
How can I run more than one Terraria server on one computer?
Run each instance with its own configuration file, world, and port number. For example, one process can load serverconfig-a.txt and listen on 7777 while a second loads serverconfig-b.txt and listens on another unused port.
- Give every instance a distinct
world=file or deliberately point multiple instances at a world only when you understand the risk of simultaneous writes. - Assign a unique
port=to each process. - Create firewall and router rules for every Internet-facing port.
- Tell players which external port belongs to which world.
- Keep separate logs and backup locations where your launcher or operating system supports them.
Two servers cannot bind to the same IP address and TCP port at the same time; a second process using an occupied port will fail to start or will report a bind error.
How do I troubleshoot a Terraria server that friends cannot join?
Work from the inside out: prove that the server is running, then test the address, firewall, and router in that order.
The host cannot connect
- Use
localhostand the configured port. If this fails, the server process may not be running, may have loaded a different configuration file, or may be listening on another port. - Read the startup console for a world-file error, a permission problem, or a port already in use.
LAN players cannot connect
- Confirm that all computers are on the same network and that the player is using the host’s LAN IPv4 address, not an old address or the public IP.
- Check the host firewall for both the Terraria server executable and the configured TCP port.
- Verify that the player is entering the same port shown in the server configuration.
Internet players cannot connect
- Confirm the external IP address and port, and test from a genuinely different network such as a mobile connection.
- Check that the router forwards the configured TCP port to the host’s current local IPv4 address.
- Check both the host firewall and any cloud-provider firewall. A cloud deployment needs the provider’s network rule as well as the operating system rule.
- If the router cannot forward ports because of carrier-grade NAT or network policy, use a virtual-LAN option such as Hamachi or Radmin VPN; every player must install and join the same VPN network.
The Linux server stops when the terminal closes
Run it inside tmux or screen, then detach rather than closing the shell. Reattach to inspect the console and use save or exit before maintenance.
The server starts but loads the wrong world
Open the configuration file used in the startup command and verify the exact world= path. If you have several config files, use an explicit command for each one so a launcher cannot select an unintended default.
How do I secure and maintain a Terraria server?
Keep the server private while you test it, then expose only the port players need.
- Set a non-obvious
password=and share it privately. - Leave
secure=1enabled unless a documented compatibility need requires another value. - Forward only the configured Terraria TCP port; do not expose unrelated administration services.
- Use the
motd=line to state rules, scheduled restarts, or where players should report problems. - Save before planned restarts and copy world files to a separate backup location. A backup made while the server is actively writing can be inconsistent, so stop the server cleanly first when practical.
- Keep the Terraria client and server package on compatible versions. The setup reference is marked subject to revision and warns that some instructions may be heavily outdated, so recheck version-specific commands when upgrading.
A server provides a network platform for multiplayer over the Internet or another network. Treat the world file as valuable data: passwords and firewalls control access, while regular offline copies protect against accidental deletion or corruption.
Frequently Asked Questions
Can I host a Terraria server without port forwarding?
Yes, but not by ordinary direct Internet connections when your router or ISP blocks inbound traffic. A virtual-LAN service can make players appear to share a private network, and every participant must install the same VPN software; otherwise use a network or hosting provider that supplies reachable inbound connectivity.
What port does Terraria use if I do not change anything?
The documented default is TCP 7777. If you select another value in the configuration, that value replaces 7777 for the server, firewall, router rule, and every player’s Join via IP entry.
Can different Terraria versions connect to the same server?
Plan on using matching client and server versions. Server options and commands can change between releases, and a version mismatch can prevent a connection or produce unexpected world behavior; update the package and clients together and read the installed package’s notes.
Where should I store Terraria world backups?
Keep copies outside the live server directory and on a different storage location when possible. Stop the server with the save and exit commands before copying so the backup captures a complete, closed world file.
Why does my public IP work for some friends but not others?
That pattern can indicate different network paths, a stale DNS or IP value, firewall profiles, or carrier-grade NAT on one side. Retest with the exact configured port, confirm the router’s forwarding target has not changed, and compare whether the affected player is on a restricted school, work, or mobile network.