Difference between revisions of "SteamCMD"

From Valve Developer Community
Jump to: navigation, search
m (Downloading and Running SteamCMD)
(update LinuxGSM details)
 
(142 intermediate revisions by 41 users not shown)
Line 1: Line 1:
 
{{otherlang2
 
{{otherlang2
 +
|pt-br=SteamCMD:pt-br
 +
|es=SteamCMD:es
 +
|ko=SteamCMD:ko
 
|fr=SteamCMD:fr
 
|fr=SteamCMD:fr
 
|nl=SteamCMD:nl
 
|nl=SteamCMD:nl
 
|pl=SteamCMD:pl
 
|pl=SteamCMD:pl
 
|ru=SteamCMD:ru
 
|ru=SteamCMD:ru
 +
|zh-cn=SteamCMD:zh-cn
 
}}
 
}}
The '''Steam Console Client''' or '''SteamCMD''' is a new tool to install and update dedicated servers using a command line interface. It only works with games that have switched over to the [[SteamPipe]] content system. Eventually all Steam games will switch from [[HLDSUpdateTool]] to this.
+
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. All games have been migrated from the deprecated [[HLDSUpdateTool]] to SteamCMD.
  
== Downloading and Running SteamCMD==
+
== Downloading SteamCMD ==
 +
=== Windows ===
  
