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
World desk8 min

How to Set a Password on a Terraria Server (Vanilla, TShock, and Hosted Panels)

Use the right password setting for your Terraria server: vanilla uses serverconfig.txt, TShock uses tshock/config.json, and hosted panels may override either file.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The correct password setting depends on the server software. A vanilla Terraria server reads a plain-text serverconfig.txt file; TShock reads tshock/config.json. Add the password to the file or control panel that actually starts your server, save it, and restart the server process so the new value is loaded. An empty password value leaves the server open.

First identify which Terraria server you are running

Do not put a TShock setting in a vanilla configuration file, or a vanilla password= line in TShock’s JSON. The server software determines both the file format and the setting name.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Server setup Where the password is set Format Important qualification
Vanilla Terraria dedicated server serverconfig.txt password=yourpassword The line may be commented out in an example configuration; remove the comment marker before saving.
TShock tshock/config.json The ServerPassword JSON setting The file is created on the first TShock start. An empty string means no password.
Managed hosting panel The panel’s TShock or startup settings Panel-specific controls A startup value can override the file on some hosts, so check both places.
Docker-style deployment Container environment variables or the mounted configuration Host-specific; one documented example uses TERRARIA_PASSWORD Environment-variable names are not universal across images.

The TShock setting and its meaning are documented in the TShock configuration settings reference. For vanilla servers, the syntax is also shown in the Skynode vanilla-server guide and a Terraria Wiki server-configuration draft. The draft is a user page rather than a confirmed current official reference, so check the configuration generated by your installed game version if labels differ.

Restart is part of the change

Terraria and TShock read their server settings when the process starts. Editing a file while the server is running does not reliably change the live server. Stop the server cleanly, save the password, then start the same server executable or panel instance again. If a host panel automatically restarts after a save, wait for that operation to finish before testing.

#1 Best Overall
505 Games Terraria 71501866
  • In Terraria, every world is unique-from the floating islands in the sky to the deepest level of The Underworld. Adventure to the ends of the earth, and defeat villainous bosses along the way. The world is your canvas!

Keep a copy of the original configuration before editing. If the server fails to start afterward, restore the copy and inspect the syntax for a missing quotation mark, comment character, or accidental change to another setting.

Set a password on a vanilla Terraria server

1. Locate the configuration file

Find the serverconfig.txt file used by the server launch command. It is often in the same server directory as the dedicated-server executable, but the decisive clue is the path supplied to the launch command or hosting panel. A server can have several text files, so edit the one the running instance actually loads.

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

2. Add or uncomment the password line

Open the file in a plain-text editor and add this line, replacing the example value:

password=yourpassword

If the file already contains a line such as #password=, remove the leading comment character and enter the value:

password=yourpassword

Use the exact spelling password, an equals sign with no extra setting name, and the password on the same line. Do not save the file as rich text or as a document with an extra extension such as serverconfig.txt.txt. Keep the rest of the generated options unchanged unless you intend to modify them.

Rank #2
Terraria Boss Rush: Hardmode Edition T-Shirt
  • Gaming Boss Battles design. Boss Rush: Hardfashion Edition items are perfect for fans of Terraria or anyone who likes cool video game clothes! These Terraria items feature the hardmode bosses and is a great way to show your enthusiasm for Terraria!
  • Part of the official Terraria merchandise line from Re-Logic, the creators of Terraria! If you are a terraria fan or should know one, get this design to give yourself or others who play terraria a great gift.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem

3. Save and restart the vanilla server

Save the text file, stop the current server process, and start it again with the same configuration-file argument. If you use a script, service, or panel, restart that managed instance rather than launching a second copy manually; two processes competing for the same port can make a correct password change appear not to work.

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

4. Test from a client

Connect using the server’s address and port. A client that supplies the new password should enter the world; a client that leaves it blank or uses an older value should be rejected. Test from a second account or device if possible, and disconnect the test client before changing the password again.

Set a password on a TShock server

1. Start TShock once so its configuration exists

TShock creates tshock/config.json on its first start. If the directory or file is missing, launch the server once, allow initialization to finish, stop it cleanly, and then edit the generated file. Do not create a different JSON file elsewhere unless your startup command explicitly points there.

2. Edit the ServerPassword value

Open tshock/config.json in a text editor that preserves JSON. Find the ServerPassword property and replace its value with the password you want. A typical entry has this shape:

"ServerPassword": "yourpassword"

