Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 120 additions & 66 deletions docs/game-servers/install-steamcmd-for-a-steam-game-server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ author:
description: 'Install SteamCMD, a command-line version of the Steam client, which works with games that use SteamPipe. Installing SteamCMD is a prerequisite before hosting a Steam title on your own game server.'
keywords: ["steam", "steamcmd", "steam cmd", "games", "game server", "steam server", "steampipe"]
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
modified: 2019-02-01
modified_by:
name: Linode
published: 2016-02-15
Expand All @@ -28,36 +27,41 @@ This guide is intended to get you quickly up and running with SteamCMD on your L
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with `sudo`. If you’re not familiar with the `sudo` command, you can check our [Users and Groups](/docs/tools-reference/linux-users-and-groups/) guide.
{{< /note >}}

## Before You Install
## Before You Begin

1. Familiarize yourself with our [Getting Started](/docs/getting-started/) guide and complete the steps for setting your Linode's hostname and timezone.

2. Update Your Operating System:
1. Update Your Operating System:

**CentOS**

sudo yum update

**Debian / Ubuntu**
**Debian, Ubuntu**

sudo apt update && sudo apt upgrade

1. [Install the `screen` utility](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/#installing-gnu-screen), which will be used later when running SteamCMD. For more information about how screen works, review the rest of our [Using GNU Screen to Manage Persistent Terminal Sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/) guide.

## Secure Your Game Server

Game servers and clients are an especially ripe target for attack. Use our [Securing Your Server](/docs/security/securing-your-server/) guide to:

1. [Add a Steam user account](/docs/security/securing-your-server/#add-a-limited-user-account). Make the username `steam` to coincide with the rest of [Linode's Steam guides](/docs/applications/game-servers/), as well as Valve's official documentation. Be sure to give the `steam` user `sudo` privileges.
1. [Add a limited Linux user](/docs/security/securing-your-server/#add-a-limited-user-account) to your server. Make the username `steam` to coincide with the rest of [Linode's Steam guides](/docs/applications/game-servers/), as well as Valve's official documentation. Be sure to give the `steam` user `sudo` privileges.

2. [Harden SSH access](/docs/security/securing-your-server/#harden-ssh-access).
1. [Harden SSH access](/docs/security/securing-your-server/#harden-ssh-access).

3. [Remove unused network-facing services](/docs/security/securing-your-server/#remove-unused-network-facing-services).
1. [Remove unused network-facing services](/docs/security/securing-your-server/#remove-unused-network-facing-services).

4. If you are using iptables, complete the [Configure a firewall](/docs/security/securing-your-server/#configure-a-firewall) steps **using the rulesets below**. If instead you are using **firewalld**, skip ahead to step 5.
1. If you are using [**iptables**](/docs/security/firewalls/control-network-traffic-with-iptables/) (which is set in Linode's Ubuntu and Debian images by default), follow the [Configure your Firewall Using IPTables](#configure-your-firewall-using-iptables) section.

*IPv4*
1. If instead you are using [**firewalld**](/docs/security/firewalls/introduction-to-firewalld-on-centos/) (as in Linode's CentOS 7 and Fedora images), follow the [Configure your Firewall Using FirewallD](#configure-your-firewall-using-firewalld) section.

{{< file "iptables" >}}
### Configure your Firewall Using IPTables

1. Create two files named `v4` and `v6` in your home directory to record your IPv4 and IPv6 firewall rules:

{{< file "~/v4" >}}
*filter

# Allow all loopback (lo0) traffic and reject traffic
Expand All @@ -72,8 +76,8 @@ Game servers and clients are an especially ripe target for attack. Use our [Secu
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow the Steam client.
-A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
-A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT
-A INPUT -p udp -m udp --dport 27000:27030 -j ACCEPT
-A INPUT -p udp -m udp --dport 4380 -j ACCEPT

# Allow inbound traffic from established connections.
# This includes ICMP error returns.
Expand All @@ -90,15 +94,7 @@ Game servers and clients are an especially ripe target for attack. Use our [Secu
COMMIT
{{< /file >}}

{{< note >}}
Some Steam games require a few additional rules which can be found in our [Steam game guides](/docs/applications/game-servers/). Steam can also use multiple port ranges for various purposes, but they should only be allowed if your game(s) make use of those services. See [this](https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711) Steam Support page for more information.
{{< /note >}}

*IPv6*

Steam currently supports multiplayer play over IPv4 only, so a Steam server only needs basic IPv6 firewall rules, shown below.

{{< file "iptables" >}}
{{< file "v6" >}}
*filter

# Allow all loopback (lo0) traffic and reject traffic
Expand All @@ -119,91 +115,139 @@ Some Steam games require a few additional rules which can be found in our [Steam
COMMIT
{{< /file >}}

5. If you are using **firewalld** (CentOS 7, Fedora) instead of iptables, **use these rules**. If you are using iptables, do skip this step.
{{< note >}}
Some Steam games require a few additional rules which can be found in our [Steam game guides](/docs/applications/game-servers/). Steam can also use multiple port ranges for various purposes, but they should only be allowed if your game(s) make use of those services. See [this](https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711) Steam Support page for more information.

Steam currently supports multiplayer play over IPv4 only, so a Steam server only needs basic IPv6 firewall rules, shown below.
{{< /note >}}

1. Import the rulesets into your firewall to activate them:

sudo iptables-restore < ~/v4
sudo ip6tables-restore < ~/v6

1. [Install iptables-persistent](/docs/security/firewalls/control-network-traffic-with-iptables/#install-iptables-persistent). If you don't install this software, your firewall rules will not persist through reboots of your Linode.

1. If iptables-persistent was already installed, reconfigure the package so that it recognizes your new rulesets:

sudo dpkg-reconfigure iptables-persistent

1. Confirm that your firewall rules are active:

sudo iptables -vL

The output should look similar to:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- lo any anywhere anywhere
0 0 REJECT all -- !lo any localhost/8 anywhere reject-with icmp-port-unreachable
0 0 ACCEPT icmp -- any any anywhere anywhere state NEW icmp echo-request
0 0 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
0 0 ACCEPT udp -- any any anywhere anywhere udp dpts:27000:27030
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:4380
0 0 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 LOG all -- any any anywhere anywhere limit: avg 3/min burst 5 LOG level debug prefix "iptables_INPUT_denied: "
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 LOG all -- any any anywhere anywhere limit: avg 3/min burst 5 LOG level debug prefix "iptables_FORWARD_denied: "
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 60 packets, 8304 bytes)
pkts bytes target prot opt in out source destination

1. If you ever import new rules into your firewall in the future, be sure to reconfigure iptables-persistent again afterward:

sudo dpkg-reconfigure iptables-persistent

### Configure your Firewall Using FirewallD

1. Set up your ruleset:

sudo firewall-cmd --zone="public" --add-service=ssh --permanent
sudo firewall-cmd --zone="public" --add-forward-port=port=27000-27030:proto=udp:toport=1025-65355 --permanent
sudo firewall-cmd --zone="public" --add-forward-port=port=4380:proto=udp:toport=1025-65355 --permanent
sudo firewall-cmd --reload

Switch on firewalld and verify your ruleset:
1. Switch on firewalld and verify your ruleset:

sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --zone="public" --list-all

## Install SteamCMD

First, install `screen` to run Steam games in a separate session:

**CentOS 7**
SteamCMD can be installed via your distribution's [package manager](#from-package-repositories-recommended), or through a [manual method](#install-manually).

sudo yum install screen
### From Package Repositories (Recommended)

**Debian / Ubuntu**
Installing via the package manager allows you to more easily download updates and security patches, so we strongly recommend using this method if your distribution includes the SteamCMD package. The package is available for Ubuntu and Debian deployments.

sudo apt-get install screen
- **Ubuntu**

1. Install the package:

### From Package Repositories (Recommended)
sudo apt-get install steamcmd

Installing via the package manager allows you to more easily download updates and security patches, so we strongly recommend using this method if your distribution includes the SteamCMD package.
1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory:

1. Install the package:
cd ~
ln -s /usr/games/steamcmd steamcmd

sudo apt-get install steamcmd
- **Debian**

{{< note >}}
On Debian you need to add the `non-free` area of the repository to your sources, because the package is available only there.
1. Add the `non-free` area to the repositories in your sources list, because the `steamcmd` package is only available from this area. To do so, edit your `/etc/apt/sources.list` file and include `non-free` at the end of each `deb` and `deb-src` line, as in this snippet:

To do so, edit the `/etc/apt/sources.list` file, and include `non-free` at the end of each `deb` and `deb-src` line:
{{< file "/etc/apt/sources.list" >}}
deb http://mirrors.linode.com/debian stretch main non-free
deb-src http://mirrors.linode.com/debian stretch main non-free
...
{{< /file >}}

deb http://mirrors.linode.com/debian stretch main non-free
deb-src http://mirrors.linode.com/debian stretch main non-free
...
1. Add the i386 architecture, update your package list, and install `steamcmd`:

Then, add the i386 architecture, update your package list, and install `steamcmd`:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt-get install steamcmd

sudo dpkg --add-architecture i386
sudo apt update
sudo apt-get install steamcmd
{{< /note >}}
1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory:

1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory:
cd ~
ln -s /usr/games/steamcmd steamcmd

cd ~
ln -s /usr/games/steamcmd steamcmd
### Install Manually

### Manually
If your package manager does not include the `steamcmd` package, install it manually:

1. Newly created Linodes use 64-bit Linux operating systems. Since Steam is compiled for i386, install the appropriate libraries. For CentOS, also install `wget`.

**CentOS 7**
- **CentOS 7, Fedora**

sudo yum install glibc.i686 libstdc++.i686 wget
sudo yum install glibc.i686 libstdc++.i686 wget

**Debian / Ubuntu**
- **Debian, Ubuntu**

sudo apt-get install lib32gcc1
sudo apt-get install lib32gcc1

{{< note >}}
Running `dpkg --add-architecture i386` is not necessary at this point. Our Steam game guides add [multiarch support](https://wiki.debian.org/Multiarch/HOWTO) only when a game requires it.
{{< /note >}}

2. Create the directory for SteamCMD and change to it:
1. Create the directory for SteamCMD and change to it:

mkdir ~/Steam && cd ~/Steam

3. Download the SteamCMD tarball:
1. Download the SteamCMD tarball:

wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz

4. Extract the installation and runtime files:
1. Extract the installation and runtime files:

tar -xvzf steamcmd_linux.tar.gz

#### Add an Error Fix

{{< note >}}
When running a Steam game, you may encounter the following error:

/home/steam/.steam/sdk32/libsteam.so: cannot open shared object file: No such file or directory
Expand All @@ -213,17 +257,19 @@ The game server will still operate despite this error, and it should be somethin
mkdir -p ~/.steam/sdk32/
ln -s ~/Steam/linux32/steamclient.so ~/.steam/sdk32/steamclient.so

{{< /note >}}

## Run SteamCMD

1. Run the executable in a screen.
1. Run the executable in a screen session:

If you have installed SteamCMD from repositories:

screen ./steamcmd
screen ~/.steam/steamcmd

If you have installed SteamCMD manually:

screen ./steamcmd.sh
screen ~/Steam/steamcmd.sh

That will return an output similar to below and leave you at the `Steam>` prompt:

Expand All @@ -250,7 +296,7 @@ The game server will still operate despite this error, and it should be somethin

Steam>

2. Most Steam game servers allow anonymous logins. You can verify this for your title with Valve's list of [dedicated Linux servers](https://developer.valvesoftware.com/wiki/Dedicated_Servers_List#Linux_Dedicated_Servers).
1. Most Steam game servers allow anonymous logins. You can verify this for your title with Valve's list of [dedicated Linux servers](https://developer.valvesoftware.com/wiki/Dedicated_Servers_List#Linux_Dedicated_Servers).

To log in anonymously:

Expand All @@ -261,14 +307,22 @@ The game server will still operate despite this error, and it should be somethin
login example_user

{{< caution >}}
Be aware that some versions of the Steam CLI do **not** obfuscate passwords. If you're signing in with your Steam account, be aware of your local screen's security.
Some versions of the Steam CLI do **not** obfuscate passwords. If you're signing in with your Steam account, be aware of your local screen's security.
{{< /caution >}}

{{< note >}}
You can exit the `Steam>` prompt at any time by typing `quit`.
{{< /note >}}
## Exit SteamCMD

### Detach from the Screen Session

To exit the screen session which contains the Steam process *without* disrupting the Steam process, enter **Control+A** followed by **Control+D** on your keyboard. You can later return to the screen session by entering:

screen -r

For more information on managing your screen sessions, review our [Using GNU Screen to Manage Persistent Terminal Sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/) guide.

### Stop SteamCMD

3. To exit the screen session without disrupting the Steam process, press **CTRL + A** and then **D**. To resume, use the `screen -r` command. For more information, check out our guide on [how to use screen sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/).
To stop the Steam process and remove your screen session, enter `quit` at the `Steam>` command prompt, or enter **Control+C** on your keyboard.

## Next Steps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ description: 'This Counter Strike: Global Offensive (CS:GO) server guide contain
keywords: ["counter strike", "counter strike global offensive", "csgo", "cs:go", "csgo server", "csgo server hosting", " steam servers", "game servers", "games", "ubuntu", "ubuntu 14.04"]
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
published: 2016-02-25
modified: 2019-02-01
modified_by:
name: Linode
title: 'Launch a Counter Strike: Global Offensive (CS:GO) server on Ubuntu 14.04'
contributor:
name: Sam Mauldin
aliases: ['applications/game-servers/csgo-server-debian-ubuntu/','applications/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/']
aliases: ['applications/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/']
external_resources:
- '[Valve Developer Community - Counter-Strike: Global Offensive Dedicated Servers](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)'
- '[Valve Developer Community - Counter-Strike: Global Offensive Dedicated Servers](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)'
deprecated: true
deprecated_link: 'game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-18-04/'
dedicated_cpu_link: true
---

Expand Down Expand Up @@ -164,4 +165,4 @@ These settings are changed in the launch command.

### RCON

When logged into the server, you can open the RCON console with the backtick button (<code>`</code>), or your mapped key. To log in type `rcon_password` followed by your password. For more information regarding RCON, click [here](/docs/game-servers/team-fortress2-on-debian-and-ubuntu/#rcon).
When logged into the server, you can open the RCON console with the backtick button (`` ` ``), or your mapped key. To log in type `rcon_password` followed by your password. For more information regarding RCON, click [here](/docs/game-servers/team-fortress2-on-debian-and-ubuntu/#rcon).
Loading