Play Valheim Online with Friends
The Problem
To connect friends to Valheim by IP address, you have to run the Valheim Dedicated Server. Valheim's in-game "Start Game" (host-and-play) session can only be joined through Steam friends or a crossplay join code—there's no reliable way to bring friends in by IP that way.
Normally, running a dedicated server means port forwarding your router (opening ports 2456-2457 to the internet) so friends can reach it—fiddly to set up, impossible behind CGNAT or strict firewalls, and it exposes your server to the whole internet.
The Solution
MoleTun creates a virtual LAN that connects you and your friends as if you're on the same network. One player runs the Valheim Dedicated Server on that LAN, and everyone else joins by the host's MoleTun IP—no port forwarding, no router config, and nothing exposed to the public internet.
Setup Guide
Everyone Installs MoleTun
Get MoleTun for Windows, macOS, or Linux. Installation takes less than a minute.
Create and Join a Room
The host clicks 'Create Room' and shares the 6-digit code with the Viking crew. Everyone else clicks 'Join Room' and enters the code. Now you're all on the same virtual LAN.
Install the Valheim Dedicated Server
On the host's machine, open Steam, tick Library → the 'Tools' checkbox, then install 'Valheim Dedicated Server'. It's a free download, separate from the game.
Configure and Start the Server
Edit the start script (start_server.sh on Linux, start_headless_server.bat on Windows) to set your server -name, -world, and -password. Add -public 0 to keep it private (joinable only via 'Join IP'). Run the script and wait until it prints 'Game server connected'. See the official dedicated server guide for the full option list.
Friends Connect by IP
In Valheim, click Join Game → Join IP, enter the host's MoleTun IP followed by the port (for example 10.x.x.x:2456), type the password, and connect.
Valheim-Specific Settings
- •Default ports: 2456-2457 (the server uses the port you set and port+1)
- •Use the default Steam backend—do not add
-crossplay. Crossplay servers can't be joined via a local/LAN IP, which is exactly what MoleTun provides. - •Set
-public 0so the server stays private and is reachable only via 'Join IP' over the MoleTun LAN - •The dedicated server can run on the host's gaming PC (in the background) or on a spare machine on the LAN
- •World saves live wherever the server runs (Linux:
~/.config/unity3d/IronGate/Valheim, Windows:AppData/LocalLow/IronGate/Valheim) - •All players must run the same game version; mods require identical setups on every client and the server
Pro Tips
- •The dedicated server must stay running for others to play—but no one has to be "in game" as the host, and the world keeps running even if the host's character logs off
- •You don't need a separate machine; run the server in the background on any PC that's on the MoleTun LAN
- •Always set a
-passwordin the start script for security - •Back up your world files regularly (found in the save directory above)
- •For long sessions, consider the Pro tier for extended room times
Because the dedicated server is separate from the game client, the world keeps ticking even when the person hosting it steps away from the keyboard—as long as their machine and MoleTun stay on. Whoever runs the server should have a stable connection.
Android Gaming
Valheim is a PC-exclusive game, but you can play it on Android using x86 emulators like Winlator. Combined with MoleTun, this enables Viking adventures on the go—just point Join IP at the host's dedicated server.
Do I really need the dedicated server?▼
Yes. To connect friends by IP over a virtual LAN, Valheim needs the dedicated server. The in-game 'Start Game' host option only supports Steam friends or crossplay join codes—not IP joining. The dedicated server is a free download in Steam's Tools section.
Can I use mods with MoleTun?▼
Yes! MoleTun works with modded Valheim. Every client and the dedicated server need the same mods installed, including Valheim Plus, BepInEx mods, and others.
How many players can join?▼
Free tier supports 3 players, Pro supports 8, Elite allows unlimited. Valheim itself supports up to 10 players per world.
What if the server goes offline?▼
If the machine running the dedicated server disconnects, players are dropped and the world stops, but everyone can rejoin once the server is back—the server saves world progress automatically.
Is there lag compared to a public server?▼
Your server runs on your own LAN with friends connecting directly over MoleTun—typically under 50ms latency for same-region players, with no third-party relay hops.
Ready to Play Valheim?
Download MoleTun and start playing in under a minute.
Download MoleTun