SteamCMD Setup

Last Edit: 2024.01.21

Debian / Ubuntu

Fedora / Rocky / RHEL

Overview

Setup SteamCMD to install Steam games on a Linux box.

Assumptions

Update

Before getting started, update package repositories. Consider upgrading them as well for the latest patches.

# Debian
sudo apt update
sudo apt upgrade
# Fedora
sudo dnf check-update
sudo dnf upgrade

Install Dependencies

Install the required package dependencies for SteamCMD based on the system distribution.

For Debian systems, install the lib32gcc-s1 package.

# Debian
sudo apt install lib32gcc-s1

On Fedora systems, install the glibc.i686 and libstdc++.i686 packages.

# Fedora
sudo dnf install glibc.i686 libstdc++.i686

Create System User

Add a new system user for the Steam application and map the home directory to /opt/steam.

sudo useradd --system --user-group --create-home --home /opt/steam --shell /bin/bash steam

The new user can be switched to using su.

sudo su - steam

Install SteamCMD

Switch over to the created Steam user. All the steps in this section should be executed as the steam user.

Create a new cmd directory in /opt/steam to store the SteamCMD files.

mkdir /opt/steam/cmd

Download SteamCMD to the /opt/steam/cmd directory.

wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz --directory-prefix /opt/steam/cmd

Extract the downloaded file to the /opt/steam/cmd directory.

tar -xvf /opt/steam/cmd/steamcmd_linux.tar.gz -C /opt/steam/cmd

Permissions

Assign basic permissions to the SteamCMD application.

Make the steam user and group the owner of the cmd directory.

chown -R steam:steam /opt/steam/cmd

Remove all permissions from other users.

chmod -R o-rwx /opt/steam/cmd

Verify the steamcmd.sh file has execute permissions.

chmod u+x /opt/steam/cmd/steamcmd.sh

Launch

Launch the extracted steamcmd.sh script.

/opt/steam/cmd/steamcmd.sh

Commands can be entered after the Steam> line appears on screen. Enter the quit command to exit SteamCMD.

# Sample Output
Redirecting stderr to '/opt/steam/Steam/logs/stderr.txt'
ILocalize::AddFile() failed to load file "public/steambootstrapper_english.txt".
[  0%] Checking for available update...
[----] Downloading update (0 of 53847 KB)...
[100%] Download Complete.
[----] Applying update...
[----] Extracting package...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching...
max open descriptors set to 2048
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/opt/steam/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
max open descriptors set to 2048
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/opt/steam/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1642451655
-- type 'quit' to exit --
Loading Steam API...OK

Steam> quit

Command Alias

To avoid having to enter the full path to the script each time SteamCMD is launched, create a command alias.

Logged in as the steam user, create or modify the .bashrc file in the /opt/steam directory.

nano /opt/steam/.bashrc

Add an alias for steamcmd with the value being the path to the installed steamcmd.sh file.

alias steamcmd='/opt/steam/cmd/steamcmd.sh'

Steam can now be launched as the steam user with the command steamcmd.

steamcmd

When logged in as the administrative user, SteamCMD can now be launched quickly using the sudo command.

sudo -u steam steamcmd

Usage

Refer to the SteamCMD documentation for full usage information.

Login

Login as an anonymous user, or with an existing Steam account. Most game server applications can be installed via the anonymous user, don’t use a Steam account unless required.

Steam> login anonymous

Errors

SDL

An error message may be logged stating “Warning: failed to init SDL thread priority manager: SDL not found”.

If you are running a headless server, this error can be ignored. The error appears due to the lack of the SDL package libsdl2-2.0-0 or libsdl2-2.0-0:i386. Install this package if the system has a GUI.

# Debian
sudo apt install libsdl2-2.0-0
# Fedora
sudo dnf install SDL2

References

1 2 3


  1. Valve Developer Community. “Steam.” 2024. ↩︎

  2. Valve Developer Community. “SteamCMD.” 2024. ↩︎

  3. SDL Wiki. “Simple DirectMedia Layer 2.0.” 2024. ↩︎