The reliable pattern is a Linux VPS running Docker Compose, with Terraria’s data bind-mounted to the host and TCP port 7777 opened in every firewall layer. Use a vanilla image for an unmodded server or a pinned tModLoader image for mods; keep Worlds, configuration, and mod files outside the disposable container layer.
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 both variants, unattended startup, persistent saves, UID/GID permissions, updates, backups, and the fastest way to diagnose connection failures.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
What the finished setup looks like
A VPS supplies a public IP address and stays online when your home computer is off. Docker packages the dedicated server and its dependencies, while Compose records the port, storage mount, and restart policy in one file. If the container is replaced, the game state remains on the VPS because the important files live in a host directory.
Clients connect to the VPS public IP on Terraria’s documented server port, TCP 7777. That traffic must be allowed by Docker’s port publishing, the VPS operating-system firewall, and any provider-level cloud firewall or security group.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
- Vanilla Terraria: choose this when every player uses the unmodded game.
- tModLoader: choose this when the server runs mods. Every player must use a compatible tModLoader build and the same enabled mod set.
- Persistent storage: mount a host directory containing Worlds,
serverconfig.txt, Mods,enabled.json, bans, and any other files your selected image documents. - Controlled updates: pin an image or tModLoader release, back up first, then rebuild deliberately.
Prerequisites on the VPS
Choose a suitable Linux host
Use a Linux VPS or data-center virtual server with a public IPv4 address (or the address family your players will use), root or sudo access, and enough CPU, memory, and disk for your world and mod set. A universal CPU or RAM minimum is not specified; workload, view distance, player count, and mods determine the requirement. Leave free disk space for world growth, logs, and more than one backup archive.
Ubuntu, Debian, and other mainstream distributions with current Docker packages are practical choices. Apply operating-system updates before installing the server, and keep SSH available so you do not lock yourself out while configuring a firewall.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Install Docker and verify Compose V2
Install Docker Engine and the Compose plugin using your distribution’s supported package instructions. Then verify both commands:
docker --version
docker compose version
The second command must work with a space between docker and compose; this is Compose V2 syntax. If your installation only provides the older hyphenated docker-compose command, install the Compose V2 plugin before continuing so the commands in this guide match the documented tModLoader workflow.
Choose vanilla Terraria or tModLoader
Vanilla server
A vanilla image is the simpler option when no mods are required. Players connect using the ordinary Terraria client, and the server’s world and configuration files are stored in the mounted data directory. Select a project that documents its data path, startup variables, and supported CPU architectures.
tModLoader server
tModLoader adds a separate server build and a mod directory. The server and every client need compatible tModLoader versions and an identical enabled mod list. A player with a different mod version, a missing mod, or an extra enabled mod can be rejected even when the network is configured correctly.
The official tModLoader Dedicated Server Utils documentation describes downloading its Dockerfile and Compose file, setting the container UID and GID to match the mounted files, starting with docker compose up -d, attaching to the console, and rebuilding with docker compose build when updating tModLoader. Follow the selected project’s documented data path rather than assuming that a vanilla and tModLoader image use the same internal directory.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Pin the release
Use a specific image tag or release instead of an unqualified rolling tag when a stable world matters. A rolling tag can change the server or mod-loader version during a rebuild and introduce compatibility or save risks. Record the tag in your Compose file and change it intentionally after making a backup.
Create a persistent project directory
Keep the Compose file, optional Dockerfile, environment file, and game data together in a directory owned by the account that will operate the server:
mkdir -p ~/terraria-server/data
cd ~/terraria-server
touch docker-compose.yml
A practical layout is:
terraria-server/
├── docker-compose.yml
├── Dockerfile # only when the selected project requires one
├── .env # secrets or project-specific variables
└── data/
├── Worlds/
├── Mods/ # tModLoader servers
├── enabled.json # tModLoader servers
└── serverconfig.txt
Directory names vary by image. Some projects place the files directly under /data; others use a nested tModLoader directory. Read the image documentation and mount the host directory to the path that the image actually reads.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteWrite the Compose service
The essential Compose shape is below. Replace your-pinned-image:version with the exact image and tag documented by your chosen project, and adjust the internal path only if that project specifies another one.
services:
terraria:
image: your-pinned-image:version
container_name: terraria
ports:
- "7777:7777/tcp"
volumes:
- ./data:/data
restart: unless-stopped
7777:7777/tcp maps the VPS’s TCP port 7777 to TCP 7777 inside the container. The bind mount makes ./data on the VPS the durable location for worlds and configuration. restart: unless-stopped starts the service again after a Docker or VPS restart, while still allowing you to stop it deliberately.
Some tModLoader projects provide a Dockerfile rather than a ready-made image. In that case, place the supplied Dockerfile beside Compose and use the project’s documented build: section instead of inventing an image name. Do not mix environment-variable names or data paths from different projects.
Configure unattended startup
A server configuration file lets the process start without an interactive menu. Create serverconfig.txt in the mounted location expected by the image and point the service at it using the image’s documented variable or command option. The exact variable name is project-specific, so copy it from that project’s instructions.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
At minimum, the configuration normally identifies the world to load and the network port. Keep the file on the host, not only inside the container. If you recreate the container without a host copy, the server can appear to start with a new world or default settings.
Fix ownership before starting tModLoader
The official tModLoader Docker instructions require the files in the mounted tModLoader directory to have the same numeric UID and GID configured for the container. A mismatch commonly produces missing worlds, unwritable Mods directories, or a server that exits during startup.
First inspect the owner of the data directory and the UID/GID expected by the Compose file or project documentation:
stat -c '%u:%g %n' data
id
Then apply the documented UID and GID recursively. For example, if the project instructs you to run as UID 1000 and GID 1000:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallsudo chown -R 1000:1000 data
Use the values required by your image, not the example numbers. Recheck with stat after the change. Avoid running the whole container as root merely to hide an ownership problem; correcting the host files is safer and makes future updates predictable.
Start the server and confirm it is healthy
- From the directory containing
docker-compose.yml, validate and start the service in detached mode:docker compose up -d - Check whether the container is running:
docker compose ps - Follow startup output until the server reports that it has loaded the world and is listening:
docker compose logs -f - If the image exposes a console, attach using the documented method, commonly:
docker attach terrariaDetach without stopping the process using the Docker detach sequence documented for your client. Do not press the terminal’s ordinary interrupt key unless you intend to stop the server.
- Use
docker execfor image-supported administrative commands or to inspect files. The exact command syntax is image-specific; check its documentation rather than assuming that a vanilla command works on tModLoader.
If the container exits, run docker compose logs --tail=200 and correct the first configuration or permission error shown. Repeatedly restarting a failing container can obscure the original message.
Open TCP 7777 at every firewall layer
Docker publishing
Confirm that Compose reports the mapping and that the service is running:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
docker compose ps
You should see a published mapping equivalent to 0.0.0.0:7777->7777/tcp (the display can vary). If the mapping is absent, the client cannot reach the service regardless of VPS firewall settings.
VPS operating-system firewall
Keep SSH reachable before enabling a host firewall. With UFW, a typical sequence is:
sudo ufw allow 22/tcp
sudo ufw allow 7777/tcp
sudo ufw enable
sudo ufw status
If your distribution uses firewalld, nftables, or another firewall, create the equivalent inbound TCP 7777 rule and preserve your existing SSH rule. Restrict administrative access to SSH; do not expose Docker’s management socket or unrelated service ports publicly.
Provider cloud firewall or security group
Many VPS platforms apply a separate network policy outside the operating system. Add an inbound rule for TCP 7777 there as well, scoped to the public interface or source ranges you intend to allow. A missing provider rule is a common reason a server works locally on the VPS but not for friends on the internet.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Connect from Terraria
Use the VPS’s public IP address and port 7777 in the multiplayer screen. Do not enter the container’s private address. If the server is tModLoader-based, launch the compatible tModLoader client and make sure its enabled mods and versions match the server exactly.
Test from a separate network, such as a friend’s connection or a mobile hotspot, rather than relying only on a client running on the VPS. A successful local test does not prove that the provider firewall permits public traffic.
Keep worlds and mods when replacing the container
Container writable layers are disposable. The bind mount is what survives docker compose down, image replacement, and container recreation. Keep these items in the host-mounted directory:
Best Value
- World files and the containing
Worldsdirectory. serverconfig.txtand other startup configuration.- The tModLoader
Modsdirectory andenabled.json. - Ban lists, plugin or TShock data, and any image-specific configuration that the server needs.
Before removing or relocating the host directory, stop the service and verify its contents. A new empty directory mounted at the same path can make the server look as if the world disappeared even though the old files still exist elsewhere.
Back up before upgrades
Stop writes or stop the server before archiving a world so the archive is not taken during a save operation. A simple archive of the tModLoader worlds directory is:
cd ~/terraria-server
tar czf backup-$(date +%F).tar.gz data/tModLoader/Worlds
Use the actual path shown by your image; vanilla servers may store worlds directly under data/Worlds. Store the archive outside the live data directory or copy it to separate storage. Include configuration and mod metadata in a broader backup when you need a complete rebuild:
tar czf terraria-full-$(date +%F).tar.gz data
Keep multiple dated backups and periodically test restoring one into a temporary directory. A backup that has never been restored is only an assumption.
Update tModLoader or the image deliberately
- Announce maintenance and stop new connections.
- Create and verify a world backup.
- Record the current image tag, tModLoader build, enabled mod list, and Compose file.
- Change the image tag or Dockerfile version intentionally; avoid silently switching to a rolling tag.
- Rebuild when the project documents a build-based update:
docker compose build - Start the updated service:
docker compose up -d - Watch logs for startup completion, permission errors, and mod-loading failures:
docker compose logs -f - Connect with one test client before deleting the previous backup.
If the update fails, stop the service, restore the previous image or release pin, and restore the backed-up data only if the world was changed or damaged. Keep the failed version’s logs so you can identify whether the cause was the loader, a mod, ownership, or configuration.
Troubleshoot connection and startup failures in order
The container is stopped or repeatedly exits
- Run
docker compose psand inspectdocker compose logs -f. - Check the image tag, required environment variables, startup configuration, and mounted path.
- For tModLoader, correct UID/GID ownership and confirm the expected files are readable and writable.
Docker runs, but nobody can connect
- Confirm Compose publishes
7777:7777/tcp. - Confirm the server process is listening on port 7777 in the logs.
- Check the VPS host firewall for inbound TCP 7777.
- Check the provider cloud firewall or security group for the same rule.
- Verify that players are using the VPS public IP, not a private container address, and the correct port.
One player connects, but another cannot
Check that the second player is using the same public address and Terraria mode. For tModLoader, compare the loader build, enabled mod list, and mod versions with the server and with a working client. Network success for one client does not make incompatible mod sets valid for another.
The world or mods appear to be missing
- Inspect the host directory, not only the container’s writable layer.
- Confirm the Compose volume points to the directory containing the expected files.
- Check case-sensitive paths and the image’s documented internal data path.
- For tModLoader, verify UID/GID ownership and that
enabled.jsonand the Mods directory are present.
The server starts with the wrong world or defaults
Verify that serverconfig.txt is mounted and that the Compose command or environment variable actually points to it. A configuration file in a different host directory has no effect, even if its filename is correct.
Quick Recap
Operational checklist
- Use a pinned vanilla or tModLoader image tag.
- Keep all world, configuration, mod, and ban data on a host bind mount.
- Publish only TCP 7777 for gameplay and keep administration on SSH.
- Allow TCP 7777 in Docker, the VPS firewall, and the provider firewall.
- Set the documented UID/GID for mounted tModLoader files.
- Use a restart policy such as
unless-stoppedor the project’s documentedalwayspolicy. - Review logs after every start, rebuild, and mod change.
- Back up Worlds before changing the image, loader, or mod set.
- Test a restore and a real external connection before considering the deployment finished.
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.




