# How to Install SteamCMD on Linux for a Game Server (Ubuntu and Debian)

Install SteamCMD on Ubuntu or Debian, add the 32 bit libraries, create a steam user, download a dedicated server and run it as a systemd service.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-install-steamcmd-on-linux

To install SteamCMD on Ubuntu, enable the multiverse repository and 32 bit packages, then install the `steamcmd` package: `sudo add-apt-repository multiverse`, `sudo dpkg --add-architecture i386`, `sudo apt update`, `sudo apt install steamcmd`. On Debian you enable the `non-free` component instead. You can also skip the package and download Valve's tarball into a folder owned by a dedicated `steam` user, which is what most admins do because it keeps everything in one place. This guide covers both, then installs a real server and runs it as a service.

## What you need

- A 64 bit Ubuntu (22.04 or newer) or Debian (12 or newer) machine.
- A user with sudo rights.
- Enough disk for the game: small servers need a few GB, big ones like Rust or ARK need tens of GB plus room for updates.
- The dedicated server's app ID, for example 896660 for Valheim or 258550 for Rust.

## Step 1: create a user for game servers

Never run SteamCMD or a game server as root. Make a dedicated user:

```bash
sudo useradd -m -s /bin/bash steam
sudo passwd steam
```

Everything from here on runs as that user unless it says sudo.

## Step 2a: install from the package (Ubuntu)

```bash
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd
```

You must accept the Steam license during install. The binary lands at `/usr/games/steamcmd`. Run it once as the steam user so it updates itself:

```bash
sudo -iu steam
/usr/games/steamcmd +quit
```

## Step 2b: install from the package (Debian)

Add `contrib non-free` to the components in `/etc/apt/sources.list` (or the `Components:` line in `/etc/apt/sources.list.d/debian.sources` on newer releases), then:

```bash
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd
```

## Step 2c: manual install (any distro)

This is the method Valve documents and it avoids distro packaging differences. Install the 32 bit C library first:

```bash
sudo apt install lib32gcc-s1 curl
```

On older releases the package is called `lib32gcc1`. On Fedora or RHEL style systems, install `glibc.i686` and `libstdc++.i686` instead.

Then, as the steam user:

```bash
mkdir ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
./steamcmd.sh +quit
```

The first run downloads updates for SteamCMD itself and ends at a prompt or exits. That is normal.

## Step 3: download a dedicated server

Here is Valheim as an example. Note that `force_install_dir` comes before the login, as current SteamCMD expects:

```bash
~/steamcmd/steamcmd.sh +force_install_dir /home/steam/valheim +login anonymous +app_update 896660 validate +quit
```

When it finishes you see `Success! App '896660' fully installed.` Most servers allow anonymous login. A few, like DayZ, need a real Steam account: see [anonymous login vs owned games](https://gamezservers.com/guides/steamcmd-anonymous-login-vs-owned-games).

If it fails, the state code tells you why: [0x202](https://gamezservers.com/guides/steamcmd-error-0x202-not-enough-disk-space) is disk space, [0x402](https://gamezservers.com/guides/steamcmd-error-0x402-after-update-job) is the connection, and "No subscription" is usually the wrong app ID.

## Step 4: fix the steamclient.so link

Many servers load Steam's client library from `~/.steam/sdk64/steamclient.so` and fail to start without it. Create the links once:

```bash
mkdir -p ~/.steam/sdk64 ~/.steam/sdk32
ln -sf ~/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
ln -sf ~/steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so
```

If you installed the Ubuntu package, the files live under `~/.local/share/Steam/steamcmd/` instead. Our guide on [steamclient.so errors](https://gamezservers.com/guides/steamclient-so-not-found-linux-server-fix) has the details.

## Step 5: open the firewall

If you use `ufw`, allow the game's ports. Valheim uses UDP 2456 and 2457:

```bash
sudo ufw allow 2456:2457/udp
```

Check your game's port list. On a home connection you also need to forward the same ports on your router: see [how to port forward a game server](https://gamezservers.com/guides/how-to-port-forward-a-game-server).

## Step 6: run it as a service

A systemd service starts the server at boot and restarts it after a crash. Create `/etc/systemd/system/valheim.service` with sudo:

```ini
[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
ExecStartPre=/home/steam/steamcmd/steamcmd.sh +force_install_dir /home/steam/valheim +login anonymous +app_update 896660 +quit
ExecStart=/home/steam/valheim/valheim_server.x86_64 -name "My Server" -port 2456 -world "Dedicated" -password "changeme1" -public 1
Restart=on-failure
RestartSec=30
KillSignal=SIGINT
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target
```

Then:

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now valheim
journalctl -u valheim -f
```

The `ExecStartPre` line updates the server on every start. `KillSignal=SIGINT` lets Valheim save cleanly on stop, and `RestartSec=30` stops a broken server from restarting so fast that it floods logs or Steam logins. If it loops anyway, see [game server stuck in a crash loop](https://gamezservers.com/guides/game-server-stuck-in-a-crash-loop).

## Updating later

When the game patches, players on the new version cannot join an old server. With the `ExecStartPre` line above, a restart is all it takes: `sudo systemctl restart valheim`. Without it, stop the server, run the same `app_update` command you used to install (leave out `validate` for routine updates, it only slows things down), and start it again. Our guide to [app_update validate](https://gamezservers.com/guides/steamcmd-app-update-validate-explained) explains when the extra check is worth it.

## Running more than one server

Give every server its own install folder, its own service file and its own ports. Sharing one install folder between two servers causes locked files and half finished updates, and two servers on the same default ports will fight over them. A sensible layout is one folder per server under `/home/steam`, for example `/home/steam/valheim-main` and `/home/steam/valheim-test`, each with its own `-port` value spaced at least two apart, since Valheim also uses the next port up for queries.

## Step 7: keep it tidy

- Back up the world folder on a schedule. For Valheim it is `~/.config/unity3d/IronGate/Valheim/worlds_local`.
- Watch disk space, since updates need extra room.
- Read the logs after every update, before players report problems.

![A Valheim longship at sea, a game whose server installs cleanly with SteamCMD on Linux](https://gamezservers.com/games/valheim/shot-3.jpg)

## Skip the Linux admin work

Setting up SteamCMD is the easy part. Keeping the box patched, backed up and online every day is the real work. A [GamezServers server](https://gamezservers.com/games/valheim) is live within about a minute of paying for most games, with the game installed, a live console, file manager and SFTP, one click backups and DDoS protection. If your friends chip in, you can [split the bill](https://gamezservers.com/split-the-bill-game-server-hosting) with up to 10 of them.

## FAQ

### What is the command to install SteamCMD on Ubuntu?

`sudo add-apt-repository multiverse`, `sudo dpkg --add-architecture i386`, `sudo apt update`, then `sudo apt install steamcmd`. The binary is `/usr/games/steamcmd`.

### Why does SteamCMD need 32 bit libraries?

SteamCMD itself is a 32 bit program. Without packages like `lib32gcc-s1`, it fails to start with missing library errors, even on a 64 bit system.

### Should I install SteamCMD as root?

No. Install and run it as a normal user that owns the server files. Root owned files break later updates and running servers as root is a security risk.

### Where does SteamCMD put the server files?

Wherever you point `+force_install_dir`. Without it, files go under SteamCMD's own `steamapps/common` folder, which is easy to lose track of.