Keep the quotation marks, comma placement, and capitalization used by the generated file. JSON is stricter than a line-oriented text configuration: a missing comma or quote can prevent TShock from parsing the file. Avoid smart quotes inserted by word processors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Terraria Bunny Plush
  • Product Type:Toy Figure
  • Item Package Dimension:11.6 cm L X 14.4 cm W X 15.8 cm H
  • Item Package Weight:0.1 kg
  • Country Of Origin: China

An empty value means that TShock does not require a password:

"ServerPassword": ""

That is useful for a deliberately public server, but it is not a protected configuration. The TShock settings reference identifies ServerPassword as the relevant setting.

3. Save, validate, and restart TShock

Save the file without changing its .json extension. Stop the TShock process and start it again. Watch the startup log for a JSON parsing error or a message indicating that a different configuration path is being used. If the process will not start, restore the backup and reapply only the password edit with valid JSON syntax.

4. Confirm the protected connection

Join with the new password, then deliberately try a wrong password. This distinguishes a working password from a client that was already authenticated or a panel that has not restarted the instance you edited.

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

Use a hosted server control panel

Panels vary, but a TShock installation commonly exposes a Tshock Settings page. Open the server’s settings, search the page for Password, enter the value, save it, and use the panel’s restart control. A step-by-step hosting example is available from Kinetic Hosting’s TShock password guide.

Rank #4
Terraria PS Vita Game
  • 14 Different environments (including dungeons, floating islands, jungles) that go to the extremities of the earth, up in the sky and all the way down to the very deepest depths of the world.
  • Hundreds of weapons, armour and other items to craft, with character advancement.
  • Explore to find different materials and make exotic potions, laser guns, magic wands, flamethrower, diving gear, speed boots, grappling hooks, chainsaws, magic mirrors, etc.
  • 29 Different block types to build whatever you imagine!
  • NPCs and a swarm of enemies (over 150 types) including goblins, wyverns, unicorns, and-GASP-clowns!

Check for a startup override

Some panels provide a password field in a Startup or launch-parameter section as well as an editable config.json. One hosting guide reports that a Startup value may take priority over the JSON file, although that behavior is host-specific and the attribution is not independently confirmed here. If your saved file keeps reverting or the old password remains active:

  1. Stop the server.
  2. Inspect the panel’s Startup, Variables, or Launch Parameters page for a password field.
  3. Remove an old startup value or change it to the same password as the configuration file.
  4. Save the panel settings and restart the managed server.
  5. Reopen the file after the restart to see whether the panel rewrote it.

Do not assume that a panel’s file browser points to the same directory used by the live process. The startup command, working directory, or selected server instance determines which configuration is active.

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

Docker-style deployments and environment variables

Container images sometimes translate an environment variable into the Terraria or TShock configuration at startup. A Cloudron forum discussion mentions TERRARIA_PASSWORD for one TShock deployment (Cloudron TShock thread). Treat this as an image- or host-specific convention, not a universal Terraria variable.

For a containerized server, inspect the image documentation and deployment definition first. If it documents TERRARIA_PASSWORD, set the variable in the container’s environment, redeploy or restart the container, and confirm that the generated configuration contains the expected value. If the image does not document that variable, editing it will have no effect; use the mounted configuration file or the image’s own documented setting instead.

  • Keep secrets out of public compose files, screenshots, and support posts.
  • Remember that changing an environment variable normally requires recreating or restarting the container, not merely reconnecting a game client.
  • Check container logs for a startup message, configuration parse error, or indication that an environment variable was ignored.

How to change, remove, or rotate the password

Change a password

Edit the same source that currently controls the server: the vanilla password= line, TShock’s ServerPassword, or the panel or container variable. Save and restart, then distribute the new value only to players who should retain access. Existing connections may remain connected until they disconnect; test a fresh connection to verify the new value.

Best Value
Sale
CyberPowerPC Gamer Xtreme VR Gaming PC, Intel Core i5-13400F 2.5GHz, GeForce RTX 5060 8GB, 16GB DDR5, 1TB PCIe 4.0 SSD, WiFi Ready & Windows 11 Home (GXiVR8060A40)
  • System: Intel Core i5-13400F 2.5GHz 10 Cores | Intel B760 Chipset | 16GB DDR5 | 1TB PCIe 4.0 NVMe SSD | Windows 11 Home
  • Graphics: NVIDIA GeForce RTX 5060 8GB Graphics | 1x HDMI | 2x DisplayPort
  • Connectivity: 1 x USB-C 3.2 | 2 x USB-A 3.2 | 6 x USB-A 2.0 | 1 x LAN | WiFi 6 | Bluetooth 5.3 | 7.1 Channel Audio
  • Tempered Side Case Panel | Custom RGB Lighting | Keyboard and Mouse
  • 1 Year Parts & Labor Warranty, Free Lifetime Tech Support

