Guideschevron_rightServers

Servers · 8 min read · Updated

How to Host a Valheim Dedicated Server on a VPS

To host a Valheim dedicated server on a VPS, install SteamCMD on Ubuntu, download Valheim Dedicated Server (Steam app 896660) as its own user, run valheim_server.x86_64 with your server name, world name and password, open UDP ports 2456–2457, and run it as a systemd service so it saves cleanly and restarts with the server. A world for a group of friends fits on a small VPS such as our Bronze plan (6 GB, $37.50 a month).

1. Install SteamCMD and the Libraries

On Ubuntu 24.04, after securing the server. Accept Steam's licence when asked; the last three packages are the ones Iron Gate lists for the Linux server:

sudo add-apt-repository -y multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y steamcmd libatomic1 libpulse0 libpulse-dev
sudo useradd -m -s /bin/bash steam

2. Download the Server

sudo -u steam -i
/usr/games/steamcmd +force_install_dir /home/steam/valheim +login anonymous +app_update 896660 validate +quit

The server comes with a start_server.sh to edit, but a service file (next step) is easier to keep running. Try it by hand first, replacing the name, world and password:

cd ~/valheim
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
./valheim_server.x86_64 -name "My Valheim Server" -port 2456 -world "Dedicated" -password "longsecret" -public 0

Wait for the log to show the server has started, then press Ctrl+C to stop it, which saves the world. -public 0 keeps it out of the community server list; use -public 1 to list it.

3. Run It as a Service

Back as a user with sudo, create /etc/systemd/system/valheim.service:

[Unit]
Description=Valheim dedicated server
After=network-online.target
Wants=network-online.target

[Service]
User=steam
WorkingDirectory=/home/steam/valheim
Environment=LD_LIBRARY_PATH=/home/steam/valheim/linux64
Environment=SteamAppId=892970
ExecStartPre=-/usr/games/steamcmd +force_install_dir /home/steam/valheim +login anonymous +app_update 896660 +quit
ExecStart=/home/steam/valheim/valheim_server.x86_64 -name "My Valheim Server" -port 2456 -world "Dedicated" -password "longsecret" -public 0 -backups 4
KillSignal=SIGINT
TimeoutStopSec=60
Restart=on-failure
RestartSec=10
TimeoutStartSec=600

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now valheim
journalctl -u valheim -f

KillSignal=SIGINT stops the server the way Ctrl+C does, so it saves before exiting. The ExecStartPre line fetches game updates on every start, so after a patch a restart is all it takes: sudo systemctl restart valheim.

4. Open the Ports and Join

sudo ufw allow 2456:2457/udp

If you turned on the firewall on your server's page in the dashboard, allow UDP 2456–2457 there too. In Valheim, choose Join Game, then Add Server, and enter 203.0.113.10:2456 (your server's address).

For friends on Xbox or Game Pass, add -crossplay to the start line. The server then joins through the crossplay service and shows a join code in its log, which players can enter instead of the address.

Worlds, Backups and Mods

  • Where worlds live: under ~/.config/unity3d/IronGate/Valheim for the steam user, unless you pass -savedir. Copy that folder off the server on a schedule, to a storage box or with Borg.
  • Built-in backups: -backups 4 keeps four rolling copies, and -saveinterval 1800 sets how often the world saves, in seconds.
  • Mods: BepInEx-based mods run on the server too; every player needs the same mods and versions.

A server with memory to spare can run more than one game: Palworld and Minecraft set up the same way.

Common Questions

  • Which ports does a Valheim server need?

    UDP 2456 and 2457 by default: Valheim uses the port you set and the one after it. Open both in the server's firewall. With -crossplay, players join through the crossplay service instead and you can share a join code.

  • How much memory does a Valheim server need?

    Iron Gate does not publish a figure. A world for a group of friends usually runs in a few gigabytes, growing as the world is explored and built on. Start with a small plan, watch free -h while people play, and resize if memory runs short.

  • Why does the server refuse my password?

    Valheim wants a password of at least five characters that does not contain the server's name. Change one of them in the start command and start again.

  • Can I move my existing world to the server?

    Yes. Copy the world's .db and .fwl files from your PC's worlds_local folder into the server's worlds_local folder, and start the server with -world set to the same name.

Plans and prices

VPS Plans

KVM servers with NVMe storage and full root access in Ashburn and Dallas, built in minutes.

See all plans
  • Bronze

    3 vCPU · 6 GB RAM · 75 GB NVMe

    2 TB transfer

    $37.50/mo

    Configure inAshburnDallas
  • Silver

    4 vCPU · 8 GB RAM · 100 GB NVMe

    4 TB transfer

    $46.50/mo

    Configure inAshburnDallas
  • Gold

    6 vCPU · 12 GB RAM · 150 GB NVMe

    6 TB transfer

    $60.00/mo

    Configure inAshburnDallas
  • Diamond

    8 vCPU · 16 GB RAM · 200 GB NVMe

    8 TB transfer

    $73.50/mo

    Configure inAshburnDallas

Network port: 10 Gbps in Ashburn, VA, 50 Gbps in Dallas, TX. Pick the location when you configure.

Keep Reading

All guides