1. Download the SteamCMD Update Tool
+
1. Create a folder for SteamCMD.
:* [http://media.steampowered.com/client/steamcmd_win32.zip Windows .zip file] Returns a 404 since Nov 21 2013. Unofficial mirrors: [https://web.archive.org/web/*/http://media.steampowered.com/client/steamcmd_win32.zip Internet Archive], [http://nefarius.at/wp-content/uploads/2013/11/steamcmd_win32.zip Nefarius], [http://tf2.rbemrose.com/steamcmd_win32.zip Powerlord]
+
 
:* Linux: type <code>wget http://media.steampowered.com/client/steamcmd_linux.tar.gz</code>
+
''For example''
:: If you are running a 64-bit Linux distro, you will probably have to install 32-bit libs. See [[#32-bit libraries on 64-bit Linux systems|here]] how to do this.
+
 
2. Extract the contents to a directory
+
C:\steamcmd
: {{Note|Do not extract the contents of the updater tool to the regular Steam Client folder or to the HLDSUpdateTool folder.}}
+
 
:* Linux: type <code>tar -xvzf steamcmd_linux.tar.gz</code>
+
2. Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip  
3. Launch SteamCMD for the first time
+
 
: Open a command prompt in that directory and start SteamCmd
+
3. Extract the contents of the zip to the folder.
:* Windows: type <code>steamcmd</code>
+
 
:* Linux: type <code>./steamcmd.sh</code>
+
=== Linux ===
''The program will automatically update and enter you in to a <code>Steam></code> prompt.  Type <code>help</code> for more information.''
+
 
 +
Create a user account named ''steam'' to run SteamCMD safely, isolating it from the rest of the operating system. '''Do not run steamcmd while operating as the root user''' - to do so is a '''security risk'''.
 +
 
 +
1. As the root user, create the ''steam'' user:
 +
 
 +
useradd -m steam
 +
 
 +
2. Go into its home folder:
 +
cd /home/steam
 +
 
 +
==== Package from repositories ====
 +
1. It's recommended to install the SteamCMD package from your distribution repositories, if available:
 +
 
 +
Ubuntu/Debian
 +
sudo apt install steamcmd
 +
 
 +
{{Note|If you are using a 64 bit machine you will need to add multiverse
 +
  sudo add-apt-repository multiverse
 +
  sudo dpkg --add-architecture i386
 +
  sudo apt update
 +
  sudo apt install lib32gcc1 steamcmd
 +
}}
 +
 
 +
RedHat/CentOS
 +
yum install steamcmd
 +
 
 +
Arch Linux: install [https://aur.archlinux.org/packages/steamcmd/ steamcmd from the AUR].
 +
 
 +
2. Link the '''steamcmd''' executable:
 +
ln -s /usr/games/steamcmd steamcmd
 +
 
 +
==== Docker ====
 +
If your server is running [https://www.docker.com/ Docker], you can simply use:
 +
<pre>
 +
docker run -it --name=steamcmd cm2network/steamcmd bash
 +
</pre>
 +
 
 +
steamcmd.sh location: ''/home/steam/steamcmd''
 +
 
 +
This image can be used as a base image for Steam-based dedicated servers.
 +
Example:
 +
[https://hub.docker.com/r/cm2network/csgo/ https://hub.docker.com/r/cm2network/csgo/]
 +
 
 +
You can find the associated Docker Hub page here:
 +
[https://hub.docker.com/r/cm2network/steamcmd/ https://hub.docker.com/r/cm2network/steamcmd/]
 +
 
 +
 
 +
==== Manually ====
 +
1. Before you begin, you must first install the dependencies required to run SteamCMD:
 +
 
 +
Ubuntu/Debian 64-Bit
 +
 
 +
sudo apt-get install lib32gcc1
 +
 
 +
RedHat/CentOS
 +
 
 +
yum install glibc libstdc++
 +
 
 +
RedHat/CentOS 64-Bit
 +
 
 +
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 <code>sudo</code> 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 -
 +
 
 +
5. Install tmux and/or screen for easy server management
 +
 
 +
sudo apt-get install tmux screen -y;
 +
 
 +
=== OS X ===
 +
 
 +
1. Open Terminal.app and create a directory for SteamCMD.
 +
 
 +
mkdir ~/Steam && cd ~/Steam
 +
 
 +
2. Download and extract SteamCMD for OS X.
 +
 
 +
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 <code>Steam&gt;</code> prompt.  Type <code>help</code> for more information.''
 +
 
 +
=== Windows ===
 +
Open a Command Prompt and start SteamCMD.
 +
 
 +
cd C:\steamcmd
 +
steamcmd
 +
 
 +
=== Linux/OS X ===
 +
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.
  
To download most game servers, you must login anonymously
 
 
  login anonymous
 
  login anonymous
  
If logging in anonymously doesn't work for that particular game, you will have to log in with a Steam Account
+
=== With a Steam account ===
{{Note|You must log out of the regular Steam client in order to properly log in to SteamCMD Update Tool.}}
+
 
  login <username>
+
Some servers require you to login with a Steam Account.
 +
{{Note|For security reasons it is recommended that you create a new Steam account just for your dedicated servers.}}
 +
{{Note|A user can only be logged in once at any time (counting both graphical client as well as SteamCMD logins).}}
 +
 
 +
  login &lt;username&gt;
 +
 
 +
Next enter your password.
  
Enter your password. Then check your e-mail for your Steam Guard access code and enter it (you'll only need to do this once per computer).
+
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.
 
You should see a message stating that you have successfully logged in with your account.
Line 35: Line 163:
 
== Downloading an app ==
 
== Downloading an app ==
  
1. Start SteamCMD and set your app install directory. (note: use forward slashes for Linux and backslashes for Windows)
+
1. Start SteamCMD and log in.
  force_install_dir <path>
+
 
: Example: cs_go directory in the current directory:
+
2. Set your app install directory. (Note: use forward slashes for Linux/OS X and backslashes for Windows.)
 +
 
 +
  force_install_dir &lt;path&gt;
 +
 
 +
e.g. a directory named <code>cs_go</code> inside the current directory:
 +
 
 
  force_install_dir ./cs_go/
 
  force_install_dir ./cs_go/
  
2. Install or update the app. <app_id> is the [[Steam Application IDs|Steam Application ID]]. To also validate the app add <code>validate</code> to the command. To participate in HLDS beta testing add <code>-beta beta</code> to the command. To participate in SRCDS beta testing add <code>-beta prerelease</code> to the command.
+
'''For Windows''': force_install_dir c:\cs_go\
  app_update <app_id>
+
 
: Example: install and validate CS:GO:
+
3. Install or update the app using the <code>app_update</code> command (supplying a [[Steam Application IDs|Steam Application ID]]). Please check here for the dedicated server list: [[Dedicated_Servers_List|Dedicated server list]]. To also validate the app, add <code>validate</code> to the command. To download a beta branch, use the <code>-beta &lt;betaname&gt;</code> option &ndash; for example, the HLDS beta branch is named <code>beta</code> and the SrcDS beta branch is named <code>prerelease</code>. Some beta branches are protected by a password; to be able to download from them, also add the <code>-betapassword &lt;password&gt;</code> option.
 +
 
 +
app_update &lt;app_id&gt; [-beta &lt;betaname&gt;] [-betapassword &lt;password&gt;] [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 <code>mod</code> to the requested value.
 +
 
 +
  app_set_config &lt;app_id&gt; &lt;option_name&gt; &lt;option_value&gt;
 +
 
 +
: Example: Install and validate the Counter Strike: Global Offensive dedicated server:
 
  app_update 740 validate
 
  app_update 740 validate
: Example: install and validate beta version of HLDS (Half-Life):
+
: Example: Install and validate HLDS with Team Fortress Classic:
 +
app_set_config 90 mod tfc
 +
app_update 90 validate
 +
{{bug|HLDS (appid 90) currently requires multiple runs of the <code>app_update</code> command before all the required files are successfully installed. Simply run <code>app_update 90 validate</code> multiple times until no more updates take place.}}
 +
: Example: Install and validate beta version of HLDS (Half-Life):
 
  app_update 90 -beta beta validate
 
  app_update 90 -beta beta validate
: Example: install and validate beta version of CS:S:
+
: Example: install and validate beta version of the Counter Strike: Source dedicated server:
 
  app_update 232330 -beta prerelease validate
 
  app_update 232330 -beta prerelease validate
: Example: install and validate a private beta version of NS2:
+
: Example: install and validate a private beta version of the Natural Selection 2 dedicated server (name <code>alpha</code>, password <code>natsel</code>):
app_update 4940 -beta [beta name] -betapassword [beta code] validate
+
: [beta name] is the name of the private beta branch
  Where [beta name] is the name of the private beta branch and [beta code] is the password for the private beta branch (i.e. the code you would enter to get access to a private beta in the game properties).
+
[beta code] is the password for the private beta branch
: Example: install and validate CS 1.6:
+
  app_update 4940 -beta alpha -betapassword natsel validate
  app_update 90 validate
 
{{bug|HLDS mods currently require multiple installs before the mod's files are installed.}}
 
 
 
  
 
3. Once finished, type <code>quit</code> to properly log off of the Steam servers.
 
3. Once finished, type <code>quit</code> to properly log off of the Steam servers.
  
=== Supported Servers ===
+
quit
  
This is the known list of servers that require steamcmd to install. Any listed extra command line options need to be before the app_update line.
+
=== Validate ===
 +
validate
 +
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.
  
{{bug|HLDS (appid 90) currently require multiple installs before the game's files are installed. Possible workaround for this problem available. [link http://wp.me/p2LXdp-FM]}}
+
{{Note|Validation will overwrite any files that have been changed. This may cause issues with customized servers. For example, if you customize <code>mapcycle.txt</code>, this file will be overwritten to the server default. Any files that are not part of the default installation will not be affected.}}
  
Note: The + and quotes in the extra command line options aren't needed when using automation as detailed in a later section.
+
It is recommended you use this command only on initial installation and if there are server issues.
  
Note: Items marked as ''Beta'' below may require -beta beta as part of their app_update argument... ex. +app_update "90 -beta beta"
+
=== Supported Servers ===
  
Note: You HAVE to use anonymous Account for some IDs. (e.g. CSS will not work with your normal Steam Account)
+
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 ==
|-
 
! Server
 
! scope="col" style="width: 7em" | ID
 
! Extra Command Line options
 
|-
 
| HLDS for [[Half-Life]] and [[Counter-Strike 1.6]]
 
| 90
 
|-
 
| [[Counter-Strike: Condition Zero]] dedicated server
 
| 90
 
| +app_set_config "90 mod czero"
 
|-
 
| [[Deathmatch Classic]] dedicated server
 
| 90
 
| +app_set_config "90 mod dmc"
 
|-
 
| [[Day of Defeat]] dedicated server
 
| 90
 
| +app_set_config "90 mod dod"
 
|-
 
| [[Half-Life: Opposing Force]] dedicated server
 
| 90
 
| +app_set_config "90 mod gearbox"
 
|-
 
| [[Ricochet]] dedicated server
 
| 90
 
| +app_set_config "90 mod ricochet"
 
|-
 
| [[Team Fortress Classic]] dedicated server
 
| 90
 
| +app_set_config "90 mod tfc"
 
|-
 
| [[Counter-Strike: Global Offensive]] dedicated server
 
| 740
 
|-
 
| [[The Ship]] dedicated server
 
| 2403
 
|-
 
| [[Garry's Mod]] dedicated server
 
| 4020
 
|-
 
| [[Natural Selection 2]] dedicated server
 
| 4940
 
|-
 
| [[Serious Sam 3]] dedicated server
 
| 41080
 
|-
 
| [[Nuclear Dawn]] dedicated server
 
| 111710
 
|-
 
| [[Red Orchestra: Ostfront 41-45]] Windows dedicated server
 
| 223240
 
|-
 
| [[Red Orchestra: Ostfront 41-45]] Linux dedicated server
 
| 223250
 
|-
 
| [[Red Orchestra 2: Heroes of Stalingrad]] and [[Rising Storm]] Windows dedicated server
 
| 212542
 
|-
 
| [[Killing Floor]] Windows dedicated server
 
| 215350
 
|-
 
| [[Killing Floor]] Linux dedicated server
 
| 215360
 
|-
 
| [[Left 4 Dead 2]] dedicated server
 
| 222860
 
|-
 
| [[Team Fortress 2]] dedicated server
 
| 232250
 
|-
 
| [[Day of Defeat: Source]] dedicated server
 
| 232290
 
|-
 
| [[Counter-Strike: Source]] dedicated server
 
| 232330
 
|-
 
| [[Half-Life 2: Deathmatch]] dedicated server
 
| 232370
 
|-
 
| [[Blade Symphony]] ''Beta'' dedicated server
 
| 228780
 
|-
 
| Source SDK Base 2006 MP dedicated server (i.e. Fortress Forever)
 
| 205
 
|-
 
| Source SDK Base 2013 MP dedicated server
 
| 244310
 
|-
 
| [[Half-Life Deathmatch: Source]] dedicated server
 
| 255470
 
|-
 
| [[Pirates, Vikings, and Knights II]] dedicated server
 
| 17575
 
|}
 
 
 
{{Tip|To install multiple mods, separate their names with commas, e.g. <code>+app_set_config 90 mod czero,dod</code>.}}
 
  
== Automating SteamCMD ==
+
There are two ways to automate SteamCMD. (Replace <code>steamcmd</code> with <code>./steamcmd.sh</code> on Linux/OS X.)
  
There are two ways to automate SteamCMD. (replace <code>steamcmd</code> with <code>./steamcmd.sh</code> on Linux)
+
=== Command line ===
  
{{Note|When using beta on the command line, it must be quoted in a special way, such as +app_update "90 -beta beta"}}
+
{{Note|When using the <code>-beta</code> option on the command line, it must be quoted in a special way, such as <code>+app_update "90 -beta beta"</code>.}}
 +
{{Note|If this does not work, try putting it like <code>"+app_update 90 -beta beta"</code> instead.}}
  
1. Add commands to the command line. Examples:
+
Append the commands to the command line prefixed with plus characters, e.g.:
  steamcmd +login anonymous +force_install_dir ../csgo_ds +app_update 740 validate +quit
+
  steamcmd +login anonymous +force_install_dir ../csgo_ds +app_update 740 +quit
  
 
To install a specific game mod for HL1, such as Counter-Strike: Condition Zero:
 
To install a specific game mod for HL1, such as Counter-Strike: Condition Zero:
  steamcmd +login anonymous +force_install_dir ../czero +app_set_config 90 mod czero +app_update 90 validate +quit
+
  steamcmd +login anonymous +force_install_dir ../czero +app_set_config 90 mod czero +app_update 90 +quit
  
For a game that requires logins, like Killing Floor
+
For a game that requires logins, like Killing Floor:
  steamcmd +login <username> <password> +force_install_dir c:\KFServer\ +app_update 215350 validate +quit
+
  steamcmd +login &lt;username&gt; &lt;password&gt; +force_install_dir c:\KFServer\ +app_update 215350 +quit
  
2. Create a script.
+
=== Creating a script ===
: a. Put your SteamCMD commands in a text file. Example:
+
 
 +
1. Put your SteamCMD commands in a text file. (You may add comments which start with <code>//</code>.) Example:
 
<syntaxhighlight>
 
<syntaxhighlight>
 
// update_csgo_ds.txt
 
// update_csgo_ds.txt
Line 199: Line 248:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
: b. Run SteamCMD with the <code>+runscript</code> option. Example:
+
2. Run SteamCMD with the <code>+runscript</code> option, referring to the file you created previously. Example:
 +
 
 
  steamcmd +runscript csgo_ds.txt
 
  steamcmd +runscript csgo_ds.txt
  
Line 222: Line 272:
 
The supported values are <code>windows</code>, <code>macos</code> and <code>linux</code>.
 
The supported values are <code>windows</code>, <code>macos</code> and <code>linux</code>.
  
== Windows Scripts ==
+
== Windows Software/Scripts ==
 +
 
 +
=== condenser ===
 +
 
 +
[https://github.com/sympatovit/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
 +
 
 
===SteamCMD Guardian 1.2===
 
===SteamCMD Guardian 1.2===
 
View and download here: http://pastebin.com/BRUbsGQh
 
View and download here: http://pastebin.com/BRUbsGQh
  
 
== Linux Scripts ==
 
== Linux Scripts ==
===Linux Game Server Managers===
 
''by Daniel Gibbs''
 
  
The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers using SteamCMD.
+
===LinuxGSM===
 +
[[Image:LinuxGSM_Logo_White.png‎|right|thumb|370px|Linux Game Server Managers]]
 +
LinuxGSM is the command-line tool for quick, simple deployment and management of Linux dedicated game servers.
  
Various Server are supported including:
+
====Features====
*Half-Life 2: Deathmatch
+
* Installer
*Counter Strike
+
* Updater
*Counter Strike: Source
+
* Monitor
*Counter Strike: Global Offensive
+
* Alerts
*Team Fortress 2
+
* Server Details
*Left 4 Dead 2
+
* Backups
*Day of Defeat: Source
+
* Console
*Red Orchestra: Ostfront 41-45
 
*Killing Floor
 
  
Full list of servers and instructions:
+
====Supported Servers====
http://danielgibbs.co.uk/scripts
+
There are now 100+ different game servers supported and rising. For a full list visit the website.
  
GitHub Repo:
+
====Links====
https://github.com/dgibbs64/linuxgameservers
+
Website: https://linuxgsm.com
 +
 
 +
GitHub Repo: https://github.com/GameServerManagers/LinuxGSM
  
 
===SteamCMD Guardian 1.2===
 
===SteamCMD Guardian 1.2===
Line 256: Line 322:
 
http://pastebin.com/hcpMpmaZ
 
http://pastebin.com/hcpMpmaZ
  
=== Installation ===
+
 
To make this script work, we need a location. Preferrably you created a user (e.g. steam) with it's own home directory (/home/steam) and are logged in as it via SSH, tty or using su.
+
'''Installation'''
 +
 
 +
To make this script work, we need a location. Preferably you created a user (e.g. steam) with it's own home directory (/home/steam) and are logged in as it via SSH, tty or using su.
  
 
# Make the file.
 
# Make the file.
Line 271: Line 339:
 
The file will auto-download SteamCMD, update it and install all chosen games (up to 4). Run the file again to update the games.
 
The file will auto-download SteamCMD, update it and install all chosen games (up to 4). Run the file again to update the games.
  
= Known issues =
+
== Known issues ==
==ERROR! Failed to install app 'xxxxxx' (No subscription)==
+
===ERROR! Failed to install app 'xxxxxx' (No subscription)===
  
Some servers require you to login (most don't). If you get the 'No subscription' error you will need to enter your steam username and password to allow authentication to the steamCMD system. It is a good idea to create a new Steam username just for the server as the username and password displays as clear text.
+
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 &ndash; if that doesn't help, you may need to purchase a copy of the game on Steam first. See [[Dedicated Servers List]].
 +
 
 +
{{Note|For security reasons it is recommended that you create a new Steam account just for your dedicated servers.}}
  
 
For example
 
For example
Line 281: Line 351:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== 32-bit libraries on 64-bit Linux systems ==
+
=== 32-bit libraries on 64-bit Linux systems ===
  
Since SteamCMD is a 32-bit binary, a few 32-bit libraries are required.
+
Since SteamCMD is a 32-bit binary, 32-bit libraries are required.
  
The following error may occur:<br/><br/>
+
The following error may occur:
<code>steamcmd: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory</code><br/>
 
  
The remedies are distribution-specific:
+
steamcmd: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  
=== Debian and derived distributions (Ubuntu, Mint, etc.) ===
+
The resolution depends on your distro:
  
apt-get install ia32-libs
+
==== Debian based distributions (Ubuntu, Mint, etc.) ====
  
==== Ubuntu 13.10 "Saucy" ====
+
sudo apt-get install lib32stdc++6
  
As of Ubuntu 13.10 the ia32-libs package is deprecated. Use this instead
+
{{Note|<code>ia32-libs</code> are not required to install SteamCMD; <code>lib32gcc1</code> is enough.}}
  
apt-get install lib32gcc1
+
With '''Debian 7 "Wheezy"''' you may encounter this error:
  
==== Debian 7 "Wheezy" ====
+
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.
  
The follow error may occur:<br/><br/>
+
To fix this, do the following:
<code>The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch but it is not installable<br/>E: Unable to correct problems, you have held broken packages.</code><br/>
 
 
 
do the following:
 
 
<syntaxhighlight>
 
<syntaxhighlight>
 
  dpkg --add-architecture i386
 
  dpkg --add-architecture i386
 
  apt-get update
 
  apt-get update
  apt-get install ia32-libs
+
  apt-get install lib32gcc1
 
</syntaxhighlight>
 
</syntaxhighlight>
  
you can also use:
+
==== Red Hat based distributions (RHEL, Fedora, CentOS, etc.) ====
<syntaxhighlight>
 
dpkg --add-architecture i386
 
apt-get update
 
apt-get install libc6-i386 lib32gcc1
 
</syntaxhighlight>
 
to avoid installing unrequired 32bit packages.
 
 
 
=== Red Hat and derived distributions (RHEL, Fedora, CentOS, etc.) ===
 
  
 
  yum install glibc.i686 libstdc++.i686
 
  yum install glibc.i686 libstdc++.i686
  
=== Arch Linux ===
+
==== Arch Linux ====
 
Don't forget to first enable the [https://wiki.archlinux.org/index.php/Multilib multilib repository].
 
Don't forget to first enable the [https://wiki.archlinux.org/index.php/Multilib multilib repository].
  
 
  pacman -S lib32-gcc-libs
 
  pacman -S lib32-gcc-libs
  
== Login Failure: No Connection ==
+
=== Login Failure: No Connection ===
  
On linux servers, you may experience a "Login Failure: No Connection". This is related to missing iptables rules. You will want something along these lines:
+
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:
 
<syntaxhighlight>
 
<syntaxhighlight>
 
iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
 
iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
Line 340: Line 399:
 
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.
 
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.
  
1. Open Internet Explorer (IE)
+
# Open Internet Explorer (IE).
 +
# Click on ''Tools'' &rarr; ''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.
  
2. Click on Tools > Internet Options
+
Resolve the issue by linking <code>steamclient.so</code> to the <code>~/.steam/sdk32/steamclient.so</code> directory:
  
3. Click on the "Connections Tab"
+
ln -s steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so
  
4. At the Bottom, you should see "Local Area Network (LAN) Settings".
+
==== ulimit Linux startup error ====
 +
Some users may get a <code>ulimit</code> error (no permission/cannot open file) while script is starting up. This error caused by a low setting of the <code>-n</code> parameter (number of file descriptors) of <code>ulimit</code>. SteamCMD uses standard commands inside of the initialization shell script to change the <code>ulimit</code> automatically, but some servers may forbid increasing <code>ulimit</code> values after startup (or beyond a limit set by <code>root</code>).
  
5. Check the first box "Automatically detect settings"
+
This can be fixed by changing the file descriptor number ulimit:
  
6. 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".
+
ulimit -n 2048
  
== SteamCmd startup errors ==
+
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:
=== Ulimit linux startup error ===
 
Some users may get ulimit error (no permission/can not open file) while script is starting up. This error caused by low setting of '''-n'''-parameter of ulimit. SteamCmd uses standard command inside of shell-script to change ulimit automatically, but some servers may be protected from changing values to custom from different (set by root).
 
It fixes only with changing ulimit parameter up to 2048: <code>ulimit -n 2048</code>. It may cause error (no permission), so you may need login as root to change the parameter.
 
To check your setting: type '''ulimit -a''', system will reply with many rows, you need to find one:
 
 
  open files                      (-n) 1024
 
  open files                      (-n) 1024
"1024" is the value of setting in system.
+
In this case, ''1024'' is the current value.
<br /><br />
+
 
In most instances you will get a warning message however it will not stop SteamCMD from running.
+
<code>root</code> can also modify the limits in the <code>/etc/security/limits.conf</code> 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 ===
 +
 
 +
WLS does not play nicely with 32-bit files.  If you need the steamclient.so 64-bit file you can simply run the following command:
 +
 
 +
<syntaxhighlight>steamcmd.exe +@sSteamCmdForcePlatformType linux +login anonymous +app_update 1007 +quit</syntaxhighlight>
 +
 
 +
You will then find the file here:
 +
 
 +
<syntaxhighlight>.\steamapps\common\Steamworks SDK Redist\linux64</syntaxhighlight>
 +
 
 +
=== Only the HLDS engine is downloaded ===
 +
 
 +
When trying to download a HL1 mod like TFC, initially it only downloads the engine files of the HLDS, but not the mod. 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.
 +
 
 +
Work-around for this issue here: http://danielgibbs.co.uk/2017/10/hlds-steamcmd-workaround-appid-90-part-ii/
 +
 
 +
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.
 +
 
 +
On a side note, for some reason CS is always installed as well.
 +
 
 +
== See Also ==
 +
* [[Source Dedicated Server]]
 +
* [[Half-Life Dedicated Server]]
 +
* [[Dedicated Servers List]]
 +
* [[SteamCMDui]]
 +
 
 +
[[Category:Steam]]
 +
[[Category:Steam Applications]]
 +
[[Category:Dedicated Server]]

Latest revision as of 15:29, 7 October 2019

Español Français Nederlands Polski Português-Brasileiro Русский 简体中文 한국어

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. All games have been migrated from the deprecated HLDSUpdateTool to SteamCMD.

Downloading SteamCMD

Windows

1. Create a folder for SteamCMD.

For example

C:\steamcmd

2. Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip

3. Extract the contents of the zip to the folder.

Linux

Create a user account named steam to run SteamCMD safely, isolating it from the rest of the operating system. Do not run steamcmd while operating as the root user - to do so is a security risk.

1. As the root user, create the steam user:

useradd -m steam

2. Go into its home folder:

cd /home/steam

Package from repositories

1. It's recommended to install the SteamCMD package from your distribution repositories, if available:

Ubuntu/Debian

sudo apt install steamcmd
Note:If you are using a 64 bit machine you will need to add multiverse
 sudo add-apt-repository multiverse
 sudo dpkg --add-architecture i386
 sudo apt update
 sudo apt install lib32gcc1 steamcmd 

RedHat/CentOS

yum install steamcmd

Arch Linux: install steamcmd from the AUR.

2. Link the steamcmd executable:

ln -s /usr/games/steamcmd steamcmd

Docker

If your server is running Docker, you can simply use:

docker run -it --name=steamcmd cm2network/steamcmd bash

steamcmd.sh location: /home/steam/steamcmd

This image can be used as a base image for Steam-based dedicated servers. Example: https://hub.docker.com/r/cm2network/csgo/

You can find the associated Docker Hub page here: https://hub.docker.com/r/cm2network/steamcmd/


Manually

1. Before you begin, you must first install the dependencies required to run SteamCMD:

Ubuntu/Debian 64-Bit

sudo apt-get install lib32gcc1

RedHat/CentOS

yum install glibc libstdc++

RedHat/CentOS 64-Bit

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 sudo 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 -

5. Install tmux and/or screen for easy server management

sudo apt-get install tmux screen -y;

OS X

1. Open Terminal.app and create a directory for SteamCMD.

mkdir ~/Steam && cd ~/Steam

2. Download and extract SteamCMD for OS X.

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.

Windows

Open a Command Prompt and start SteamCMD.

cd C:\steamcmd
steamcmd

Linux/OS X

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.

login anonymous

With a Steam account

Some servers require you to login with a Steam Account.

Note:For security reasons it is recommended that you create a new Steam account just for your dedicated servers.
Note:A user can only be logged in once at any time (counting both graphical client as well as SteamCMD logins).
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 and log in.

2. Set your app install directory. (Note: use forward slashes for Linux/OS X 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. Install or update the app using the app_update command (supplying a Steam Application ID). Please check here for the dedicated server list: Dedicated server list. To also validate the app, add validate to the command. To download a beta branch, use the -beta <betaname> option – for example, the HLDS beta branch is named beta and the SrcDS beta branch is named prerelease. Some beta branches are protected by a password; to be able to download from them, also add the -betapassword <password> 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
Bug: HLDS (appid 90) currently requires multiple runs of the app_update command before all the required files are successfully installed. Simply run app_update 90 validate multiple times until no more updates take place.
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

3. Once finished, type quit to properly log off of the Steam servers.

quit

Validate

validate

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.

Note:Validation will overwrite any files that have been changed. This may cause issues with customized servers. For example, if you customize mapcycle.txt, this file will be overwritten to the server default. Any files that are not part of the default installation will not be affected.

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/OS X.)

Command line

Note:When using the -beta option on the command line, it must be quoted in a special way, such as +app_update "90 -beta beta".
Note:If this does not work, try putting it like "+app_update 90 -beta beta" instead.

Append the commands to the command line prefixed with plus characters, e.g.:

steamcmd +login anonymous +force_install_dir ../csgo_ds +app_update 740 +quit

To install a specific game mod for HL1, such as Counter-Strike: Condition Zero:

steamcmd +login anonymous +force_install_dir ../czero +app_set_config 90 mod czero +app_update 90 +quit

For a game that requires logins, like Killing Floor:

steamcmd +login <username> <password> +force_install_dir c:\KFServer\ +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
login <username> <password>
//for servers which don't need a login
//login anonymous 
force_install_dir ../csgo_ds
app_update 740 validate
quit

2. Run SteamCMD with the +runscript option, referring to the file you created previously. Example:

steamcmd +runscript 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 +login anonymous +force_install_dir ../csgo_ds +app_update 740 validate +quit

or use the following script:

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
@sSteamCmdForcePlatformType windows
login anonymous
force_install_dir ../csgo_ds
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

SteamCMD Guardian 1.2

View and download here: http://pastebin.com/BRUbsGQh

Linux Scripts

LinuxGSM

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

SteamCMD Guardian 1.2

The following script was tested on Debian Wheezy.

View and download here: http://pastebin.com/hcpMpmaZ


Installation

To make this script work, we need a location. Preferably you created a user (e.g. steam) with it's own home directory (/home/steam) and are logged in as it via SSH, tty or using su.

  1. Make the file.
    nano updateserver.sh
  2. Paste in the code
  3. Modify the code, add at least 1 game to the DL_SV*= rows.
  4. Close the file with Ctrl+O, followed by Enter and concluding with Ctrl+X.
  5. Give the file execute rights for the user
    chmod u+x ./updateserver.sh
  6. Run the file
    ./updateserver.sh

The file will auto-download SteamCMD, update it and install all chosen games (up to 4). Run the file again to update the games.

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.

Note:For security reasons it is recommended that you create a new Steam account just for your dedicated servers.

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
Note:ia32-libs are not required to install SteamCMD; lib32gcc1 is enough.

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.

  1. Open Internet Explorer (IE).
  2. Click on ToolsInternet Options
  3. Click on the Connections tab
  4. At the bottom, you should see Local Area Network (LAN) Settings.
  5. Check the first box (Automatically detect settings)
  6. 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

WLS 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 HL1 mod like TFC, initially it only downloads the engine files of the HLDS, but not the mod. 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.

Work-around for this issue here: http://danielgibbs.co.uk/2017/10/hlds-steamcmd-workaround-appid-90-part-ii/

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.

On a side note, for some reason CS is always installed as well.

See Also