Recommended Free Tools
A Linux VPS gives Terraria a public, always-on home, while Docker Compose makes the server reproducible and easy to rebuild. The reliable setup is to publish Terraria’s TCP port 7777, permit that port in both firewall layers, and mount the server’s data directory from the VPS so worlds and configuration survive container replacement.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
This guide covers vanilla Terraria and tModLoader, including unattended startup, UID/GID ownership, backups, updates, and a connection troubleshooting sequence.
As an Amazon Associate I earn from qualifying purchases.
What you need before deploying
Prepare these pieces before creating the container:
- A Linux VPS with a public IPv4 address (and IPv6 if you intend to use it).
- Administrative SSH access. Keep SSH available while changing firewall rules.
- Docker Engine and Docker Compose V2 installed on the VPS. Verify Compose with
docker compose version; the command must use the space-separated Compose V2 syntax. - Terraria server files, or a Docker image that includes the server you intend to run. Choose vanilla for an unmodded server and tModLoader for a modded one.
- A host directory with enough storage for worlds, configuration, mods, logs, and backups.
- Permission to create inbound rules in both the VPS operating-system firewall and the provider’s cloud firewall, security group, or network ACL.
The VPS provider’s acceptable-use policy and game-server policy still apply. Select a data-center or virtual-server plan that offers consistent uptime; LinuxGSM lists Ubuntu 24.04, Debian 11, and Red Hat Enterprise Linux 8 among distributions commonly used for game servers.
#1 Best Overall
- 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.
How the Docker deployment is arranged
The VPS runs Docker, Docker runs the Terraria process, and Docker Compose describes the service, port mapping, volume, and restart behavior. A bind mount keeps the important files on the VPS rather than in the container’s writable layer.
Use a project directory such as this:
terraria-server/
├── docker-compose.yml
├── Dockerfile # only if you build an image yourself
├── .env # local secrets or chosen IDs; do not publish it
└── data/
├── Worlds/
├── Mods/ # tModLoader servers
├── enabled.json # tModLoader enabled-mod metadata
├── serverconfig.txt
└── other server files
The exact subdirectories vary by image. Some images place the data root at /data; others use a tModLoader-specific path. Read the selected image’s documentation and mount its documented data directory. The critical rule is that Worlds, serverconfig.txt, Mods, enabled.json, ban files, and any other state must be below the host path in the volume mapping.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Choose vanilla Terraria or tModLoader
| Decision | Vanilla server | tModLoader server |
|---|---|---|
| Use it when | Every player uses the unmodded Terraria client. | The world requires mods or tModLoader-specific server features. |
| Client requirement | Players use the matching Terraria release. | Every player uses a compatible tModLoader build and the same enabled mods. |
| Persistent data | Worlds, server configuration, bans, and logs. | All vanilla data plus the Mods directory and enabled-mod metadata such as enabled.json. |
| Upgrade concern | Image or Terraria-version changes can affect saves and connections. | Build changes and mod updates can affect both saves and client compatibility. |
| Operational choice | Use a pinned vanilla image tag when the image project supports version tags. | Use a pinned tModLoader image or release rather than an unqualified rolling tag. |
The tModLoader Dedicated Server Utils documentation describes a Docker workflow based on a Dockerfile, Compose file, a configured UID/GID, and serverconfig.txt for unattended startup. Projects that publish separate vanilla and tModLoader tags also recommend pinning a specific version so an automatic image change does not unexpectedly alter the server or save format.
Create the Compose service
From the project directory, create docker-compose.yml. This is the deployment shape; replace the image value with the pinned image and data path required by that project.
services:
terraria:
image: your-pinned-terraria-or-tmodloader-image:tag
ports:
- "7777:7777/tcp"
volumes:
- ./data:/data
restart: unless-stopped
The left side of ./data:/data is the persistent directory on the VPS. The right side must match the path used inside the image. If the image expects a different internal directory, change only that right-hand path. Do not remove the /tcp suffix: Terraria’s documented server port is TCP 7777.
Some tModLoader Compose examples define a container user with UID and GID values. Keep those values in the service or its .env file as the image documentation specifies. The process must be able to read and write the mounted files.
Prepare the data directory
- Create the project and data directories:
mkdir -p ~/terraria-server/data. - Copy an existing world,
serverconfig.txt, mods, or other files into the documented locations underdata. If this is a new server, the image can usually create the initial files on first boot. - Set ownership to the UID and GID configured for the container. Substitute the actual values from the image documentation:
sudo chown -R UID:GID ~/terraria-server/data. - Keep
.envreadable only by the administrator if it contains credentials or private settings.
A mismatch between the host ownership and the container’s configured UID/GID commonly produces missing worlds, failed mod writes, or a server that starts without saving changes.
Rank #2
- 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
Use serverconfig.txt for unattended startup
Place serverconfig.txt in the path expected by the image and reference it using the image’s documented environment variable or command option. The file should specify the world and server settings so the process can start without an interactive menu after a reboot. Because variable names differ between projects, copy the exact names from the selected image’s Compose example rather than assuming one universal setting.
Open Terraria’s network port at every layer
Clients connect to the VPS public IP on TCP port 7777. A successful Docker mapping is necessary but not sufficient: the host firewall and the provider’s cloud firewall must also allow the connection.
- In
docker-compose.yml, publish7777:7777/tcp. - In the VPS operating-system firewall, allow inbound TCP 7777. Keep SSH allowed before enabling or reloading the firewall so you do not lock yourself out.
- In the provider control panel, add an inbound cloud-firewall, security-group, or network rule for TCP 7777 to the VPS. Providers often maintain this second firewall independently of the Linux host firewall.
- Do not open unrelated ports. Restrict administration to SSH and expose only the game port required by the server.
Use the VPS public IP address, not a private Docker or host-network address, in the Terraria or tModLoader multiplayer client. If you assign a DNS name, it must resolve to that public address.
Start and verify the server
- Change into the project directory:
cd ~/terraria-server. - Start the service in the background:
docker compose up -d. - Watch startup output:
docker compose logs -f. Look for world loading, the configured port, and a message indicating that the server is ready. Stop following logs withCtrl+C; this does not stop the container. - Check the service state:
docker compose ps. A repeatedly restarting or exited service indicates a process, configuration, permission, or image problem. - Confirm the port mapping with
docker compose port terraria 7777or the equivalent inspection command documented by the image. - Connect from a Terraria client using the VPS public IP and port 7777. For tModLoader, launch the tModLoader client rather than the vanilla client.
For server administration, the tModLoader documentation describes attaching to the console with docker attach and issuing commands with docker exec. Use the method supported by your image; an attach session can send input directly to the server process, while docker exec is useful for a specific command in a running container.
Keep the world when replacing a container
Containers are disposable. The bind-mounted host directory is what preserves the game. If ./data remains intact, docker compose down, image replacement, and container recreation do not remove the files stored there.
Before deleting anything, verify the mount and inspect the host directory. World files should be visible below the VPS project directory, not only inside the container. Keep these items on persistent storage:
- The
Worldsdirectory and every world file. serverconfig.txtand other server configuration.- The
Modsdirectory for tModLoader. enabled.jsonand mod metadata used to reproduce the enabled set.- Ban lists, permissions, TShock data when applicable, and any image-specific persistent files.
Never use docker system prune as a substitute for a backup. Pruning removes unused Docker objects, while your world’s safety depends on an independently stored copy of the host data.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #3
- 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)
Run tModLoader reliably
Align the server and every client
All players must use the compatible tModLoader build and the same enabled mod set. A client with one additional mod, a different version, or a different tModLoader build may fail during connection or produce world and gameplay errors. Record the enabled set in the persistent Mods data and distribute the same set to players before inviting them.
Fix UID/GID problems before first boot
The mounted tModLoader folder must be owned by the UID and GID configured in Compose. If the container runs as one numeric identity but the host files belong to another, the process may be unable to create worlds, update mods, or write logs. Apply a recursive ownership change to the mounted directory, then restart the service:
sudo chown -R UID:GID ~/terraria-server/data
docker compose up -d
Replace UID:GID with the values required by your selected image. Do not blindly use root ownership if the image is designed to run as an unprivileged user.
Pin the tModLoader release
An unqualified rolling tag can change when the container is recreated. Pin a specific image tag or release when the server’s stability matters. Change that pin deliberately, back up the world first, rebuild, and test a player connection before removing the backup.
Back up worlds before upgrades
Back up the persistent world directory before changing the Docker image, Terraria or tModLoader build, or enabled mod set. A simple archive from the project directory is:
tar czf backup-$(date +%F).tar.gz data/tModLoader/Worlds
Adjust the path if your image stores worlds elsewhere. Keep the archive outside the live container and preferably on a different system or storage service. Periodically test restoration by extracting a copy into a separate directory; an archive that has never been restored is only an assumption of recoverability.
Update deliberately
- Announce a maintenance window and stop new players from joining.
- Create and verify a world backup.
- Change the pinned image or tModLoader release in Compose.
- Rebuild as directed by the image or official tModLoader documentation:
docker compose build. - Recreate or start the service with
docker compose up -d. - Follow
docker compose logs -funtil startup completes and check for mod-loading errors. - Connect with a test client. Keep the previous backup until the world and mod set have been verified.
Rebuilding updates the image; it does not update files that live in the persistent bind mount unless the image’s documented startup process explicitly does so.
Rank #4
- 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
Restart behavior and routine operations
Use restart: unless-stopped for a service that should return after a VPS reboot but remain stopped when an administrator intentionally stops it. Some tModLoader examples use restart: always. Choose the policy that matches the image’s shutdown behavior and your maintenance workflow.
Useful routine commands from the project directory include:
docker compose ps— show whether the service is running or restarting.docker compose logs -f— follow startup, shutdown, and mod errors.docker compose restart— restart without changing the image definition.docker compose down— remove the Compose-managed container and network while retaining the bind-mounted host data.docker compose up -d— create or start the service from the current Compose definition.docker exec -it <container-name> <command>— run a command inside a running container when supported by the image.
Replace the container-name and command values with the actual names shown by docker compose ps; keep variable syntax inside the command rather than copying the angle brackets literally.
Troubleshoot connection and startup failures in order
1. The container is not healthy
Run docker compose ps and docker compose logs -f. An exited process, invalid environment variable, missing configuration file, failed world path, or permission error must be fixed before network testing is meaningful.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems2. The port is not published or the server is not listening
Confirm the Compose entry is exactly 7777:7777/tcp and that the server log reports listening on 7777. A container can be running while the game process has failed, so check both Docker’s mapping and the application log.
3. One of the firewalls is blocking traffic
Check the Linux VPS firewall and the provider’s cloud firewall or security group independently. Allow inbound TCP 7777 in both. This two-firewall failure is a frequent reason a server appears healthy locally but cannot be reached by friends.
4. The address or client mode is wrong
Verify that players are using the VPS public IP and port 7777. A vanilla server requires the vanilla Terraria client; a tModLoader server requires the tModLoader client. Do not use a private address from Docker, localhost, or an old VPS address.
Best Value
- 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.
5. tModLoader versions or mods differ
Compare the server’s tModLoader build and enabled mod list with every player’s client. Temporarily disable a newly added mod only after backing up the world, then inspect logs for the first reported dependency or version error.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match6. Worlds or mods are missing
Inspect the host-side data directory and verify that the volume points to the path you populated. Check recursive ownership against the container UID/GID. If files exist only inside the old container, copy them to the persistent host directory before recreating anything.
Security and maintenance checklist
- Use SSH keys or another strong SSH policy and keep SSH reachable during firewall changes.
- Expose TCP 7777 and SSH only; do not publish Docker’s management socket or unrelated services.
- Keep the Compose file, image tag, enabled mods, and backup dates documented.
- Back up before every image, tModLoader, Terraria, or mod-set change.
- Store at least one backup away from the VPS and test a restore periodically.
- Review logs after reboots and updates, especially when the restart policy automatically starts the container.
- Pin versions when predictable behavior matters, and schedule upgrades rather than allowing an unqualified image tag to change unexpectedly.
Vanilla or tModLoader: which deployment fits?
Choose vanilla when the group wants the standard game and the fewest moving parts. Choose tModLoader when mods are the reason for hosting the server and everyone can coordinate the same client build and enabled set. In both cases, the non-negotiable infrastructure is identical: a public Linux VPS, Docker Compose, persistent host storage, TCP 7777 permitted through every firewall, and tested backups.
Frequently Asked Questions
Can I run the server without Docker Compose?
Yes, Docker can run a container directly, but Compose keeps the port mapping, volume, restart policy, image pin, and environment settings in one reproducible definition. That makes deliberate rebuilds and recovery easier.
Will deleting the container delete my Terraria world?
Not when the world is stored in the host directory used by the bind mount. Verify that the world is below the mounted path and maintain an independent backup before removing containers.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Why can I connect locally but not from outside the VPS?
The usual cause is an unopened firewall layer. Confirm TCP 7777 in Docker, the Linux host firewall, and the provider cloud firewall, then verify that the client uses the VPS public IP.
Quick Recap
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.




