SteamCMD

Category:Dedicated ServerCategory:Steam Applications
The Steam Console Client or SteamCMD is a command-line version of the Steam Client. Its primary use is to install and update various dedicated servers available on Steam using a command-line interface.
It works with games that use the SteamPipe content system.
== Downloading SteamCMD ==
=== ===
#Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
#Create a folder for SteamCMD. Example: 
#Extract the contents of the zip to the folder.
=== ===
Create a user account named steam to run SteamCMD safely, isolating it from the rest of the operating system.
1. As the root user, create the steam user:
 sudo useradd -m steam
 sudo passwd steam
2. Go into its home folder:
 sudo -u steam -s
 cd /home/steam
==== Package From Repositories ====
===== Ubuntu =====
To install SteamCMD the multiverse repository and x86 packages must be enabled.
 sudo add-apt-repository multiverse; sudo dpkg --add-architecture i386; sudo apt update
 sudo apt install steamcmd
===== Debian =====
To install SteamCMD add the non-free repository and x86 packages must be enabled. In Debian 12 (Bookworm) the apt-add-repository command no longer works, so you will need to create a work-around (See also: https://stackoverflow.com/questions/76688863/apt-add-repository-doesnt-work-on-debian-12).
 sudo apt update; sudo apt install software-properties-common; sudo apt-add-repository non-free; sudo dpkg --add-architecture i386; sudo apt update
 sudo apt install steamcmd
===== Enterprise Linux =====
===== Arch Linux =====
 git clone https://aur.archlinux.org/steamcmd.git
 cd steamcmd
 makepkg -si
Gentoo:
 emerge --ask games-server/steamcmd
==== Docker ====
If your server is running Docker, you can simply use:
docker run -it --name=steamcmd cm2network/steamcmd bash
steamcmd.sh is located at /home/steam/steamcmd.
This image can be used as a base image for Steam-based dedicated servers. 
Example: 
You can find the associated Docker Hub page here: 
==== Manually ====
1. Before you begin, you must first install the dependencies required to run SteamCMD:
Ubuntu/Debian (x86-64)
 sudo apt-get install lib32gcc-s1
Enterprise Linux (x86-64)
 yum install glibc.i686 libstdc++.i686
2. As the root user, escalate to the steam user:
 su - steam
If you're not logging in as root and you instead use to perform administration, escalate to the steam user as follows:
 sudo -iu steam
3. Create a directory for SteamCMD and switch to it:
 mkdir ~/Steam && cd ~/Steam
4. Download and extract SteamCMD for Linux:
 curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
=== === 
1. Open Terminal.app and create a directory for SteamCMD.
 mkdir ~/Steam && cd ~/Steam
2. Download and extract SteamCMD for macOS.
 curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_osx.tar.gz" | tar zxvf -
== Running SteamCMD ==
On first run, SteamCMD will automatically update and enter you into a Steam> prompt. Type help for more information.
=== === 
Open a Command Prompt and start SteamCMD.
 cd C:\steamcmd
 steamcmd
=== === 
Open a terminal and start SteamCMD.
If you installed it using the package from repositories:
 steamcmd
If you installed it manually:
 cd ~/Steam
 ./steamcmd.sh
=== === 
Open a terminal and start SteamCMD.
If you installed it using the package from repositories:
 cd ~
 steamcmd
If you installed it manually:
 cd ~/Steam
 ./steamcmd.sh
== SteamCMD Login ==
=== Anonymous ===
To download most game servers, you can login anonymously using 
=== With a Steam Account ===
Some servers require you to login with a Steam Account.
 login <username>
Next enter your password.
If Steam Guard is activated on the user account, check your e-mail for a Steam Guard access code and enter it. This is only required the first time you log in (as well as when you delete the files where SteamCMD stores the login information).
You should see a message stating that you have successfully logged in with your account.
== Downloading an App ==
1. Start SteamCMD, don't login just yet.
2. Set your app install directory. (Note: use forward slashes for Linux/macOS and backslashes for Windows.)
 force_install_dir <path>
e.g. a directory named cs_go inside the current directory:
 force_install_dir ./cs_go/
For Windows: force_install_dir c:\cs_go\
3. Login with the command
Valve recommends that you set the install dir before logging in.
4. Install or update the app using the command (supplying a Steam Application ID). Please check here for the dedicated server list: Dedicated server list. To also validate the app, add to the command. To download a beta branch, use the option – for example, the HLDS beta branch is named and the SrcDS beta branch is named . Some beta branches are protected by a password; to be able to download from them, also add the option.
 app_update <app_id> [-beta <betaname>] [-betapassword <password>] [validate]
HLDS is a special case: the App ID is always 90 and a mod must be chosen first. This is done by setting the app config option mod to the requested value.
 app_set_config <app_id> <option_name> <option_value>
: Example: Install and validate the Counter-Strike: Global Offensive dedicated server:
 app_update 740 validate
: Example: Install and validate HLDS with Team Fortress Classic:
 app_set_config 90 mod tfc
 app_update 90 validate
: Example: Install and validate beta version of HLDS (Half-Life):
 app_update 90 -beta beta validate
: Example: install and validate beta version of the Counter-Strike: Source dedicated server:
 app_update 232330 -beta prerelease validate
: Example: install and validate a private beta version of the Natural Selection 2 dedicated server (name alpha, password natsel):
: [beta name] is the name of the private beta branch
: [beta code] is the password for the private beta branch
 app_update 4940 -beta alpha -betapassword natsel validate
The beta name for the non-beta branch is "public", so app_update 90 -beta public will take you off of the beta branch for HLDS.
5. Once finished, type to properly log off of the Steam servers.
=== Validate ===
 is a command that will check all the server files to make sure they match the SteamCMD files. This command is useful if you think that files may be missing or corrupted.
It is recommended you use this command only on initial installation and if there are server issues.
=== Supported Servers ===
A list of known servers that use SteamCMD to install is available on the Dedicated Servers List page. Note that any extra commands listed need to be executed before the app_update line.
== Automating SteamCMD ==
There are two ways to automate SteamCMD. (Replace steamcmd with ./steamcmd.sh on Linux/macOS.)
=== Command Line ===
Append the commands to the command line prefixed with plus characters, e.g.:
 steamcmd +force_install_dir ../cs1_ds +login anonymous +app_update 730 +quit
To install a specific game mod for HL1, such as Counter-Strike: Condition Zero:
 steamcmd +force_install_dir ../czero +login anonymous +app_set_config 90 mod czero +app_update 90 +quit
For a game that requires logins, like Killing Floor:
 steamcmd +force_install_dir c:\KFServer\ +login <username> <password> +app_update 215350 +quit
=== Creating a Script ===
1. Put your SteamCMD commands in a text file. (You may add comments which start with //.) Example:
// update_csgo_ds.txt
//
@ShutdownOnFailedCommand 1 //set to 0 if updating multiple servers at once
@NoPromptForPassword 1
force_install_dir ../csgo_ds
login <username> <password>
//for servers which don't need a login
//login anonymous 
app_update 740 validate
quit
2. Run SteamCMD with the +runscript option, referring to the file you created previously. Example:
 steamcmd +runscript update_csgo_ds.txt
== Cross-Platform Installation ==
It is possible to choose the platform for which SteamCMD should download files, even if it isn't the platform it is currently running on. This is done using the @sSteamCmdForcePlatformType variable. (Yes, those are two "s"es at the beginning of the variable name.) For example, to download the Windows CSGO dedicated server on Linux, you can run the following command:
 ./steamcmd.sh +@sSteamCmdForcePlatformType windows +force_install_dir ../csgo_ds +login anonymous +app_update 740 validate +quit
or use the following script:
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
@sSteamCmdForcePlatformType windows
force_install_dir ../csgo_ds
login anonymous
app_update 740 validate
quit
The supported values are windows, macos and linux.
== Windows Software/Scripts ==
=== condenser ===
condenser is a bootstrapper for installing, configuring, & launching Steam dedicated server apps.
=== SteamCMD AutoUpdater ===
Install and automatically update any game server.
GitHub Repo:
https://github.com/C0nw0nk/SteamCMD-AutoUpdate-Any-Gameserver
=== SteamCMD GUI ===
This tool allows the user to use SteamCMD on Windows without command lines and/or batch files.
GitHub Repo:
https://github.com/DioJoestar/SteamCMD-GUI
=== SteamPS ===
SteamPS is a PowerShell module that can be used to update servers, and fetch server information. It also presents a workflow to update game servers.
===PowerShellGSM===
PowerShellGSM is a Modular PowerShell tool to manage game servers using SteamCMD.
====Features====
* Installation
* Backups
* Updates
* Monitoring
* Restarts
====Supported Servers====
PowerShellGSM includes 20+ templates servers and supports custom templates allowing you to virtually support any games (even non-SteamCMD games).
====Advantages====
Faster than most available tools.
Lighter and more targeted backups.
Modular.
Expandable.
Customizable.
====Links====
GitHub Repo: https://github.com/patrix87/PowerShellGSM
== Linux Scripts ==
===LinuxGSM===
right|thumb|370px|Linux Game Server Managers
LinuxGSM is the command-line tool for quick, simple deployment and management of Linux dedicated game servers.
====Features====
* Installer
* Updater
* Monitor
* Alerts
* Server Details
* Backups
* Console
====Supported Servers====
There are now 100+ different game servers supported and rising. For a full list visit the website.
====Links====
Website: https://linuxgsm.com
GitHub Repo: https://github.com/GameServerManagers/LinuxGSM
===docker-steam-wine===
Run a Steam powered Windows game server in Docker.
Project:
https://github.com/nuxy/docker-steamcmd-wine
===wGASM===
Weasel's Game-Administrator / Server-Manager (wGASM) is a system of scripts written in bash for Debian-based Linux distributions.  Features include:
* Detailed instructions for preparation and installation in the guide.
* Easy-to-use script, to prepare Debian Linux for the system. It installs all required packages, offers to create the unprivileged user, offers to install Webmin[webmin.com], etc.
* Easy-to-use script, to install the system under the unprivileged user. It downloads the system from GitHub, puts everything in the expected folders, offers to install SteamCMD for you, and offers to download and install the latest "Stencils" archive.
* Some moron-detection to prevent you from running things under the wrong Linux user (i.e. do NOT run game-servers under root, etc.)
* Many configuration options are driven by a text-based configuration file.
* Server details, game-types and other data stored in easy-to-edit plain-text and tab-separated-value (TSV) files.
* Functions to Install, Run, Start (in background), Stop (from background), Backup, Update, and Monitor dedicated game-servers for GoldSrc and Source game-engines.
* No requirement to know how to use SteamCMD yourself - It does it all for you!
* Supports 30+ games on Steam!
* Of those, 10 have been fully tested and included in the examples.
* Optional integration with Webmin[webmin.com] - to enable operating everything in a web-browser!
* Even the Webmin[webmin.com] stuff is driven by easy-to-edit plain-text files.
* Minimal Linux experience required = know how to access with SSH, enter commands in the shell, not much else!
* Minimal system requirements = depends mostly on what games you are hosting.
* Minimal access requirements = SSH access, seperate root (or privileged sudo-enabled) and unprivileged game-servers users.
* Supports creating and using "Stencils" (canned-configurations) that maybe be "Painted" onto (applied to) game-servers - making setting them up quicker. Examples are available for the 10 tested games.
* Little (if any) script editing required - maybe just for scheduled cron jobs if you're into that.
* If you want to set up scheduled cron[en.wikipedia.org] jobs to do maintenance (scheduled backups, graceful automatic updates, and automated health-checks), there are functions for doing-so, which you can schedule! (and examples in the guide).
* Example virtual machines for VirtualBox and VMware are available as a learning/practice tool (or possibly for hosting local games).
====Links====
* All code is hosted in GitHub: https://github.com/Mecha-Weasel/wgasm/
* Documentation is in the following Steam Community Guide:https://steamcommunity.com/sharedfiles/filedetails/?id=3259278773
== Known Issues ==
===ERROR! Failed to install app "xxxxxx" (No subscription)===
If you get the "No subscription" error, the game/server you are trying to download either requires a login or that you have purchased the game. You will therefore have to log in with a Steam username and password. If that doesn't help, you may need to purchase a copy of the game on Steam first. See Dedicated Servers List.
For example:
steamcmd +login <username> <password>
=== 32-Bit Libraries on 64-Bit Linux Systems ===
Since SteamCMD is a 32-bit binary, 32-bit libraries are required.
The following error may occur:
 steamcmd: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
The resolution depends on your distro:
==== Debian-Based Distributions (Ubuntu, Mint, etc.) ====
 sudo apt-get install lib32stdc++6
With Debian 7 "Wheezy" you may encounter this error:
 The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch but it is not installable
 E: Unable to correct problems, you have held broken packages.
To fix this, do the following:
 dpkg --add-architecture i386
 apt-get update
 apt-get install lib32gcc1
==== Red Hat-Based Distributions (RHEL, Fedora, CentOS, etc.) ====
 yum install glibc.i686 libstdc++.i686
==== Arch Linux ====
Don't forget to first enable the multilib repository.
 pacman -S lib32-gcc-libs
=== Login Failure: No Connection ===
On Linux servers, you may experience a "Login Failure: No Connection" error. This is related to missing iptables rules. You will want something along these lines:
iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT
The port list is found here: https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711&l=english
On Windows servers, you may experience "SteamUpdater: Error: Download failed: http error 0" and "SteamUpdater: Error: Steam needs to be online to update. Please confirm your network connection and try again.". This is usually fixed by checking "Automatically detect settings" in IE (Internet Explorer) through the lan settings in the Internet option menu.
# Open Internet Explorer (IE).
# Click on Tools → Internet Options
# Click on the Connections tab
# At the bottom, you should see Local Area Network (LAN) Settings.
# Check the first box (Automatically detect settings)
# Hit OK, and Apply. Try running the SteamCMD again; if it still doesn't work. try lowering your Internet Security level zone to medium or lower. You can find that in the Security tab in Internet Options.
=== SteamCMD Startup Errors ===
==== Unable to Locate a Running Instance of Steam ====
You may get the following error when starting a server with Linux:
 [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.dll.
Resolve the issue by linking steamclient.so to the ~/.steam/sdk32/steamclient.so directory:
 ln -s steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so
==== ulimit Linux Startup Error ====
Some users may get a ulimit error (no permission/cannot open file) while script is starting up. This error caused by a low setting of the -n parameter (number of file descriptors) of ulimit. SteamCMD uses standard commands inside of the initialization shell script to change the ulimit automatically, but some servers may forbid increasing ulimit values after startup (or beyond a limit set by root).
This can be fixed by changing the file descriptor number ulimit:
 ulimit -n 2048
If an error appears (no permission), you will have to log in as root to change the parameter. To check the current setting, type ulimit -a; the system will reply with many rows, you need to find one:
 open files (-n) 1024
In this case, 1024 is the current value.
root can also modify the limits in the /etc/security/limits.conf file.
In most instances you will simply get a warning message however it will not stop SteamCMD from running.
=== Getting a Linux 64-Bit steamclient.so on a Windows Machine ===
WSL does not play nicely with 32-bit files. If you need the steamclient.so 64-bit file you can simply run the following command:
steamcmd.exe +@sSteamCmdForcePlatformType linux +login anonymous +app_update 1007 +quit
You will then find the file here:
.\steamapps\common\Steamworks SDK Redist\linux64
=== Only the HLDS Engine is Downloaded ===
When trying to download a mod like TFC, initially it only downloads the engine files of the HLDS, but not the mod. This is caused by appmanifest files not downloading correctly. This happens with both the regular version and the beta. You may have to try multiple times until all the required files are downloaded, but once this is done, the files should update correctly next time.
Alternatively, it is possible to copy existing the appmanifest files into the steamapps directory. Download appmanifest files from the LinuxGSM github repository.
Just deleting the appmanifest files, without downloading replacements from a third party, may work as well! You will get an error at first though, complaining that something went wrong, which is due to the deleted files.
== See Also ==
* Source Dedicated Server
* Half-Life Dedicated Server
* Dedicated Servers List
* SteamCMDui
* [linode.com] Linux Install SteamCMD