Remove the password

For vanilla, remove the password value or use the server’s documented empty setting. For TShock, set ServerPassword to an empty string, "". Restart and test from a client with no password. An empty value makes the server open, so use it only when that is intentional.

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

Rotate after disclosure

If the password appeared in a public chat, log, screenshot, or repository, treat it as compromised. Replace it with a new value rather than relying on secrecy, and update every panel or startup variable that could overwrite the file.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting: when the password does not work

Symptom Likely cause What to check
The server still accepts anyone The value is empty, the wrong file was edited, or the process was not restarted. Confirm the active startup path, verify a non-empty value, and perform a full stop/start.
The new password is rejected A panel or startup variable is overriding the file, or the client is using an old saved value. Inspect Startup or Variables settings, then reconnect with the exact new value.
TShock will not start Invalid JSON, such as a missing quote or comma. Restore the backup and edit only the string after ServerPassword.
Vanilla server ignores the line The line remains commented, the setting is misspelled, or another configuration file is active. Use an uncommented password=... line and verify the launch command’s file path.
Container changes disappear The image regenerates configuration from environment variables at startup. Set the documented variable or persistent mount, then recreate or restart the container.
Players can connect without being prompted They are already connected, or they joined a different server instance or address. Disconnect completely, test a fresh client, and verify the endpoint and process.

Check which process is actually running

A common source of confusion is editing one installation while a service, script, panel, or container launches another. Stop the managed service and confirm that the game server process exits. Then start it through the same mechanism normally used by players. If the old process remains, it can continue serving the old password while the edited instance never receives connections.

Check for file-format damage

Use a plain-text editor, preserve UTF-8 or the encoding created by the server, and look for accidental extension changes. In JSON, inspect commas and quotation marks. In the vanilla file, ensure the password is on its own line and that a comment marker has not disabled it.

Choose a password that is practical for a shared game server

  • Use a unique phrase that is not reused for email, hosting, or administrator accounts.
  • Share it through a private channel; a password posted in a public community channel is no longer a gate.
  • Keep the value easy enough for invited players to type accurately, but not predictable from the server name or owner.
  • Change it when the player group changes or when anyone with access is no longer trusted.
  • Back up the configuration without exposing the secret in a public repository or support ticket.

The server password controls entry to the game server; it does not replace operating-system account security, panel authentication, firewall rules, or TShock permissions. Protect those layers separately.

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

Quick Recap

Bestseller No. 1
Bestseller No. 2
Terraria Boss Rush: Hardmode Edition T-Shirt
Terraria Boss Rush: Hardmode Edition T-Shirt
Lightweight, Classic fit, Double-needle sleeve and bottom hem
$19.99
Bestseller No. 3
Terraria Bunny Plush
Terraria Bunny Plush
Product Type:Toy Figure; Item Package Dimension:11.6 cm L X 14.4 cm W X 15.8 cm H; Item Package Weight:0.1 kg
$17.78
Bestseller No. 4
Terraria PS Vita Game
Terraria PS Vita Game
Hundreds of weapons, armour and other items to craft, with character advancement.; 29 Different block types to build whatever you imagine!
$40.99
SaleBestseller No. 5
CyberPowerPC Gamer Xtreme VR Gaming PC, Intel Core i5-13400F 2.5GHz, GeForce RTX 5060 8GB, 16GB DDR5, 1TB PCIe 4.0 SSD, WiFi Ready & Windows 11 Home (GXiVR8060A40)
CyberPowerPC Gamer Xtreme VR Gaming PC, Intel Core i5-13400F 2.5GHz, GeForce RTX 5060 8GB, 16GB DDR5, 1TB PCIe 4.0 SSD, WiFi Ready & Windows 11 Home (GXiVR8060A40)
Graphics: NVIDIA GeForce RTX 5060 8GB Graphics | 1x HDMI | 2x DisplayPort; Tempered Side Case Panel | Custom RGB Lighting | Keyboard and Mouse
$1,285.00

Quick decision checklist

  1. Identify whether the server is vanilla, TShock, hosted through a panel, or running in a container.
  2. Locate the configuration source used by the active startup command.
  3. Set the matching value: password=yourpassword for vanilla or ServerPassword for TShock.
  4. Check for a panel Startup or environment-variable override.
  5. Save a backup, restart the actual server process, and test both the new password and an incorrect one.
  6. Document who has the password and rotate it if it is disclosed.

Reference guides

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.

Leave a Reply

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

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
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.