Host a shared game server
ActivitiesProjects
Run a server for a multiplayer game and verify that two invited players can enter the same world.
Hosting a shared game server means running a game world that other people can join and reshape alongside you, whether for one evening or across months of drop-in play. Using Luanti (formerly Minetest) as a concrete example shows how the pieces fit together. Because Luanti is a platform for multiple voxel games rather than a single fixed title, the first choice is picking the game and world you want to run; many of its games center on mining, building, and creative sandbox play, and your selection determines both the rules and which modifications work. One welcome detail for guests is that server-provided mods download automatically during connection, so friends do not have to hunt down and install matching mod packs before joining.
Temporary sessions versus a dedicated server
How you host depends on whether the world only needs to exist while you are playing. Luanti's main-menu Host Server option handles a temporary session for a couple of friends without extra setup. If you want a persistent world that stays online independently of your active game client, you run a dedicated server.
Dedicated hosting comes down to three tradeoffs:
- A home machine can be inexpensive if you already have the hardware and internet connection, aside from added power cost, but opening it to the internet exposes your home IP address.
- A paid virtual private server (VPS) gives you full control over configuration, updates, and mods for a recurring fee.
- A managed hosting service handles setup and routine maintenance for you, trading away direct control over the underlying machine.
For a dedicated setup, one documented Luanti option is running the server in a container with Docker Compose. Its example layout maps UDP port 30000 and mounts separate directories for configuration (`minetest.conf`), persistent world data, games, and mods. Preparing those directories, setting ownership on the data folder, supplying `minetest.conf`, and installing a game all happen before the container starts, and command-line flags can point the server at a specific game and world.
Getting players into the world
Networking depends on where your players sit. Anyone on the same local network connects using the server's internal IP address, with no router port forwarding needed. Inviting people over the internet to a home-hosted server requires forwarding the chosen UDP port—UDP 30000 by default in Luanti—on your router to the host computer and allowing that port through the computer's firewall. If your internet provider uses carrier-grade NAT (CGNAT), direct public hosting from home will be blocked, and you will need a different hosting or networking setup.
To join, players enter the server address and port in the Join Game tab, which works even when the server is not listed publicly. Each player registers a username and password on that specific server and uses those credentials on return visits. Accounts do not carry across servers, and there is no automatic lost-password recovery, so players should set a password and avoid reusing passwords from other servers.
Public visibility and access control are separate switches. Adding `server_announce = true` to `minetest.conf` and restarting the server publishes it to the public server list. Leaving that setting off keeps the server unlisted, though being unlisted alone will likely not stop someone who has the address and port from connecting; for a private group, add a whitelist mod to restrict who can enter.
Protecting builds and backing up the world
Opening a world to multiple players introduces the risk of damaged builds, spam, and harassment. Clear rules, active moderation, and area-protection mods—which let players claim zones where only the owner can add or remove blocks—help reduce those problems. Be cautious with permissions as well: because player names are not reserved across different servers, never grant privileges solely because a familiar username logs in.
Luanti includes engine rollback recording that can trace and revert some player actions, but it cannot undo every kind of change made by mods, so it is no substitute for regular backups. Always back up the world folder before installing new mods, since mods can alter world data in unexpected ways. On the default SQLite database backend, copying database files while the server is actively writing to them can corrupt the backup. Stop the server first for a consistent cold backup, or use SQLite's `VACUUM INTO` command to capture a transactional live snapshot—and be sure to copy world text files and any extra files written by mods, adjusting the method if you switch to a different database backend.
