Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Terraria Server Setup: Config File, Ports and World Settings

A practical Terraria dedicated-server guide covering serverconfig.txt syntax, launch commands, world loading and generation, ports, firewall and router forwarding, UPnP, multiple servers and troubleshooting.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Terraria dedicated server is controlled by a plain-text configuration file and started with the server executable. The reliable setup is: choose or create a world, set the server options in key=value form, launch with -config, then allow the listening port through the host firewall and, for most home Internet connections, forward that port from the router.

This guide covers Windows, Linux and macOS launch commands, existing and newly generated worlds, port forwarding, UPnP, multiple isolated servers, command-line overrides and the failures that most often prevent a connection.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before starting

Prepare these items before editing a configuration file:

  • The Terraria dedicated-server executable for your operating system. Windows uses TerrariaServer.exe; Linux and macOS use the platform executable, commonly invoked as ./TerrariaServer.
  • A location for the configuration file. It may be outside the executable directory if you provide its path when launching the server.
  • Either an existing .wld world file or a plan for automatic world creation.
  • A TCP port that is free on the host computer. The official reference uses 7777 as the standard example.
  • Permission to edit the operating-system firewall and, when hosting from home, the router that sits between the host and the Internet.

Decide whether players will connect only from the same network or from the Internet. A local-only server still needs the host firewall configured, but it normally does not require router forwarding. Internet players need the host’s external IP address, and a typical home network also needs a forwarding rule on the router.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Choose how the world will be supplied

Approach Configuration When to use it Important consideration
Load an existing world Set world= to the full path of a .wld file. You already have a world, or you want to move a world between machines. The path must identify the file the server can read; a typo causes the world-load step to fail.
Create a world at startup Use autocreate=1, 2 or 3, plus optional seed= and worldname=. You want a new small, medium or large world. Record the seed and resulting path so another administrator can reproduce the intended setup.
One server on the computer One configuration file, one world and one listening port. Most private or family servers. Simplest to operate and troubleshoot.
Several servers on one computer Separate configuration files, worlds and port numbers. Distinct communities, maps or difficulty settings. Every instance must have its own port; reusing a port prevents the later process from binding.

Create the configuration file

Use one key=value entry per line

Terraria’s server configuration is a text file. A line beginning with # is a comment and is ignored. Keep the equals sign between the key and value, and put each setting on its own line. The file can be named serverconfig.txt or another name that you remember; the launch command supplies the exact path.

This is a practical minimal configuration for an existing world:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
world=/srv/terraria/Worlds/MyWorld.wld
port=7777
maxplayers=8
password=change-this
motd=Welcome
secure=1

The path above is an example of an absolute path. Replace it with the real path on your machine. maxplayers=8 limits this instance to eight simultaneous players; the documented default maximum is 16. password= protects the join attempt, motd= supplies the message of the day, and secure=1 enables the server’s secure mode.

Useful keys beyond the minimum

  • worldpath= selects the directory used for world files.
  • banlist= points to the ban-list file.
  • upnp=1 asks a compatible router to create the port mapping automatically.
  • language= selects the server language when supported by the executable.
  • priority= sets the process priority option documented by the server reference.
  • Journey Mode permission settings control which Journey-specific powers are available.

Keep comments beside settings that are easy to forget, but do not put explanatory text after a value unless the syntax for that option explicitly permits it. A safe pattern is to place comments on their own lines:

# The world loaded by this instance
world=/srv/terraria/Worlds/MyWorld.wld
# Standard example port
port=7777

Start the server with the config file

Windows

  1. Find the Terraria installation folder that contains TerrariaServer.exe.
  2. Save the configuration file, noting its full path. It may be in another directory.
  3. Open a command prompt in the installation folder, or use a fully qualified executable path.
  4. Run TerrariaServer.exe -config <serverconfigfile>, replacing <serverconfigfile> with the actual configuration-file path.

For example, if the file is named my-server.txt, the command must identify that exact file rather than relying on an assumed default name.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Linux and macOS

  1. Change to the directory containing the platform server executable.
  2. Run ./TerrariaServer -config <serverconfigfile>.
  3. If the configuration file is elsewhere, pass its absolute or correctly resolved path after -config.

