Install a Valheim Dedicated Server on Ubuntu Without Docker
Running the Valheim dedicated server natively on Ubuntu is straightforward: create a user for
it, pull the free server package with SteamCMD, write a small start script, open UDP
2456–2458, and hand it to systemd so it survives reboots. This is a good fit if you’d rather
see the files directly than manage a container, or if Docker isn’t available on the machine.
The steps below assume a current Ubuntu LTS release and sudo access.
Step 1: Create a user for the server
Never run a network-facing game server as root or as your own login. A dedicated system user keeps the install, the world files, and the service boundary tidy:
sudo adduser --disabled-password --gecos "" valheim
sudo -iu valheim
Everything below happens as that user unless a command starts with sudo. The home directory
/home/valheim becomes the root of the whole setup.
Step 2: Install SteamCMD and its dependencies
SteamCMD is Valve’s command-line downloader. On Ubuntu it lives in the multiverse component and shows an interactive licence prompt on install:
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd
The i386 architecture line matters: SteamCMD itself is 32-bit and will fail on a pure
64-bit system with a confusing “no such file” error. If apt pulls in a set of lib32
packages, that’s expected and correct.
Step 3: Download the dedicated server
The server has its own App ID, 896660, and it’s free, so an anonymous login is all you need. The game’s own ID (892970) is not what you want here.
steamcmd +force_install_dir /home/valheim/server +login anonymous +app_update 896660 validate +quit
Keep +force_install_dir before +login — SteamCMD processes arguments in order, and a
directory set afterwards is ignored, which quietly installs to its default path instead.
When it finishes, /home/valheim/server holds the Linux server binary and the start script
that ships with the package. More on SteamCMD’s quirks in
SteamCMD for Valheim: What It Is and How to Use It.
Step 4: Write your own start script
The bundled start script is a useful reference, but don’t edit it — an update overwrites it.
Copy the launch line into your own file, /home/valheim/start-valheim.sh, so your settings
survive patching:
#!/usr/bin/env bash
set -euo pipefail
cd /home/valheim/server
export LD_LIBRARY_PATH="/home/valheim/server/linux64:${LD_LIBRARY_PATH:-}"
export SteamAppId=892970
./valheim_server.x86_64 \
-nographics -batchmode \
-name "My Viking World" \
-port 2456 \
-world "Midgard" \
-password "longboat" \
-public 1
Make it executable:
chmod +x /home/valheim/start-valheim.sh
Three details worth understanding rather than copying blindly:
LD_LIBRARY_PATHandSteamAppIdcome from the bundled script. The server needs the libraries shipped alongside it and the game’s app ID present in its environment. Rather than trusting the values above forever, open the start script that came with your install and confirm they still match — this is exactly the kind of thing that shifts between builds.-nographics -batchmoderun it headless, with no window and no rendering.- The password rules are enforced at launch. It must be at least five characters and must not appear inside the server name, or the process refuses to start.
Other launch options — the world name, port, whether it’s publicly listed, crossplay, world modifiers — are covered in Valheim Server Configuration: Every Setting That Matters.
Step 5: First launch
Run it in the foreground once so you can read the output:
/home/valheim/start-valheim.sh
The first boot generates the world, which takes a while — be patient rather than assuming
it’s hung. When the log reports the world loaded and the game server connected, it’s live.
Stop it with Ctrl+C and let it save cleanly before moving on.
Step 6: Open the ports
Valheim uses UDP: your game port plus the one above it for queries.
sudo ufw allow OpenSSH
sudo ufw allow 2456:2458/udp
sudo ufw enable
Allow SSH before enabling the firewall on a remote machine, or you’ll lock yourself out. For home hosting you also need matching UDP forwards on the router — see How to Port Forward a Valheim Server. On a VPS, remember the provider’s own cloud firewall is a second, separate place to open the same range.
Step 7: Make it a service
A script you launched over SSH dies when the session ends. Hand it to systemd so it starts at boot and restarts after a crash — unit file, the shutdown-signal detail that protects your world, and log commands are all in Run a Valheim Server as a systemd Service.
Where the files live
The server writes its data under the Valheim data directory in the service user’s home:
/home/valheim/.config/unity3d/IronGate/Valheim/
Inside it:
worlds_local/—Midgard.db(the world) andMidgard.fwl(metadata and seed), plus.oldrollback copies from the previous save.adminlist.txt,permittedlist.txt,bannedlist.txt— one SteamID64 per line, for admins, an allow-list, and bans respectively.
Note that these are under the service user’s home, not the install directory. That trips
people up when they go looking for the world next to the binary, and it matters if you change
which user runs the service. Back up worlds_local on a schedule — it’s the only part you
can’t re-download.
Keeping it healthy
- Update after every game patch by re-running the Step 3 command with the server stopped, then starting it again. Clients auto-update; the server doesn’t.
- Back up off the machine, not just onto it: Essential Valheim Admin Commands and Automated Backups.
- Watch the first busy session with
topandfree -hto see whether the box is sized right: How to Size Hardware for a Valheim Dedicated Server.
That’s the whole native install — user, SteamCMD, script, ports, service. Nothing hidden, and every file where you can see it.