SteamCMD: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Downloading and Running SteamCMD: changed layout to remove excessive indentation)
Line 5: Line 5:
1. Download the SteamCMD Update Tool
1. Download the SteamCMD Update Tool
:* [http://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.zip Windows Installer]
:* [http://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.zip Windows Installer]
:* [http://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.tar.gz Linux Installer]
:* Linux: type <code>wget http://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.tar.gz</code>
:* Linux: type <code>wget http://blog.counter-strike.net/wp-content/uploads//2012/04/steamcmd.tar.gz</code>
:: 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
2. Extract the contents to a directory
: {{Note|Do not extract the contents of the updater tool to the regular Steam Client folder or to a folder that has the older HLDSUpdateTool program.}}
: {{Note|Do not extract the contents of the updater tool to the regular Steam Client folder or to a folder that has the older HLDSUpdateTool program.}}
:* Linux: type <code>tar xvfz steamcmd.tar.gz</code>
:* Linux: type <code>tar xvfz steamcmd.tar.gz</code>
3. Launch SteamCMD for the first time
3. Launch SteamCMD for the first time
:1. Open a command prompt in that directory and start SteamCmd
: Open a command prompt in that directory and start SteamCmd
::* Windows: type <code>steamcmd</code>
:* Windows: type <code>steamcmd</code>
::* Linux: type <code>./steam.sh</code>
:* Linux: type <code>./steam.sh</code>
::: If this doesn't work, try <code>STEAMEXE=steamcmd ./steam.sh</code>
:: If this doesn't work, try <code>STEAMEXE=steamcmd ./steam.sh</code>
::: If this doesn't work either, try open the file in a text editor and edit line 60 to: <code>${DEBUGGER} "${STEAMROOT}"/${PLATFORM}/${STEAMEXE}cmd "$@"</code>
:: If this doesn't work either, try open the file in a text editor and edit line 60 to: <code>${DEBUGGER} "${STEAMROOT}"/${PLATFORM}/${STEAMEXE}cmd "$@"</code>
::: {{Note|If your server is running Ubuntu-x64 you may have to install <code>ia32-libs</code>.}}
''The program will automatically update and enter you in to a <code>Steam></code> prompt.  Type <code>help</code> for more information.''
:::: To do this run the following command: <code>sudo apt-get install ia32-libs</code>
 
: ''The program will automatically update and enter you in to a <code>Steam></code> prompt.  Type <code>help</code> for more information.''
 
:2. Log in with your Steam Account
For certain games, you will have to log in with your Steam Account
:: {{Note|You must log out of the regular Steam client in order to properly log in to SteamCMD Update Tool.}}
{{Note|You must log out of the regular Steam client in order to properly log in to SteamCMD Update Tool.}}
:: <syntaxhighlight>login <username> <password></syntaxhighlight>
<syntaxhighlight>login <username> <password></syntaxhighlight>
:: If you receive a Steam Guard error, check your e-mail for your access code and login using the following command (you'll only need to do this once per computer):
If you receive a Steam Guard error, check your e-mail for your access code and login using the following command (you'll only need to do this once per computer):
:: <syntaxhighlight>login <username> <password> <steam guard code></syntaxhighlight>
<syntaxhighlight>login <username> <password> <steam guard code></syntaxhighlight>
:3.  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.


== Downloading an app ==
== Downloading an app ==

Revision as of 17:22, 2 November 2012

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 Steam Pipe content system. Eventually all Steam games will switch from HLDSUpdateTool to this.

Downloading and Running SteamCMD

1. Download the SteamCMD Update Tool

If you are running a 64-bit Linux distro, you will probably have to install 32-bit libs. See here how to do this.

2. Extract the contents to a directory

Note.pngNote:Do not extract the contents of the updater tool to the regular Steam Client folder or to a folder that has the older HLDSUpdateTool program.
  • Linux: type tar xvfz steamcmd.tar.gz

3. Launch SteamCMD for the first time

Open a command prompt in that directory and start SteamCmd
  • Windows: type steamcmd
  • Linux: type ./steam.sh
If this doesn't work, try STEAMEXE=steamcmd ./steam.sh
If this doesn't work either, try open the file in a text editor and edit line 60 to: ${DEBUGGER} "${STEAMROOT}"/${PLATFORM}/${STEAMEXE}cmd "$@"

The program will automatically update and enter you in to a Steam> prompt. Type help for more information.


For certain games, you will have to log in with your Steam Account

Note.pngNote:You must log out of the regular Steam client in order to properly log in to SteamCMD Update Tool.
login <username> <password>

If you receive a Steam Guard error, check your e-mail for your access code and login using the following command (you'll only need to do this once per computer):

login <username> <password> <steam guard code>

You should see a message stating that you have successfully logged in with your account.

Downloading an app

1. Start SteamCMD and set your app install directory. (note: use forward slashes for Linux and backslashes for Windows)

force_install_dir <path>
Icon-Bug.pngBug:On some Linux distributions the path cannot contain any capital letters - see #Known issues  [todo tested in ?]
Example:
  • cs_go directory in the current directory:
force_install_dir ./cs_go/

2. Install or update the app. To also validate the app add validate to the command.

app_update <app_id>
Example:
  • To install and validate CS:GO:
app_update 740 validate

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

Automating SteamCMD

There are two ways to automate SteamCMD.

1. Add commands to the command line. Example:

SteamCMD +login user password +force_install_dir ../csgo_ds +app_update 740 validate

2. Create a script.

a. Put your SteamCMD commands in a text file. Example:
// update_csgo_ds.txt
//
login user password
force_install_dir ../csgo_ds
app_update 740 validate
exit
b. Run SteamCMD with the +runscript option. Example:
SteamCMD +runscript csgo_ds.txt

Protect your AccountLogin with gpg under Linux

Write your loginscript like the example and save the file as update_csgo_ds.txt. You have to encrypt with gpg the textfile with a symmetric encryption:

gpg -c --force-mdc update_csgo_ds.txt
# enter your password
# the new encrypted file update_csgo_ds.txt.gpg will be created
# delete the original file with
# rm update_csgo_ds.txt

You can check the decryption with:

gpg -d update_csgo_ds.txt.gpg
# enter you password
# the text will be written to stdout, when your password is ok

When everything is ok, you can use a little shell script to pipe the stdout from gpg to steam.sh:

#!/bin/sh
read -p "Enter your password: " -s pass
gpg --passphrase $pass -d login.gpg 2>/dev/null | STEAMEXE=steamcmd ./steam.sh
pass=""

Known issues

I was able to download or update the server package with SteamCMD, but the server fails to start

Common causes:

  • Linux: Some games on some distributions have issues with uppercase letters in directory/filenames.

32-bit libraries on 64-bit Linux systems

Since steamcmd is a 32-bit program, a few 32-bit libraries are required, even if you already have their 64-bit versions installed.

The related error message looks like this:
steamcmd: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

The remedies are distribution-specific:

Debian and derivatives

sudo apt-get install ia32-libs-gtk

CentOS

sudo yum install glibc.i686 libstdc++.i686

Download Failed

On windows computers, the initial download may fail if proxy settings are not set to automatically detect settings.