The executable prints startup information in its terminal window. Leave that process running while players are connected; closing the terminal or stopping the process stops the server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the -config path matters

The official setup procedure specifically requires the executable and the configuration-file path together when using a pre-made configuration. This also makes separate instances manageable: each process can be launched with its own file instead of repeatedly editing one shared file.

Load an existing Terraria world

  1. Locate the intended .wld file.
  2. Put its full path after world= in the configuration file.
  3. If you want world files kept in a particular directory, set worldpath= as documented and ensure the selected directory is accessible to the server process.
  4. Start the server with -config.
  5. Read the startup output and verify that the named world is the one being loaded before giving the address to players.

Do not combine an existing-world setup with an automatic-creation plan unless you understand which startup value is being used. For a known map, the unambiguous choice is a valid world= path and no accidental creation setting.

Generate a new world automatically

If the selected world does not yet exist, the server can create one at startup. Set the size with autocreate:

Setting World size
autocreate=1 Small
autocreate=2 Medium
autocreate=3 Large

Add seed= for the seed string and worldname= for the generated world’s name. A creation configuration can look like this:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
autocreate=2
seed=My recorded seed
worldname=Community World
difficulty=expert
worldpath=/srv/terraria/Worlds
port=7777
maxplayers=8
motd=Welcome
secure=1

The documented difficulty choices are normal, expert, master and journey. Use the value corresponding to the mode you want, and record the exact seed, name, size and world directory in your deployment notes. That record is what lets another administrator recreate the intended setup rather than guessing which generated world was used.

Set the port and make the server reachable

Choose the listening port

Set the same port in the server configuration and in every network rule that protects or forwards it. port=7777 is the standard documented example, but another unused port can be assigned when a different service already occupies 7777 or when several Terraria instances share one computer.

Changing the port changes the number players must use when connecting. It does not by itself make an Internet connection possible; the host firewall and, on a NAT home network, the router must also pass that port.

Allow the port in the host firewall

  1. Open the operating-system firewall management tool on the computer running the server.
  2. Create an inbound rule for the server’s listening TCP port, such as 7777.
  3. Apply the rule to the network profile appropriate for your setup.
  4. Restart the server if you changed the port after it was already running.
  5. Test from another device on the same network before testing from the Internet.

The firewall rule must match the configured port. Allowing 7777 while the configuration says 7780 leaves the actual listener blocked.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Forward the port on a home router

Most home Internet connections use NAT. In that arrangement, players outside the home cannot reach the private address of the server computer until the router forwards the chosen TCP port to that computer.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
  1. Give the server computer a stable private address, using the router’s address reservation feature or another method appropriate to your network.
  2. Open the router’s port-forwarding page.
  3. Create a TCP rule for the external port selected in port=.
  4. Set the destination to the server computer’s private address and the same internal port.
  5. Save the rule, confirm the host firewall allows the port, and keep the Terraria process running.
  6. Give Internet players the host’s external IP address and the configured port when the client asks for it.

Router interfaces use different labels, so the exact menu name varies. The essential mapping is external TCP port to the host computer’s private address and identical internal TCP port.

When UPnP is appropriate

Set upnp=1 if you want Terraria to ask the router to create the mapping automatically and your network permits UPnP. This can remove the manual forwarding step, but the setting is a request, not a guarantee: routers may disable UPnP, restrict it by policy or fail to implement it consistently. If automatic mapping does not work, use a manual TCP rule or disable the attempt with the documented -noupnp command-line option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Non-NAT and hosted networks

A machine on a non-NAT connection generally does not need router forwarding. It still needs the host firewall rule, and the address players use must be reachable from their networks. A hosted environment may provide its own firewall or network policy; apply the same principle by allowing the configured TCP port at every layer.

Run more than one Terraria server

The official setup guidance requires different configuration files, different worlds and different port numbers for multiple servers on one computer.

  1. Copy the base configuration into a separate file for each instance.
  2. Set a unique world= path or a unique creation/world directory for each instance.
  3. Assign a unique port= to every file.
  4. Create a matching firewall rule and, for Internet hosting, a matching router-forwarding rule for each port.
  5. Launch each executable with its own -config argument.

For example, one process might use server-a.txt, WorldA.wld and port 7777, while another uses server-b.txt, WorldB.wld and port 7778. The names are illustrative; the required property is isolation of files and ports.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Do not point two instances at the same world file while both are running. Separate files and ports prevent accidental cross-loading and make it clear which process should be stopped or backed up.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use command-line options when a launch script needs overrides

The server reference documents command-line parameters that can supply or override startup values. Relevant options include:

  • -config for the configuration-file path.
  • -port for the listening port.
  • -world for the world file.
  • -autocreate for automatic world size.
  • -worldname and -seed for generated-world identity.
  • -banlist and -secure for administration and security settings.
  • -noupnp to prevent an automatic UPnP request.
  • Steam and lobby options when using the corresponding server features.

Use a configuration file for stable, reviewable defaults and command-line arguments for instance-specific launch scripts. If a value appears in both places, treat the command-line value as the intended startup override and verify it in the server’s startup output.

Operational controls worth setting

Player capacity

maxplayers controls the number of simultaneous players. The documented default maximum is 16, compared with 8 in versions before 1.4.0.1. Set a lower value when the server should have a deliberate cap; do not assume the default matches your community’s needs.

Password and message of the day

A non-empty password= keeps an otherwise reachable server private. motd= gives connecting players a short instruction or welcome message. Avoid putting sensitive information in the message because it is displayed to every joining player.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Secure mode and moderation

secure=1 enables secure mode. Pair it with a maintained banlist= when you need persistent moderation across restarts. Keep the ban-list path separate for each isolated server so an action on one instance does not silently affect another.

Backups and reproducibility

Back up the world file while the server is stopped or at a point when the file is not being written. Keep the configuration, world path, world name, seed, difficulty, size and port in the same administrative record. The seed alone is not enough if the generated-world size, name or destination directory differs.

Troubleshoot the common failures

Symptom Likely cause Checks and fix
The executable starts but no intended world loads. The world= path is wrong, inaccessible or points to a different file. Use the full path to the intended .wld file, check spelling and permissions, and confirm the startup output names the expected world.
A new world is created unexpectedly. An automatic-creation option is active or the selected world path does not contain the expected file. For an existing map, use a verified world= path. For a new map, keep autocreate, seed, worldname and worldpath together deliberately.
Players on the same home network cannot join. The host firewall blocks the listener, the server is on a different port than expected, or the wrong local address is being used. Confirm the process is running, match the client port to port=, allow that TCP port in the firewall, and test with the host’s private address.
Local players can join but Internet players cannot. The router lacks a forwarding rule, the rule points to the wrong private address, or the external address is wrong. Reserve the host’s private address, forward the configured TCP port to it, verify the firewall rule, and give remote players the current external IP and port.
UPnP does not open the port. The router has UPnP disabled, does not support the request or restricts automatic mappings. Enable UPnP only if permitted by the network; otherwise create a manual forwarding rule or launch with -noupnp.
A second server will not start. Both processes are trying to use the same port, or the second configuration points to a conflicting resource. Assign the second instance a different port, configuration file and world, then add matching firewall and router rules.
The server accepts more players than intended. maxplayers is absent or set higher than the desired cap. Set an explicit value such as maxplayers=8 and restart the instance.
Changes appear to have no effect. The process was launched with another configuration file, or a command-line option supplied a different value. Inspect the exact -config path and launch arguments, then restart the correct process.

A repeatable deployment checklist

  1. Choose the existing-world or automatic-creation approach.
  2. Create a text configuration with one key=value entry per line and comments beginning with #.
  3. Set a valid world path, or set autocreate, seed, worldname, difficulty and worldpath for generation.
  4. Set port, maxplayers, password, motd and any moderation or security options required.
  5. Launch with the platform executable and -config pointing to that file.
  6. Allow the same TCP port through the host firewall.
  7. For a home Internet host, forward that port from the router to the server computer, or test UPnP and confirm that it succeeded.
  8. Connect locally first, then test from outside the home network.
  9. Record the final configuration, world path, seed and network details for recovery.

Following that order separates world problems from network problems: first prove that the server loads the intended world, then prove that the host accepts a local connection, and only then troubleshoot router or external-address issues.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.