Fistful of Frags

Fistful of Frags

Not enough ratings
Building a "dedicated" game-server, using Ubuntu (20.04 LTS), updated circa 2021
By [WL] Weasel (Probably AFK)
OBSOLETE:
!!! Do NOT use !!! See the NEW system (and guide) instead!!!!



Note: Portions of this guide are still very-much "under-construction"!

This guide will attempt to describe how to build a "dedicated" game-server using Ubuntu[en.wikipedia.org] - which may then be used to support several different games. Although the screen-captures included in this guide are from an installation of Ubuntu within a VMware Player[en.wikipedia.org] virtual machine, most of the guide is not specific to VMware; and could easily be applicable to installing Ubuntu onto other virtualization platforms - or directly onto computer hardware.

This guide essentially starts from the perspective of either:
  • I have an Ubuntu Server 20.04 DVD (or ISO image) and some hardware, now what?
  • I have an Ubuntu Server 20.04 DVD (or ISO image) and VMware Player, now what?
  • I have a rental VPS running Ubuntu Server 20.04, now what?

Relevance of various sections of this guide:

Anyone that may be using a rental "Virtual Private Server[en.wikipedia.org]" (VPS) from an Internet hosting provider (who obviously has already performed some basic installation of Ubuntu), may skip the following sections:
  • 5 - Creating the virtual machine
  • 6(a) - Installing Ubuntu
  • 6(b) - Installing Ubuntu (continued)
Anyone building their own server (including installing Ubuntu themselves), but not using VMware Player, may skip these sections:
  • 5 - Creating the virtual machine
Anyone installing Ubuntu onto some other virtualization platform, should still review those sections - to determine what equivalent actions may be required for the particular virtualization platform they are using.

In any of those cases above, be sure not to skip the section entitled "7 - Preparing Ubuntu". It contains steps for ensuring all the various prerequisites and utilities are installed - which are critical to later sections of this guide.

Links to external web-pages and stuff:

Where practical, this guide will provide links to Wikipedia[en.wikipedia.org] - for definitions of various terms, or information about various products or technologies. Some links to third-party web-pages (i.e. where to download or otherwise acquire various resources) may also be included - as deemed relevant.

Shameless self-promotion:

Whenever you see my stuff anywhere on Steam or YouTube, please rate it up!
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2404037915
   
Award
Favorite
Favorited
Unfavorite
1 - Assumptions & thinking
The big assumption!

Each section of this guide, makes the assumption that you have followed the prior sections. In particular, it is assumed that you have used the example ports and file-paths specified in earlier sections. If you stray from the examples, be sure to adapt later sections - using the values that were actually selected - instead of the example values.

Why Ubuntu?

Ubuntu[en.wikipedia.org] will generally work "right out of the box" (as the saying somewhat inaccurately goes). This is because it is the Linux flavor that Valve[en.wikipedia.org] has targeted for releases of its games on Linux. Other flavors of Linux may certainly be used. However, they may require additional work-arounds or special library upgrades.

This is not a "dis" against any other flavor of Linux. The author currently uses Mint[en.wikipedia.org] for a Linux gaming client computer, and Debian[en.wikipedia.org] for his dedicated game-servers, and has previously used Ubuntu[en.wikipedia.org], CentOS[en.wikipedia.org] and RHEL[en.wikipedia.org]. However, this guide presumes the reader may only have very limited Linux experience. So, picking the "easiest" solution for this guide was an important consideration. Hence, Ubuntu[en.wikipedia.org].

That being said, the specific version of Ubuntu selected for this guide is 20.04 "LTS". "LTS" is a Ubuntu[en.wikipedia.org] designation for "long-term support".

This guide uses version 20.04, but several Internet hosting providers (who rent Virtual Private Servers[en.wikipedia.org]) are still only offering the older versions of "LTS". Over time, that will likely change. However, as of the creation-date of this guide, some may still only offer 16.04 or 18.04 - not 20.04.

Where to get Ubuntu?

The server edition of Ubuntu may be downloaded from their server releases[www.ubuntu.com] web-page. To find a specific version, refer to their previous releases[releases.ubuntu.com] page. As previously mentioned, version 20.04 was used during the creation of this guide. The latest version may be downloaded from this page[releases.ubuntu.com]. In particular, below are download links for ISO-format[en.wikipedia.org] images of the installation disks:
Of course, if you are going to be renting a VPS from a hosting-provider, you generally do not need to "get" the operating system (OS). They will do the installation of the OS (presumably Ubuntu or some similar Linux) and when completed, just deliver to you:
  • The IP Address of the server.
  • What username to use to access the server.
  • What password to use with that username.

VMware Player?

VMware Player[en.wikipedia.org] was used during the creation of this guide - party because it allowed the installation of Ubuntu without replacing the existing operating system of the author's computer. This also made it easy to gather screen-captures - to document various points in the installation and configuration process. Specifically, the free (for non-commercial use) version of VMware Player was used.

Some people may also find it convenient to have a virtual machine[en.wikipedia.org] which they can turn on when they need it, turn off when they do not need it, and copy or move from one physical computer to another as needed.

As mentioned in the description for this guide, there is no requirement to build a "dedicated" game server under VMware Player, or as any form of virtual machine. Ubuntu may be installed directly on physical computer hardware. It was simply convenient during the creation of this guide to use a virtual machine.

Where to get VMware Player?

The free (for non-commercial use) version of VMware Player may be downloaded from here[my.vmware.com].

Additional assumptions:

Stuff used throughout this guide:
  • The Ubuntu operating system "hostname": "game-server"
  • The Ubuntu operating system description: "Game Server"
  • The "logon-name" (aka "user-name", or "user account") for Ubuntu: "game-server"
  • The "game-server" account description/display-name: "Game Server"
  • The "game-server" account password: "n0t.Passw0rd!"
  • The "game-server" account "home-directory": "/home/game-server"
This guide will assume that the intention is to build a game-server which will be capable of hosting several simultaneous games. This will include the planning associated with ensuring each game-server does not conflict with the other, or with game-clients on the same network.

Although the planning will include examples for multiple simultaneous games, not every installation example will be fully-documented. Specifically, dedicated servers for Fistful-of-Frags (FoF) will be used as the primary installation example.

The Standard Examples
The standard examples used throughout the balance of this guide will be:
2 - Planning: System requirements
Recommend minimum system specifications:

Below are the specifications recommended by the Author (of this "guide"). These assume the "server" edition of a Ubuntu installation will be used. In other words, the installation will not include any "desktop" or "GUI", and instead will be a stripped-down / minimalist installation - with only a text-mode command-line interface on the console (plus remote "SSH" support).
  • CPU / Processor Architecture: 64-bit ("amd64" or "x86_64") is required. Ubuntu no longer supports the older 32-bit ("i386" or "x86") type of hardware (or VM). Also, avoid anything that says "IA64" - which is another older no-longer-supported 64-bit architecture. Be aware that a lot of game-related code that runs on the server is 32-bit only. Consequently, since you are running on a 64-bit installation, you may need to enable something called "multi-architecture[help.ubuntu.com]" (for Ubuntu or newer Debian releases) or load "32-bit libraries" (for older releases, or other Linux flavors).
  • CPU / Processor (Specs): At least 2 "cores" or hyperthreads or virtual-CPU's. Speed (in GHz) will not be as important as the ability of the server to multi-task various operations - servicing hosted game(s) simultaneously with all operating system and utility processes. If you are planning to host multiple games simultaneously on the same server, a very general (and admittedly somewhat overkill) rule-of-thumb is:
    • 1-core: For lousy game-servers, that are only occasionally in use for hosting small private matches, probably on a local-area-network (LAN) entirely within your house or office.
    • 2-cores: Good single-game dedicated full-time game-server. Generally also be tolerable for hosting possibly two (2) simultaneous games.
    • 4-cores: Good for hosting at least four (4) simultaneous games.
    • 6-cores: Good for hosting at least six (6) simultaneous games.
    • 8-cores: Good for hosting at least eight (8) simultaneous games.
  • RAM / Memory: At least 2GB of RAM - probably more if multiple games will run simultaneously on the same game-server. For each additional game you plan to have simultaneously running, plan to add an additional 384MB , 512MB, 768MB or even 1GB even of RAM. Exactly how much you will need to add, will depend largely on the exact game(s) involved - and how-many simultaneous players ("player slots") will be possible. Some games are heavier on memory utilization than others, and many consume additional memory as the concurrent player-count goes up. Of course, if you are hosting on a physical computer, you are probably not going to have anything with less than 4GB of RAM anyway.
  • Hard Drive / Storage: At least 100GB of drive space - more if multiple games will installed on the same game-server (even if they are not left running simultaneously). The "dedicated server" footprint of some games is relatively light (<=4GB), while others can be larger (~12GB to ~16GB). Also, if you later start installing various server-side "modifications" and "custom content" (maps, models/skins, music, etc.), things can grow very quickly. If you are planning to rent a VPS to use as a game-server, I would suggest at least 100GB of storage - unless you are certain your needs will never grow later.
3 - Planning: Network "ports"
Each game-server instance potentially needs up to four unique "UDP ports" to operate properly. In some cases, the game-server will automatically assign port numbers which work properly without being explicitly specified. In other cases, the ports that are automatically chosen may not work properly - due to running multiple game-server instances, or due to having game-servers and game-clients behind the same Internet router/firewall device.

Internet connectivity & "ports":

In order to ensure the incoming game-related traffic from the Internet gets consistently directed to your game-server, there are typically several steps required:
  • Explicitly configure the ports for each game-server instance to use particular assigned values.
  • Ensure the values assigned for each port are both unique, and are outside the normal/default range for game-clients.
  • Ensure the game-server (virtual machine, or physical server) has either a "static" IP address; or if it uses a "dynamic" IP address, ensure that is has a "reservation"- so that it (in effect) never changes. Consequently, you may need to refer to your Internet router's documentation to determine how to setup a "DHCP Reservation" for your game-server.
  • Configure "port-forwarding[portforward.com]" on your Internet router to send all incoming traffic for those explicitly configured ports to your game-server's IP address. This guide will not attempt to describe how to configure port-forwarding[portforward.com] for any particular router - due to the wide variety of router models in existence. This guide will only describe what ports should be forwarded - not how to accomplish that forwarding. See the web-site http://portforward.com if you need assistance configuring port-forwarding for your Internet router.
Note: If you are renting a Virtual Private Server[en.wikipedia.org] (VPS) from an Internet hosting provider, you still need to ensure that all the ports you assign for each game-server instance are unique. However, you likely will not have to contend with "port-forwarding" - since your VPS will likely have it's own directly-applied public "registered" Internet IP address - instead of the "address-translation[en.wikipedia.org]" technology typically involved in residential or small-business locations.

Port-related settings for Source / HL2-based games:

Some examples of games using the Source Engine[en.wikipedia.org]:
  • Fistful of Frags (FoF)
  • Team Fortress 2 (TF2)
  • Counter-Strike:Global Offense (CS:GO)
  • Counter-Strike:Source
  • Half-Life 2 Multiplayer (HL2MP)
List of port-related settings (CVAR's) for games based-on the Source Engine[en.wikipedia.org] (sometimes referred to as the "HL2" engine):
  • +port (command-line) or port (autoexec.cfg) = Port that game-clients use to talk to the game-server. These should be explicitly configured, and may also need to be "port-forwarded" at your Internet router/firewall.
  • -steamport (command-line) or steamport (autoexec.cfg) = Port that various Valve-hosted "Steam" stuff uses to communicate with game-servers. These should be explicitly configured, and may also need to be "port-forwarded" at your Internet router/firewall.
  • +clientport (command-line) or clientport (autoexec.cfg) = Port that game-servers use to talk to various Valve-hosted "Steam" stuff.
  • +tv_port (command-line) or tv_port (autoexec.cfg) = "SourceTV" mass-spectator port. I generally recommend disabling "SourceTV" (using the -nohltv option), unless you know what you are doing. If so, you may need to explicitly configure this port.

Port-related settings for GoldSrc / HL1-based games:

Some examples of games using the GoldSrc Engine[en.wikipedia.org]:
  • Counter-Strike (the original)
  • Team Fortress Classic (TFC)
  • Deathmatch Classic (DMC)
  • Half-Life Multiplayer (HL1)
List of port-related settings (CVAR's) for games based-on the older GoldSrc Engine[en.wikipedia.org] (sometimes referred to as the "HL1" engine):
  • +port (command-line) or port (autoexec.cfg) = Port that game-clients use to talk to the game-server. These should be explicitly configured, and may need to be "port-forwarded".
  • -sport (command-line) or sport (autoexec.cfg) = Port that various Valve-hosted "Steam" stuff uses to communicate with game-servers. These should be explicitly configured, and may also need to be "port-forwarded" at your Internet router/firewall.
  • +clientport (command-line) or clientport (autoexec.cfg) = Port that game-servers use to talk to various Valve-hosted "Steam" stuff.
  • +tv_port (command-line) or tv_port (autoexec.cfg) = "SourceTV" mass-spectator port. I generally recommend disabling "SourceTV" (using the -nohltv option), unless you know what you are doing. If so, you may need to explicitly configure this port.

Sample port-assignment strategy:

Note: Due to a "feature" of how the Steam-related ports are utilized (which mysteriously adds 1 to whatever port is specified), it is recommended to only use "every-other ports" - or to put it another way, i.e. only even-number or only odd-number ports.

A simple port-assignment strategy is to assign ports in ranges - and within that range categorized by what purpose that port is assigned. This will simplify any later "port-forwarding[portforward.com]" that may be required.

For example "port-forwarding[portforward.com]" could be easily handled with the range of UDP ports 6000-6299, using the following plan:
  • Game client-server ports (+port): 6001 to 6099
  • Steam ports (-steamport or -sport): 6101 to 6199
  • Game-server "client" port (+clientport): 6201 to 6299
  • SourceTV / HLTV = disabled entirely (using the -nohltv option)
That strategy results in a port-assignment list, such as this:

Game-Port
Steam-Port
Client-Port
Game Server
6001
6101
6201
Fistful-of-Frags (1 of 2)
6003
6103
6203
Fistful-of-Frags (2 of 2)
6005
6105
6205
Team Fortress 2
6007
6107
6207
Counter-Strike:Source

The port-assignment strategy described above will be used in all subsequent examples.

Of course, you can make-up your own strategy - as long as you keep track of each of the ports you are assigning for each game-server instance you will be running.

If you will only be running one game-server instance for one game - you probably will not have much trouble.
4 - Planning: Folders / Paths
There will be several different components which will need a designated place to be installed, or store their related contents or use as a working-area.

Cautionary Notes:

  • The terms "folder" and "path" used effectively interchangeably throughout this guide.
  • Remember that the file-system under Ubuntu (unlike Windows) is case-sensitive!
  • Whenever possible, name all files entirely in lower-case!
  • Whenever possible, name all folders entirely in lower-case!
  • Remember that multiple files may exist with the same spelling - but different case!
  • For example: "modt.txt", "MOTD.txt" and "MOTD.TXT" will be treated as three different files!
  • This guide assumes you are installing and running all game-related stuff under the "game-server" logon created during the sample installation instructions included in this guide.
  • Never, never, never run games (or much of anything else) under the built-in "root" logon!

Regarding the "~" character:

Under Ubuntu, the tilde "~" character (when used in specifying file paths/folders) is an alias for the "home-directory" of the currently-logged-on user. For example, while logged-on as the "game-server" user:

Entry
Actual Folder
~
/home/game-server
~/
/home/game-server/
~/steamcmd
/home/game-server/steamcmd
~/scripts
/home/game-server/scripts

Consequently, you may see "~" used in various command-line examples, or sample scripts throughout the rest of this guide. However, do not confuse the use of "~" in file paths on the server, with the in-game usage of it - where it is generally used to open or close the "developer console" in various game-clients.

Special folders:

  • As mentioned above, the "home-directory" of the user-account that all the game-related stuff will be installed by and later operating under is critical. Assuming the example "game-server" logon is being used, the "home-directory" folder would be "/home/game-server". Going-forward most of the work being done to build the game-server will involve files stored somewhere inside this "home-directory" ("/home/game-server").
  • The Valve-provided "SteamCMD" utility, will be installed into the "steamcmd" sub-folder of the home-directory (effectively "/home/game-server/steamcmd").
  • A sub-folder of the "home-directory" will be used for various maintenance and utility scripts that will be detailed later in this guide. That folder will be: /home/game-server/scripts"

Per-game "Installation" folders:

Each game-server instance will be installed into its own sub-folder of the "home-directory". Each game-server installation folder will be named for what type game-server it contains, and a number (to allow for multiple installations of the same game). Based on our standard examples, these will be:

Game-Server
Folder
Fistful-of-Frags (1 of 2)
/home/game-server/game-fof-1
Fistful-of-Frags (2 of 2)
/home/game-server/game-fof-2
Team Fortress 2
/home/game-server/game-tf2-1
Counter-Strike:Source
/home/game-server/game-css-1

Summing-up the folder strategy:

Using the folder-assignment strategy detailed above, results in a folder structure like this:

Folder
Usage
/home/game-server
home-directory of the "game-server" logon
/home/game-server/steamcmd
Location of the "SteamCMD" utility
/home/game-server/Steam
Created by "SteamCMD" utility (do NOT delete!)
/home/game-server/game-fof-1
Fistful-of-Frags (1 of 2)
/home/game-server/game-fof-2
Fistful-of-Frags (2 of 2)
/home/game-server/game-tf2-1
Team Fortress 2
/home/game-server/game-css-1
Counter-Strike:Source
/home/game-server/scripts
Various scripts for managing the game-servers

Combining the per-game "folder" assignments from above, with the per-game "ports" assignments from the previous section:

Game-Port
Steam-Port
Client-Port
Game Server Path
Game Server
6001
6101
6201
/home/game-server/game-fof-1
Fistful-of-Frags (1 of 2)
6003
6103
6203
/home/game-server/game-fof-2
Fistful-of-Frags (2 of 2)
6005
6105
6205
/home/game-server/game-tf2-1
Team Fortress 2
6007
6107
6207
/home/game-server/game-css-1
Counter-Strike:Source
5 - Creating the virtual machine
Note: If you are not using Ubuntu installed inside a VMware virtual machine, you may skip this section.

This section covers creation of an empty virtual machine[en.wikipedia.org], to install Ubuntu into for the purposes of building the "dedicated" game-server. The "free" (for non-commercial use) version of VMware Player (available here[my.vmware.com]) was used during the creation of this guide. However, any virtualization platform will probably have equivalent steps.

Note: If you are renting access to a Virtual Private Server[en.wikipedia.org] (VPS) that already has Ubuntu installed, you should be able to skip this section entirely. Likewise if you will be installing Ubuntu directly onto computer hardware. However, if you are installing into some other virtualization platform (instead of VMware Player), you should probably review this section to determine what equivalent steps may be required on your chosen virtualization platform.

Upon opening VMware Player, click on the option to "Create a New Virtual Machine".


On the first page of the "New Virtual Machine Wizard" screen, select the option "I will install an operating system later", and then click the "Next" to proceed.


Select "Linux" from the "Guest operating system" list, select "Ubuntu 64-bit" from the "Version" drop-down list, and then press the "Next" button to proceed.


Enter a hostname for your server. This is not the "hostname" that appears in-game on the game-servers list. This is your computer's "Network Hostname". This a unique identifier for this computer on your network. Ideally, choose are short name (<12 characters), containing combinations of only these types of characters:
  • Lower-case letters "a" through "z"
  • Numerals "0" through "9"
  • A hyphen "-"
Under "Location" is the location on your computer's hard drive where the virtual machine will be created. The default is probably "C:\Virtual Machines". You may use the "Browse" button to change this path as desired. Then, press the "Next" button to proceed.


Adjust the value of "Maximum disk size" as needed. Be sure not to exceed the amount of free disk space you have on the host computer. Regarding the option of using single or multiple files to store the virtual disk, if unsure select "Split virtual disk into multiple files". Then, press the "Next" button to proceed.


Click the "Customize Hardware" button, to access additional screens that will need to be properly configured.


Click "Memory" in the list on the left-side of the panel, and then adjust the memory size as needed (4096MB / 4GB in the example).


Click "Processor" in the list on the left-side of the panel, and then adjust the number of virtual processors/cores on the host that this virtual machine will have access to (Two (2) in the example).


Click "CD/DVD" in the list on the left-side of the panel, and ensure that the "Connect at power on" option is enabled/checked. Ensure the "Use ISO image file" option is selected, and then use the "Browse" button to select the ISO image for the Ubuntu installation disk that you (presumably) already downloaded.


Click "Network Adapter" in the list on the left-side of the panel, and ensure that the "Connect at power on" option is enabled/checked. Ensure that the "Network connection" option is set to "Bridged".


Feel free to click "USB Controller", "Sound", Printer" and/or "Screen" sections as well. However, they will likely have little or no consequence to your installation. Click the "Close" button to return to the "New Virtual Machine Wizard" screen.


Click the "Finish" button on the "New Virtual Machine Wizard" screen - to save the virtual machine configuration.


At this point, you have a blank virtual machine. This is equivelant to having computer hardware physically assembled - and ready for an operating system install.
6(a) - Installing Ubuntu
If you are installing Ubuntu directly onto physical computer hardware, just put the "Ubuntu Server" installation disc into your CD/DVD drive, and turn on the computer.

If you are continuing the from the previous sections of this guide using VMware Player, the ISO file you specified (which was explicitly set to "Connect at power on") will in-effect already be "in" the virtual CD/DVD drive. Consequently, for VMware Player you should be able to just click the Play button or double-click the virtual machine in VMware Player.

Once the virtual machine is running, you must click (with your mouse) inside the virtual machine window - to send your keystrokes to whatever is going-on inside that virtual machine. To get back out of the virtual machine, you may tap CTRL+ALT keys - which will return control of the keyboard to Windows. That is a VMware Player feature / function - nothing specific to Ubuntu.

Note: Since this is a Ubuntu "server" install, there will be no "GUI" (or likely any mouse-driven menus) during the installation process. Generally, the following keys are used:
  • The Arrow / Directional keys (Up, Down, Left & Right) generally move up and down various lists - and sometimes from one item on a screen to another.
  • The Tab key generally moves between different areas on the screen.
  • The Enter or Return key generally accepts whatever is selected on-screen - and typically advances to the next screen.
  • The Esc key generally cancels a screen, or backs-out of a selection.
The Ubuntu installer will flash through a number of start-up screens, and then stop to prompt for language selections. This first language prompt is to let the installer know what language to use during the installation process itself. Highlight the desired language (by moving around the list with the Up / Down arrow keys), and press Enter to select the language and continue the installation process.


On the next screen, select the locale (Country) of your keyboard from the list provided. Most likely, the selection matching your locale will already be selected on the list. Highlight the proper locale (by moving around the list with the Up / Down arrow keys), then select Done and press Enter to select the select the locale and continue the installation process.


The next screen will prompt for what IP address details to use for your machine's network interface. The default is to use an IP address automatically ("dynamically-assigned" or "DHCP") by your network router. You can manually over-ride that with a "statically-assigned" IP address if needed. Select Done and press Enter to continue the installation process.


The next screen will be a prompt about requiring a proxy-server to access the Internet. Unless you know this is required for your network, assume it is not required. Select Done and press Enter to continue the installation process.


The next screen will be a prompt about requiring which official "mirror" the installer should use to pull the Ubuntu installation files from. Unless you have some known reason to change this, use the default. Select Done and press Enter to continue the installation process.


The next screen will be a prompt regarding how the hard-drive should be paritioned. Unless you have some known reason to change this, use the defaults. Select Done and press Enter to continue the installation process.


The next screen will display various partitioning settings that will be used, based on input from the previous screen. Unless you have some known reason to change this, use the defaults. Select Done and press Enter to continue the installation process.


The next screen will ask for a confirmation to proceed with the installation (since it will erase everything on the existing hard-drive). Select Continue and press Enter to continue the installation process.


The next screen will prompt for the server "hostname" and "user-profile" information.

This is not the "hostname" that appears in-game on the game-servers list. This is your computer's "Network Hostname". This a unique identifier for this computer on your network. Ideally, choose a short name (<=15 characters), containing combinations of only these types of characters:
  • Lower-case letters "a" through "z"
  • Numerals "0" through "9"
  • A hyphen "-"

Also on this screen, you will enter the full name (or description) of the user to display for this new "user account". This can be any descriptive text you care to use.

Also on this screen, you will enter "user-name" (or "logon name") - which you will utilize later to logon to the server (on the physical/virtual console, via SSH/PuTTY[en.wikipedia.org], and later via "webmin[en.wikipedia.org]"). Ideally, choose a short user-name (<12 characters), containing combinations of only these types of characters:
  • Lower-case letters "a" through "z"
  • Numerals "0" through "9"
  • A hyphen "-"

Also on this screen, you will select a password that will be used to logon with the "user-name" that was just specified. While entering the password, it will not be shown on-screen. Instead, only asterisks ("*") will be shown on-screen.

Note: While entering the password, it will not be shown on-screen. Instead, only asterisks ("*") will be shown on-screen. Be sure to choose a "strong" password, generally meeting these requirements:
  • At least eight (8) characters - the longer the better.
  • A combination of both UPPER-CASE and lower-case letters.
  • At least one numeral ("0" - "9"),
  • At least one special character (punctuation mark of some kind),

Fill-out the required fields, and then select Done and press Enter to continue the installation process.


The next screen will provide the option to enable SSH on your server. Unless you have some known reason to specifically NOT do so, check the box for Install SSH server, then select Done and press Enter to continue the installation process.


The next screen will provide the option to install various other common Linux servers function. None of these are relevant to setting-up dedicated game-server. So, select Done and press Enter to continue the installation process.

6(b) - Installing Ubuntu (Continued)
The installer will then begin the process of actually installing Ubuntu's various files onto the hard-drive, and downloading updated packages/patches from the Internet as needed.


Once the installation is sufficiently completed, the Reboot Now option will show-up, which you will then select and press Enter to reboot the server.


If you are installing on a physical computer, you will need to remove the installation CD/DVD when prompted, and then press Enter to allow the reboot to occur. If you are running under VMware Player, you may just press Enter to allow the reboot to occur.


When the reboot completes, a bunch of start-up messages may be displayed. Allow a few minutes for those to complete. You may then, press Enter to get a login-prompt.


You may then, press Enter to get a login-prompt. At this point, you may logon using the user-name and password specified during the installation process.

7(a) - Preparing Ubuntu
Readiness Check:

Review the following items before you proceed any further:
  • Ubuntu must already be installed at this point. Either you installed it yourself into a virtual machine, or directly on to computer hardware; or you are renting a Virtual Private Server[en.wikipedia.org] (VPS) that already has Ubuntu installed.
  • Either during the installation process (if you installed Ubuntu yourself) or after that process (if you are renting a VPS), a user-account was created to use other than "root" - which will be used for installing and running the game-servers. Based on previous sections, this section assumes that non-root user-account is named "game-server". If you are using a rental VPS and have not created a non-root user-account yet, stop and create it now - and ensure it has "sudo" privileges.
  • If you are renting a VPS, and have not created a non-root user-account yet, you may use this command (while logged-in as "root") to create such an account:
    adduser game-server;
    Of course, followed by Enter - and then follow the prompts to select a password, provide a display-name / description, etc.
  • If you are renting a VPS, and have just now manually created a non-root user-account ("game-server"), it likely will not yet have "sudo" privileges - which will be required to complete many of the "preparation" steps in this section. In that case, the following command may be used to grant "sudo" access:
    sudo adduser game-server sudo;
    Of course, followed by Enter.

Logon to Ubuntu (with that non-root account):

Login to Ubuntu using either:
  • The console (if installed directly on hardware),
  • The virtual machine in VMware Player (used for example screen-captures), or
  • Using PuTTy[en.wikipedia.org] to connect over SSH (if using a rental VPS).
From this point forward, all commands should be available while logged-in via any of those three methods. Login using the non-root user-account (presumably named "game-server"):



Apply the latest updates for Ubuntu:

To apply the latest updates for Ubuntu, you must first tell the update system ("apt[en.wikipedia.org]") to refresh its list of what updates are available. Enter the following command, followed by Enter:
sudo apt-get update;
Note: As a security measure, sudo may prompt you again for the password of the account being used ("game-server")


Now that the list of available updates is known to "apt[en.wikipedia.org]", the latest updates may be downloaded and installed by using the following command, followed by Enter:
sudo apt-get upgrade -y;
Note: As a security measure, sudo may prompt you again for the password of the account being used ("game-server")

Before "apt[en.wikipedia.org]" actually installs the updates on to the server, it may prompt for verification to proceed. If it does, type "y" and then Enter to proceed with the installation of the updates.

Note:You can suppress the verification prompt by including the "-y" parameter in the command-line.


After the "apt[en.wikipedia.org]" finishes updating the server, you should reboot the server to ensure all new updates are effect before continuing. The server may be rebooted from the command-line by using the following command, followed by Enter:
sudo reboot;
Note: As a security measure, sudo may prompt you again for the password of the account being used ("game-server")

7(b) - Preparing Ubuntu (continued)
Installing additional utilities:

Log back into the server again using the non-root user-account ("game-server"):

At this point a number of additional utilities will be be installed. Some of these are absolute prerequisites (to having SteamCMD or the games themselves install or operate correctly), or just prerequisites for later sections of this guide (regarding "webmin[en.wikipedia.org]" for example).

Below is a list of what the specific utilities will be installed:
  • tar[en.wikipedia.org] <-- Actually, must already be installed. However, it never hurts to add it to list anyway.
  • gzip[en.wikipedia.org] <-- Actually, should already be installed. However, it never hurts to add it to list anyway.
  • ncompress[en.wikipedia.org] <-- A commonly-used compression utility, possibly still required by SteamCMD and/or Source[en.wikipedia.org] or GoldSrc[en.wikipedia.org].
  • bzip2[en.wikipedia.org] <-- Another common compression utility, often used for in-line compression of custom-content downloads in Source[en.wikipedia.org].
  • zip & unzip[en.wikipedia.org]<-- Another common compression utility.
  • p7zip (full)[en.wikipedia.org] <--- command-line version of the ultimate compression / archiver tool, used in example scripts.
  • nano[en.wikipedia.org] <-- An easy-to-use "character-mode" text-file editor.
  • elinks[en.wikipedia.org] <-- A "character-mode" web-browser, useful for finding stuff on the Internet and directly downloading it onto the server (when "wget[en.wikipedia.org]" is not enough).
  • screen[en.wikipedia.org] <-- A utility for running processes "disconnected" and being able to re-connect to them later, used extensively in example scripts.
  • net-tools[wiki.linuxfoundation.org] <-- A utility for showing various IP configuration details, etc. Required to display the server's IP address.
  • LibGCC[wiki.osdev.org] (specifically lib32gcc1) <-- Prerequisite for SteamCMD.
  • webmin[en.wikipedia.org] <-- A web-based management portal, example usage in a later section.

"apt[en.wikipedia.org]" can download and install many of these packages directly from Ubuntu's "official" repositories. Also "apt[en.wikipedia.org]" can download and install many packages at the same time - as part of the same command-line.

First, install the easy stuff, with one big "apt[en.wikipedia.org]" command, followed by Enter:
sudo apt-get install -y tar gzip ncompress zip unzip bzip2 p7zip-full nano elinks screen net-tools lib32gcc1;
Note: As a security measure, sudo may prompt you again for the password of the account being used ("game-server"). Also, apt[en.wikipedia.org] may prompt for verification before proceeding with the installation. If so, type "y" and then Enter to proceed.


Installation of "webmin":

Next, use one big "apt[en.wikipedia.org]" command (followed by Enter) to install various prerequisites for webmin[en.wikipedia.org]:
sudo apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python;


Use this command to import the official "signing-key" for webmin[en.wikipedia.org] packages:
wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add;


Once the above prerequisites are installed, webmin[en.wikipedia.org] itself may be downloaded and installed using the following commands (each followed by Enter):
wget http://www.webmin.com/download/deb/webmin-current.deb; sudo dpkg --install webmin-current.deb;


The sections of the guide relevant to webmin[en.wikipedia.org], are still further ahead. However, before you can actually use webmin[en.wikipedia.org], you will need to know the IP address of your server. You can display the IP information for your server, using the "ifconfig" command, followed by Enter.

8 - Installing SteamCMD
Installing Valve's "SteamCMD" utility:

Valve's SteamCMD utility is used to download and install "dedicated server" portions of various games that are available on Steam. Not every game available on Steam has a "dedicated server" available. However, most games based on either Source[en.wikipedia.org] or GoldSrc[en.wikipedia.org] typically do have a "dedicated server" component.

Obviously, the SteamCMD utility itself must be installed - before it can be used to install any "dedicated server" components for any games.

Use the following commands (each followed by Enter) to download the SteamCMD installer onto your Ubuntu server:
cd ~; pwd; mkdir steamcmd; cd ~/steamcmd; wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz; tar -xvzf steamcmd_linux.tar.gz;


Those commands should result in additional files (essentially SteamCMD[/i]) being added to the "~/steamcmd" folder (effectively "/home/game-server" folder). The "ls -lh" command (followed by Enter) may be used to list the contents of that folder.

To install SteamCMD, run the installer script with the command:
sudo ./steamcmd.sh;

This will essentially result in SteamCMD updating itself to the most current version - and then opening it's own "Steam>" command-prompt.


With the "Steam>" command-prompt, enter these commands (followed by Enter) to logon once to the Steam content system ("SteamPipe") - just to ensure communication is working properly, and then exit SteamCMD:
login anonymous quit

9 - Editing files with "nano"
One of the most critical tasks related to configuring dedicated game-servers, is being able to edit the contents of many different text files. Although these files may be in different locations, and have different file-name extensions (.txt, .ini, .cfg, and .sh) - they are generally all plain-text.

In addition, the creation of various utility scripts also obviously necessitates access to some form of text editor.

This guide will cover using two different methods for creating and editing text files:
  • Editing files from the command-line (either on the "console" or remotely connected via PuTTy[en.wikipedia.org]/SSH) - using the character-mode text-editor named "nano[en.wikipedia.org]" (which was installed during a previous section of this guide).
  • Managing and editing files from a web-browser - using the "Webmin[en.wikipedia.org]".
This section of the guide will focus on using "nano[en.wikipedia.org]" to create and edit text-files.

After logging-into the server, you may use the "pwd" (print-working-directory) command, to show the current working folder/directory:
pwd;
You may also use the "ls" command, to list the contents (files and sub-directories) of the current working directory:
ls -lah;
To open "nano[en.wikipedia.org]", you just the "nano" command followed-by the name of the file you want to create (or existing file you want to edit). For example:
nano testfile.txt;


Inside "nano[en.wikipedia.org]", you can type whatever text is required, and use typical keyboard keys to navigate (up, down, left and right arrow keys, BACKSPACE key, ENTER key, etc.).

"nano[en.wikipedia.org]" uses CTRL-key combinations for special functions, such as to save the file (CTRL+O) and to exit the editor (CTRL+X).


When you press CTRL+O to save your changes, "nano[en.wikipedia.org]" will prompt enter a name for the file. This will default to whatever file you specified at the command-line, but you may change it to something else if desired before pressing ENTER to save the file.


After successfully saving the file, "nano[en.wikipedia.org]" will display how many lines were written to the file (or an error message if for some reason it could not save the file).


When you are finished editing a file, you use the CTRL+X key-combination to exit the editor.

You may also use the "cat" command to display a files contents without opening it in an editor, although this is less useful for really long files.

10 - Accessing and using "Webmin"
Signing-into Webmin the first time:

The "Webmin[en.wikipedia.org]" system makes it very easy for novices to manage various aspects of the underlying Linux operating system (Ubuntu in this case).

It is accessed using any modern web-browser. In the examples in this guide, the latest version of Google Chrome is used.

To access Webmin[en.wikipedia.org] for your server, enter the following URL into your web-browsers address-bar - being sure to substitute your servers actual IP address instead of the "192.168.187.196" shown in the example. Be sure to start the URL with "https://" and end the URL with ":10000":

By default, Webmin[en.wikipedia.org] uses a self-signed certificate for browser encryption. This will typically cause a web-browser to display a certificate warning screen. Consequently, you may have to click on "Advanced" (in the case of [g]Google Chrome[/b]) or some similar action in order to get the option to proceed to the web-site.


Once the option to Proceed to the web-site is available, click it to continue to the web-site.


Next, the login-screen will be presented. Provide the user-name and password created earlier to login to the system, and click "Sign in".


After logging-into the system, the default Webmin[en.wikipedia.org] screen will look something like this:



Editing files with "Webmin":

One of the most critical tasks related to configuring dedicated game-servers, is being able to edit the contents of many different text files. Although these files may be in different locations, and have different file-name extensions (.txt, .ini, .cfg, and .sh) - they are generally all plain-text.

In addition, the creation of various utility scripts also obviously necessitates access to some form of text editor.

This guide will cover using two different methods for creating and editing text files:
  • Editing files from the command-line (either on the "console" or remotely connected via PuTTy[en.wikipedia.org]/SSH) - using the character-mode text-editor named nano[en.wikipedia.org] (which was installed during a previous section of this guide).
  • Managing and editing files from a web-browser - using Webmin[en.wikipedia.org].
This section of the guide will focus on using Webmin[en.wikipedia.org] to create and edit text-files.

Once you have successfully logged-into Webmin[en.wikipedia.org], click the Tools menu on the left-side pane, and then select File Manager from the expanded menu.

That will open-up the File Manager feature in the right-side pane, which is fairly easy to understand.

You may expand the directory listing by clicking on Home, and then game-server to show the contents of the /home/game-server directory.


To create a new file in the currently-displayed folder, click the File button on the top menu, and then select Create new file from the drop-down list.


It will then prompt you to enter a name for the new (initially blank) file, and click Create to proceed.


A pop-up window will be displayed that is effectively a text-editor. You may enter whatever text required, using the keyboard. You may use keyboard navigation keys (up, down, left-right arrow keys), editing keys (BACKSPACE, INS, DEL) as you would expect. Likewise, you may highlight text using your mouse, and cut-and-paste as normal.

When you are completed editing the file, you may click the disk-icon to save the changes, and the "X" in the corner to close the editor window.


To edit an existing file, right-click on it with your mouse, and select the Edit option.



Making a file "Executable":

For newly-created script files (typically ending with a .sh extension), you will not be able to "run" ("execute") them without first changing the permissions on them to let Linux (in this case Ubuntu) know that they are "executable".

In the Webmin[en.wikipedia.org] File Manager feature, this is accomplished by right-clicking on the script-file with your mouse, selecting Change Permissions from the Properties pop-up menu, and then checking the proper Execute box, and then clicking Change.

11 - Installing game-servers
Regarding Valve's SteamCMD utility:

The SteamCMD utility is used to install "dedicated servers" for various games that are available on the Steam distribution platform. However, not every game has a stand-alone "dedicated server" component available. Also, not every game that has a stand-alone "dedicated server" component available - offers it for free. In some cases, a copy of the (non-free) game must be purchased - in order to host a "dedicated server" for it.

Certain commands within the SteamCMD utility's "Steam>" prompt require you to logon with a Steam account. Typically, these are commands that are used to download, install or verify game-related content (which is generally subject to various copyright or licensing terms). The two cases generally are:
  • If a game distributed on Steam offers a "dedicated server" component, and it offers that component for free, then the generic "anonymous" logon is used. Both Fistful of Frags (FoF) and Team Fortress 2 (TF2) are examples of that situation.
  • If a game distributed on Steam offers a "dedicated server" component, but it does not offer that component for free, then you must logon within SteamCMD with a "real" Steam logon (like you would on a client to play that game). In this case, the Steam logon used must "own" that particular game. Counter-Strike (the original) is an example of that situation.

Got an "AppID" for that?

All games available through Steam are assigned one or more unique ""AppID's". You must know the "AppID" of a game, in order to install a "dedicated server" for it using SteamCMD. Generally, a game will have separate "AppID's" for the game-client, and game-server (if available at all). Some examples of this include:

AppID-Client
AppID-Server
Game Server
265630
295230
Fistful-of-Frags
440
232250
Team Fortress 2
240
232330
Counter-Strike:Source

Generally, in cases where the game-client is not free, typically whatever Steam account has purchased / licensed that game-client is automatically granted access to the equivalent game-server component - even though the "AppID's" are different. In some cases, even if the game-client is not free, the publisher will allow installation and usage of dedicated servers without having to link it to a licensed Steam account. Counter-Strike:Source is an example of a game-client that is purchased/non-free, while it's game-server is free - and is installed using the "anonymous" Steam logon.

Where does all this stuff go?

Another key piece of information that you will need for each installation, is where SteamCMD should install it - meaning, in what folder / path.

You may remember, that was part of the initial planning, detailed in earlier sections of this guide:

Game Server Path
Game Server
/home/game-server/game-fof-1
Fistful-of-Frags (1 of 2)
/home/game-server/game-fof-2
Fistful-of-Frags (2 of 2)
/home/game-server/game-tf2-1
Team Fortress 2
/home/game-server/game-css-1
Counter-Strike:Source

Putting it all together, and installing a "dedicated server" for a game:

To review the pieces of information you need are:
  • The What: "AppID" for the "dedicated server" component of the game involved.
  • The Where: folder / path to install that game's "dedicated server" into.
  • The Who: Steam logon ID to use (and if not "anonymous" what password goes with it!)
The Valve's web-page regarding SteamCMD describes the command involved in using those pieces of information to perform an install. However, all of that can be boiled-down to two potential commands:
  • If an "anonymous" login may be used to install a particular game:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login anonymous +force_install_dir {install-folder-here} +app_update {appid-here} validate +quit;
  • if a "real" Steam ID must be used to install a particular game:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login {real-steam-id-here} {steam-id's-password-here} +force_install_dir {install-folder-here} +app_update {appid-here} validate +quit;
Obviously, the stuff in braces ("{" and "}") needs to be replaced with actual values. Also be sure not to include the braces ("{" and "}" themselves in the command-line!
12 - Installing EXAMPLE game-servers
Installing the standard examples:

Combining our standard examples (established in previous sections of this guide), with the information regarding AppID's - yields this table of information:

Game Server Path
Server AppID
Login SteamID
Game Server
/home/game-server/game-fof-1
295230
anonymous
Fistful-of-Frags (1 of 2)
/home/game-server/game-fof-2
295230
anonymous
Fistful-of-Frags (2 of 2)
/home/game-server/game-tf2-1
232250
anonymous
Team Fortress 2
/home/game-server/game-css-1
232330
anonymous
Counter-Strike:Source

You may create the installation folders for each of those, with the following commands:
cd ~; pwd; ls -lh; mkdir game-fof-1; mkdir game-fof-2; mkdir game-tf2-1; mkdir game-css-1;

After doing-show, you can do these commands to then show that the newly-created folders do now exist:
cd ~; pwd; ls -lh;

Once those folders are created, you may also use the Refresh button in Webmin's File Manager to update it's display - now showing those four new folders that were just created:



A matter of space & time:

How long each installation command will take to complete, will depending largely upon:
  • The bandwidth of your Internet connection.
  • The size of the particular game-server(a) involved (sizes vary greatly).
Just for reference, as of the creation of this guide, below are the approximately sizes of each of the "standard examples":
  • Fistful-of-Frags (FoF) server - first copy: Just under 3-GB.
  • Fistful-of-Frags (FoF) server - second copy: Just under 3-GB.
  • Team Fortress 2 (TF2) server: Just under 8-GB.
  • Counter-Strike (CS:S) server: Just over 2-GB.
  • Total for all of the above servers: Approximately 16-GB (without any "custom" content)

Can we just do it already?

The commands that follow may be used to install each of our "standard examples". Notice the differences in AppID and/or installation folder for each.
  • For the 1st of 2 Fistful-of-Frags (FoF) servers:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/game-server/game-fof-1 +app_update 295230 validate +quit;
  • For the 2nd of 2 Fistful-of-Frags (FoF) servers:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/game-server/game-fof-2 +app_update 295230 validate +quit;
  • For the (only) Team Fortress 2 (TF2) server:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/game-server/game-tf2-1 +app_update 232250 validate +quit;
  • For the (only) Counter-Strike (CS:S) server:
    cd ~/steamcmd;~/steamcmd/steamcmd.sh +login anonymous +force_install_dir /home/game-server/game-css-1 +app_update 232330 validate +quit;



How to tell what and how-much got installed:

The following commands may be used to determine how-much content was downloaded for each game's "dedicated server" installation:
cd ~; pwd; ls -lh; du -hs ~/game-fof-1/; du -hs ~/game-fof-2/; du -hs ~/game-tf2-1/; du -hs ~/game-css-1/;


Also, you can use the File Manager feature of Webmin to check the contents of each of those folders. Each should now have a significant structure of sub-folders inside:

13 - Configuring game-servers
Game Directory:

NOTE: The terms "folder", "directory" and "path" are generally used interchangeably.

Before each game will work as expected, there are a variety of configuration files that must be edited. In some cases, these files may already exist - with little or no contents. In other cases, they need to be created. Either nano or webmin may be used to create and/or edit the required files.

The location of these files, is relative to the "base folder" of each game-server installation. The "base folder" is the folder specified during the SteamCMD installation of that game-server using the "force_install_dir" parameter - plus a game-specific "game" or "mod" sub-folder as noted below:
  • Fistful-of-Frags (FoF) = "fof"
  • Team Fortress 2 (TF2) = "tf"
  • Counter-Strike:Source (CS:S) = "cstrike"
Resulting in this list of paths:
Game Server Path
Game/Mod
Combined Game "Base" Folder
Game Server
/home/game-server/game-fof-1
fof
/home/game-server/game-fof-1/fof
Fistful-of-Frags (1 of 2)
/home/game-server/game-fof-2
fof
/home/game-server/game-fof-2/fof
Fistful-of-Frags (2 of 2)
/home/game-server/game-tf2-1
tf
/home/game-server/game-tf2-1/tf
Team Fortress 2
/home/game-server/game-css-1
cstrike
/home/game-server/game-css-1/cstrike
Counter-Strike:Source

Important Configuration Files:

In summary, the location and purpose of each of these configuration files, relative to the game-servers "{base-folder}", are as follows:

Configuration File
Usage
{base-folder}/cfg/autoexec.cfg
Settings that can only be set before the "map" is loaded, or can only be set once and can NOT changed without restarting the game-server. The very last line of this file should always the "map" command (followed by which map to load at startup) - unless you are using the "+map" option in your startup command-line.
{base-folder}/cfg/server.cfg
Settings that can only be configured after the "map" is loaded, and can be changed anytime without restarting the game-server.
{base-folder}/motd.txt
"Message-of-the-Day" (MOTD) text to display to players when they connect to the server. In some games, HTML may be used to format the contents this file. If HTML is supported in a game, they will also usually allow this fine to have a single-line of text - which will be the full URL of a web-page to use instead of the contents of the file itself. For games that do not support HTML-based MOTD's, the contents of this file is displayed for players as plain-text.
{base-folder}/motd_text.txt
If HTML-based MOTD's are supported for by the game, but the player has disabled HTML-based MOTD's on their client (using cl_disablehtmlmotd), then the contents of this file will be displayed for those players as plain-text - instead of using the motd.txt file.
{base-folder}/mapcycle.txt
This is a plain-text file, containing a one-map-per-line list of which maps the server will "cycle" through (or "rotate" as it is commonly referred-to). This may be a subset of the maps that are actually available on the game-server.
{base-folder}/maplist.txt
This is a plain-text file, containing a one-map-per-line list of which maps are available on the server - even if they are not in the "map cycle". How this file is used, varies somewhat by game (or is not used at all).

Commands and CVAR's:

Inside cfg/autoexec.cfg and cfg/server.cfg will be various combinations of:
  • "console commands": Commands that you may also type directly to the SRCDS console to perform some action - such as load a map, ban a player, or execute another configuration file (such as cfg/banned_user.cfg), or
  • "console variables" (CVAR's): Settings that change various aspects of the game - such as alter the gravity, change how long a map should be run before switching to the next one, etc.
Exactly which commands or CVAR's belong (or will even work) in cfg/autoexec.cfg compared to cfg/server.cfg - varies some by game.

Unfortunately (as stated), every game seems to implement this somewhat differently. Consequently, you will definately need to look at the sample cfg/autoexec.cfg and cfg/server.cfg that come with each game-server installation to see where they belong - for each specific game.

Common Options (CVAR's):

Below is a list of some of the most common CVAR's - found on most (if not all) game-servers. Again, it will vary based on specific game as to whether they should be used in the cfg/autoexec.cfg or cfg/server.cfg file:
  • maxplayers: How many people can play on the server simultaneously. The highest value allowed varies greatly by game.
  • sv_password: Require a password to play on the server, or set to empty quotes "" to have no password.
  • hostname: Description to display in the list of servers that game-clients see.
  • sv_tags: Adds comma-separated "tag" information into the server-list, to make it easier for players to find servers with (or without) certain features.
  • sv_contact: How to contact the administrator. Typically an e-mail address, or Steam profile URL.
  • mp_timelimit: How many minutes to run each map, before automatically changing to the next map in the mapcycle.txt file.
  • mp_teamplay: Generally 0 = Deathmatch, and 1 = Teams. Exact implementation varies greatly from one game to another.
  • mp_friendlyfire: Generally 0 = CAN hurt your own teammates, and 1 = CAN NOT hurt your own teammates. Implementation varies some from one game to another.
  • sv_gravity: Sets the default gravity for the server. 800 = "normal" (1G) gravity. Can be overridden by maps in most games, and can be changed on-the-fly by certain server-side modifications.
  • sv_voiceenable: 0 = voice-chat disabled, 1 = voice-chat enabled.
  • sv_alltalk: Generally 0 = Teams only see/hear their own teammate's communications, and 1 = Everybody sees/hears everybody's communications.
  • log: 0 = logging disabled, 1 = logging enabled. Will log various information to log files - generally in the {base-folder}/log sub-folder.
  • exec: Technically a "command" not a "CVAR". Will execute the contents of another configuration file - which may contain its own combination of "commands" and "CVAR's".
  • map: Technically a "command" not a "CVAR". Will load whatever map is specified. Generally only used at startup, since it will drop all players from the server
14(a) - Configuring FoF for Team-Based Deathmatch (TDM)
Within some of the sample configuration (.cfg) files, you may notice the "\\" operator quite often. This indicated the beginning of a "comment" - which will be ignored by the game itself. Lines that start with "\\" are ignored entirely. Lines with "\\" somewhere in their middle, are ignored from the "\\" to the end of that line. The author has placed an extraordinary amount of commenting in these sample files.

Either nano or webmin may be used to create and/or edit the required files.

Sample autoexec.cfg:
nano ~/game-fof-1/cfg/autoexec.cfg;
The autoexec.cfg file is executed once when the game-server is first started - not at every map change. Generally, stuff goes into autoexec.cfg to keep the startup command-line simple.
echo [Start of AutoExec.CFG] // // !! FOF-SPECIFIC LIMIT !! // ------------------------ // Regarding "maxplayers": // // FoF currently limits the max // number of players to 20. // You can set "maxplayers" to // any value equal to or lower // than that. // maxplayers "20" // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "mp_teamplay": // // 1 = Team-based deathmatch // 0 = No teams, free-for-all deathmatch // mp_teamplay 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "mp_friendlyfire" // // 0 = friendly-fire disabled, you can NOT hurt teammates // 1 = friendly-fire enabled, you CAN hurt teammates // mp_friendlyfire 0 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_maxteams" // // 2 = Vigilantes & Desperados // 3 = Vigilantes, Desperados & Bandidos // 4 = Vigilantes, Desperados, Bandidos & Rangers // fof_sv_maxteams 4 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "hostname": // // This is the name/description for the // server as it will be seen in-game by // clients on their server-listing. // hostname "FoF team-play (example, by Weasel)" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_contact": // // The e-mail address or URL where the // owner/operator/admin of the server // may be reached ... // sv_contact "http://blogs.valvesoftware.com/sumdumgi" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_downloadurl": // // This allows for various custom content // such as maps and sounds to be downloaded // via HTTP instead of using the (very slow) // in-game protocol download ... // // For more information about how this works, see: // https://developer.valvesoftware.com/wiki/Sv_downloadurl // //sv_downloadurl "http://blogs.valvesoftware.com/sumdumgi/fof" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_tags": // // It is a comma-separated list of different "tag" // information that will be listed for each server // in the server-list that every FoF game-client // sees. Clients may use the "include" or the // "exclude" function to find or filter-out servers // with various settings. // // Some suggested tags: // Server Type: // dedicated // listen // Game Mode / Teams: // deathmatch // 2-teams // 3-teams // 4-teams // elimination // Other Suggestions: // music = custom in-game music // sourcemod = server runs SourceMod // [... etc ...] // sv_tags "dedicated,4-team" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // More general, non-FoF-specific settings // below, Google each for more details ... // pausable "0" sv_clienttrace "3.5" sv_lan "0" // // Steam game-SERVER account, unique to // THIS game-server instance. It is used // to assist players in finding games that // they have added to their "favorite" // servers list, but whose IP addresses // have changed since they last played. // // See this URL for more details... // https://www.mail-archive.com/hlds_announce%40list.valvesoftware.com/msg00669.html // //sv_setsteamaccount SOMEBIGHEXIDECIMALNUMBERHERE // //echo [End of AutoExec.CFG] map fof_fistful //map fof_desperados //map fof_robertlee //map fof_revenge

Sample motd.txt:
nano ~/game-fof-1/motd.txt;
This is the "Message-of-the-Day" (MOTD) text to display to game-clients that have HTML-based MOTD's enabled. Consequently, HTML may be used in this version of the file.
<html> <head> <title>HTML-Based MOTD for FoF></title> </head> <body> <p>Welcome to the sample <a href="https://steamhost.cn/steamcommunity_com/games/fof">Fistful-of-Frags</a> (FoF) <strong>TEAM PLAY</strong> game server!</p> <p>Our map rotation is:</p> <ul> <li>fof_fistful</li> <li>fof_desperados</li> <li>fof_revenge</li> <li>fof_robertlee</li> </ul> The administrator may be reached at: <a href="mailto:Sum-Dum-Gi@ValveSoftware.com@ValveSoftware.com>Sum-Dum-Gi@ValveSoftware.com@ValveSoftware.com</a> </body>

Sample motd_text.txt:
nano ~/game-fof-1/motd_text.txt;
This is the "Message-of-the-Day" (MOTD) text to display to game-clients that have HTML-based MOTD's disabled. Consequently, HTML should not be used in this version of the file - it should be "plain-text".
Welcome to the sample Fistful-of-Frags (FoF) TEAM-PLAY game server! Our map rotation is: - fof_fistful - fof_desperados - fof_revenge - fof_robertlee The administrator may be reached at: Sum-Dum-Gi@ValveSoftware.com
14(b) - Configuring FoF for Team-Based Deathmatch (Continued)
Either nano or webmin may be used to create and/or edit the required files.

Sample server.cfg:
nano ~/game-fof-1/cfg/server.cfg;
The server.cfg file is executed at every map load (or change).
echo [Start of Server.CFG] // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_currentmode": // // 1 = Deathmatch (team based or non-team) // other numbers may be added in the // future to support other game-modes // built-into later versions of the game. // fof_sv_currentmode 1 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_bot_dynamicjoin": // // 1 = bots join and leave automatically // 0 = some other functionality // fof_sv_bot_dynamicjoin 1 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_bot_slotpct": // // Determines what PERCENTAGE of SLOTS // to allow bots to back-fill up to. // // For a 20-SLOT server, that would be: // fof_sv_bot_slotpct 1.0 = up to 20 bots // fof_sv_bot_slotpct 0.9 = up to 18 bots // fof_sv_bot_slotpct 0.8 = up to 16 bots // fof_sv_bot_slotpct 0.7 = up to 14 bots // fof_sv_bot_slotpct 0.6 = up to 12 bots // fof_sv_bot_slotpct 0.5 = up to 10 bots // fof_sv_bot_slotpct 0.4 = up to 8 bots // fof_sv_bot_slotpct 0.3 = up to 6 bots // fof_sv_bot_slotpct 0.2 = up to 4 bots // fof_sv_bot_slotpct 0.1 = up to 2 bots // // For a 10-SLOT server, that would be: // fof_sv_bot_slotpct 1.0 = up to 10 bots // fof_sv_bot_slotpct 0.9 = up to 9 bots // fof_sv_bot_slotpct 0.8 = up to 8 bots // fof_sv_bot_slotpct 0.7 = up to 7 bots // fof_sv_bot_slotpct 0.6 = up to 6 bots // fof_sv_bot_slotpct 0.5 = up to 5 bots // fof_sv_bot_slotpct 0.4 = up to 4 bots // fof_sv_bot_slotpct 0.3 = up to 3 bots // fof_sv_bot_slotpct 0.2 = up to 2 bots // fof_sv_bot_slotpct 0.1 = up to 1 bots // //fof_sv_bot_slotpct 0 fof_sv_bot_slotpct 0.4 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "mp_forcecamera": // // Controls how spectators are // permitted to see things ... // // 0 = Free roaming (flying around) // 1 = Force to follow members of same team // 2 = Spectating not allowed // mp_forcecamera 0 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "mp_timelimit": // // Time limit (in minutes) to run each // map, before proceeding to the next // map in the the "mapcycle.txt" file. // mp_timelimit 15 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_voiceenable": // // Enables (1) or disables (0) the // game's built-in voice-chat feature. // sv_voiceenable 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_alltalk": // // Allows (1) all players to hear // everyone's voice-chats and see // everyone's text-chats - or // disables (0) that feature. // sv_alltalk 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_password": // // Sets a password that players // must know to play on this // particular server. // // "somepassword" = makes the password "somepassword" // "" = no password required // //sv_password "whateverpasswordyouwanthere" sv_password "" // // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "rcon_password": // // Sets a "remote-console" password // which may be used by admins to // remotely issue commands to the // server console. // // "" = no rcon-password (RCON disabled) // "somepassword" = makes the password "somepassword" // // WARNING: This a very insecure // and exploitable feature, which // is NOT recommended. Instead use // a server-side administrative mod // such as "SourceMod" // rcon_password "" //rcon_password "whateverrconpasswordyouwanthere" // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Rate-related stuff: (FoF-provided samples) // //sv_Maxrate 50000 //sv_Minrate 50000 //sv_Maxupdaterate 100 //sv_Minupdaterate 33 //sv_Maxcmdrate 100 //sv_Mincmdrate 33 //sv_client_max_interp_ratio 5 //sv_client_min_interp_ratio 1 //sv_client_predict 1 //sv_client_interpolate 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Rate-related stuff (Weasel-provided samples) // fps_max "60" // 60 frames-per-second sv_minrate "2400" // 2.4 Kbps sv_maxrate "14400" // 14.4 Kbps sv_maxupdaterate "60" // Maximum updates per second that the server will allow sv_minupdaterate "10" // Minimum updates per second that the server will allow // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // More general, non-FoF-specific settings // below, Google each for more details ... // sv_pure 1 sv_pure_kick_clients 1 sv_allow_wait_command 0 sv_lan 0 sv_region 255 log on sv_logflush 1 //Flush write to log immediately. sv_logbans 1 sv_logecho 1 sv_logfile 1 sv_log_onefile 0 // echo [End of Server.CFG] // // Reload the list(s) of any // banned players ... // exec banned_user.cfg exec banned_ip.cfg
15(a) - Configuring FoF for No-Teams Free-for-All (FFA)
Within some of the sample configuration (.cfg) files, you may notice the "\\" operator quite often. This indicated the beginning of a "comment" - which will be ignored by the game itself. Lines that start with "\\" are ignored entirely. Lines with "\\" somewhere in their middle, are ignored from the "\\" to the end of that line. The author has placed an extraordinary amount of commenting in these sample files.

Either nano or webmin may be used to create and/or edit the required files.

Sample autoexec.cfg:
The autoexec.cfg file is executed once when the game-server is first started - not at every map change. Generally, stuff goes into autoexec.cfg to keep the startup command-line simple.
echo [Start of AutoExec.CFG] // // !! FOF-SPECIFIC LIMIT !! // ------------------------ // Regarding "maxplayers": // // FoF currently limits the max // number of players to 20. // You can set "maxplayers" to // any value equal to or lower // than that. // maxplayers "20" // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "mp_teamplay": // // 1 = Team-based deathmatch // 0 = No teams, free-for-all deathmatch // mp_teamplay 0 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "mp_friendlyfire" // // 0 = friendly-fire disabled, you can NOT hurt teammates // 1 = friendly-fire enabled, you CAN hurt teammates // mp_friendlyfire 0 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_maxteams" // // 2 = Vigilantes & Desperados // 3 = Vigilantes, Desperados & Bandidos // 4 = Vigilantes, Desperados, Bandidos & Rangers // //fof_sv_maxteams 4 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "hostname": // // This is the name/description for the // server as it will be seen in-game by // clients on their server-listing. // hostname "FoF deathmatch (example, by Weasel)" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_contact": // // The e-mail address or URL where the // owner/operator/admin of the server // may be reached ... // sv_contact "http://blogs.valvesoftware.com/sumdumgi" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_downloadurl": // // This allows for various custom content // such as maps and sounds to be downloaded // via HTTP instead of using the (very slow) // in-game protocol download ... // // For more information about how this works, see: // https://developer.valvesoftware.com/wiki/Sv_downloadurl // //sv_downloadurl "http://blogs.valvesoftware.com/sumdumgi/fof" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_tags": // // It is a comma-separated list of different "tag" // information that will be listed for each server // in the server-list that every FoF game-client // sees. Clients may use the "include" or the // "exclude" function to find or filter-out servers // with various settings. // // Some suggested tags: // Server Type: // dedicated // listen // Game Mode / Teams: // deathmatch // 2-teams // 3-teams // 4-teams // Other Suggestions: // music = custom in-game music // sourcemod = server runs SourceMod // [... etc ...] // sv_tags "dedicated,deathmatch" // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // More general, non-FoF-specific settings // below, Google each for more details ... // pausable "0" sv_clienttrace "3.5" sv_lan "0" // // Steam game-SERVER account, unique to // THIS game-server instance. It is used // to assist players in finding games that // they have added to their "favorite" // servers list, but whose IP addresses // have changed since they last played. // // See this URL for more details... // https://www.mail-archive.com/hlds_announce%40list.valvesoftware.com/msg00669.html // //sv_setsteamaccount SOMEBIGHEXIDECIMALNUMBERHERE // //echo [End of AutoExec.CFG] map fof_fistful //map fof_desperados //map fof_robertlee //map fof_revenge

Sample motd.txt:
This is the "Message-of-the-Day" (MOTD) text to display to game-clients that have HTML-based MOTD's enabled. Consequently, HTML may be used in this version of the file.
<html> <head> <title>HTML-Based MOTD for FoF></title> </head> <body> <p>Welcome to the sample <a href="https://steamhost.cn/steamcommunity_com/games/fof">Fistful-of-Frags</a> (FoF) <strong> DEATHMATCH </strong> game server!</p> <p>Our map rotation is:</p> <ul> <li>fof_fistful</li> <li>fof_desperados</li> <li>fof_revenge</li> <li>fof_robertlee</li> </ul> The administrator may be reached at: <a href="mailto:Sum-Dum-Gi@ValveSoftware.com@ValveSoftware.com>Sum-Dum-Gi@ValveSoftware.com@ValveSoftware.com</a> </body>

Sample motd_text.txt:
This is the "Message-of-the-Day" (MOTD) text to display to game-clients that have HTML-based MOTD's disabled. Consequently, HTML should not be used in this version of the file - it should be "plain-text".
Welcome to the sample Fistful-of-Frags (FoF) DEATHMATCH game server! Our map rotation is: - fof_fistful - fof_desperados - fof_revenge - fof_robertlee The administrator may be reached at: Sum-Dum-Gi@ValveSoftware.com
15(b) - Configuring FoF for No-Teams Free-for-All (Continued)
Either nano or webmin may be used to create and/or edit the required files.

Sample server.cfg:
The server.cfg file is executed at every map load (or change).
echo [Start of Server.CFG] // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_currentmode": // // 1 = Deathmatch (team based or non-team) // other numbers may be added in the // future to support other game-modes // built-into later versions of the game. // fof_sv_currentmode 1 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_bot_dynamicjoin": // // 1 = bots join and leave automatically // 0 = some other functionality // fof_sv_bot_dynamicjoin 1 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "fof_sv_bot_slotpct": // // Determines what PERCENTAGE of SLOTS // to allow bots to back-fill up to. // // For a 20-SLOT server, that would be: // fof_sv_bot_slotpct 1.0 = up to 20 bots // fof_sv_bot_slotpct 0.9 = up to 18 bots // fof_sv_bot_slotpct 0.8 = up to 16 bots // fof_sv_bot_slotpct 0.7 = up to 14 bots // fof_sv_bot_slotpct 0.6 = up to 12 bots // fof_sv_bot_slotpct 0.5 = up to 10 bots // fof_sv_bot_slotpct 0.4 = up to 8 bots // fof_sv_bot_slotpct 0.3 = up to 6 bots // fof_sv_bot_slotpct 0.2 = up to 4 bots // fof_sv_bot_slotpct 0.1 = up to 2 bots // // For a 10-SLOT server, that would be: // fof_sv_bot_slotpct 1.0 = up to 10 bots // fof_sv_bot_slotpct 0.9 = up to 9 bots // fof_sv_bot_slotpct 0.8 = up to 8 bots // fof_sv_bot_slotpct 0.7 = up to 7 bots // fof_sv_bot_slotpct 0.6 = up to 6 bots // fof_sv_bot_slotpct 0.5 = up to 5 bots // fof_sv_bot_slotpct 0.4 = up to 4 bots // fof_sv_bot_slotpct 0.3 = up to 3 bots // fof_sv_bot_slotpct 0.2 = up to 2 bots // fof_sv_bot_slotpct 0.1 = up to 1 bots // //fof_sv_bot_slotpct 0 fof_sv_bot_slotpct 0.4 // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Regarding "mp_forcecamera": // // Controls how spectators are // permitted to see things ... // // 0 = Free roaming (flying around) // 1 = Force to follow members of same team // 2 = Spectating not allowed // mp_forcecamera 0 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "mp_timelimit": // // Time limit (in minutes) to run each // map, before proceeding to the next // map in the the "mapcycle.txt" file. // mp_timelimit 15 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_voiceenable": // // Enables (1) or disables (0) the // game's built-in voice-chat feature. // sv_voiceenable 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_alltalk": // // Allows (1) all players to hear // everyone's voice-chats and see // everyone's text-chats - or // disables (0) that feature. // sv_alltalk 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "sv_password": // // Sets a password that players // must know to play on this // particular server. // // "somepassword" = makes the password "somepassword" // "" = no password required // //sv_password "whateverpasswordyouwanthere" sv_password "" // // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Regarding "rcon_password": // // Sets a "remote-console" password // which may be used by admins to // remotely issue commands to the // server console. // // "" = no rcon-password (RCON disabled) // "somepassword" = makes the password "somepassword" // // WARNING: This a very insecure // and exploitable feature, which // is NOT recommended. Instead use // a server-side administrative mod // such as "SourceMod" // rcon_password "" //rcon_password "whateverrconpasswordyouwanthere" // // !! FOF-SPECIFIC SETTING !! // -------------------------- // Rate-related stuff: (FoF-provided samples) // //sv_Maxrate 50000 //sv_Minrate 50000 //sv_Maxupdaterate 100 //sv_Minupdaterate 33 //sv_Maxcmdrate 100 //sv_Maxcmdrate 33 //sv_client_max_interp_ratio 5 //sv_client_min_interp_ratio 1 //sv_client_predict 1 //sv_client_interpolate 1 // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // Rate-related stuff (Weasel-provided samples) // fps_max "60" // 60 frames-per-second sv_minrate "2400" // 2.4 Kbps sv_maxrate "14400" // 14.4 Kbps sv_maxupdaterate "60" // Maximum updates per second that the server will allow sv_minupdaterate "10" // Minimum updates per second that the server will allow // // !! GENERAL, NON-FOF-SPECIFIC !! // ------------------------------- // More general, non-FoF-specific settings // below, Google each for more details ... // sv_pure 1 sv_pure_kick_clients 1 sv_allow_wait_command 0 sv_lan 0 sv_region 255 log on sv_logflush 1 //Flush write to log immediately. sv_logbans 1 sv_logecho 1 sv_logfile 1 sv_log_onefile 0 // echo [End of Server.CFG] // // Reload the list(s) of any // banned players ... // exec banned_user.cfg exec banned_ip.cfg
16 - Configuring TF2 Server
Within some of the sample configuration (.cfg) files, you may notice the "\\" operator quite often. This indicated the beginning of a "comment" - which will be ignored by the game itself. Lines that start with "\\" are ignored entirely. Lines with "\\" somewhere in their middle, are ignored from the "\\" to the end of that line. The author has placed an extraordinary amount of commenting in these sample files.

For Team Fortress 2 (TF2), there is no autoexec.cfg file by default. So, that will have to be created. However, it does have existing server.cfg, motd.txt, motd_text.txt, mapcycle.txt and maplist.txt files. This guide won't bother showing the contents of those existing files. However, they function similar to other games - such as the Fistful of Frags (FoF) examples from earlier sections of this guide.

Either nano or webmin may be used to create and/or edit the required files.

Sample autoexec.cfg:
nano ~/game-tf2-1/cfg/autoexec.cfg;
The autoexec.cfg file is executed once when the game-server is first started - not at every map change. Generally, stuff goes into autoexec.cfg to keep the startup command-line simple.
echo [Start of AutoExec.CFG] // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // // You can set "maxplayers" to // any value equal to or lower // than 32. // maxplayers "32" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "mp_teamplay": // // 1 = Team-based deathmatch // 0 = No teams, free-for-all deathmatch // // NOTE: Probably not relevant to TF2. // mp_teamplay "1" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "mp_friendlyfire" // // 0 = friendly-fire disabled, you can NOT hurt teammates // 1 = friendly-fire enabled, you CAN hurt teammates // mp_friendlyfire "0" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "hostname": // // This is the name/description for the // server as it will be seen in-game by // clients on their server-listing. // hostname "Team Fortress 2 (example, by Weasel)" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "sv_contact": // // The e-mail address or URL where the // owner/operator/admin of the server // may be reached ... // sv_contact "http://blogs.valvesoftware.com/sumdumgi" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "sv_downloadurl": // // This allows for various custom content // such as maps and sounds to be downloaded // via HTTP instead of using the (very slow) // in-game protocol download ... // // For more information about how this works, see: // https://developer.valvesoftware.com/wiki/Sv_downloadurl // //sv_downloadurl "http://blogs.valvesoftware.com/sumdumgi/tf2" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // Regarding "sv_tags": // // It is a comma-separated list of different "tag" // information that will be listed for each server // in the server-list that every TF2 game-client // sees. Clients may use the "include" or the // "exclude" function to find or filter-out servers // with various settings. // // Some suggested tags: // Server Type: // dedicated // listen // Other Suggestions: // music = custom in-game music // sourcemod = server runs SourceMod // [... etc ...] // sv_tags "dedicated,example" // // !! GENERAL, NON-TF2-SPECIFIC !! // ------------------------------- // More general, non-TF2-specific settings // below, Google each for more details ... // pausable "0" sv_clienttrace "3.5" sv_lan "0" // // Steam game-SERVER account, unique to // THIS game-server instance. It is used // to assist players in finding games that // they have added to their "favorite" // servers list, but whose IP addresses // have changed since they last played. // // See this URL for more details... // https://www.mail-archive.com/hlds_announce%40list.valvesoftware.com/msg00669.html // //sv_setsteamaccount SOMEBIGHEXIDECIMALNUMBERHERE // //echo [End of AutoExec.CFG] map ctf_2fort
17 - Configuring CS:S Server
Within some of the sample configuration (.cfg) files, you may notice the "\\" operator quite often. This indicated the beginning of a "comment" - which will be ignored by the game itself. Lines that start with "\\" are ignored entirely. Lines with "\\" somewhere in their middle, are ignored from the "\\" to the end of that line. The author has placed an extraordinary amount of commenting in these sample files.

For Counter-Strike:Source (CS:S), there typically is no autoexec.cfg file by default. So, that will have to be created. However, it does have existing server.cfg, motd.txt, motd_text.txt, mapcycle.txt and maplist.txt files. This guide won't bother showing the contents of those existing files. However, they function similar to other games - such as the Fistful of Frags (FoF) examples from earlier sections of this guide.

Either nano or webmin may be used to create and/or edit the required files.

Sample autoexec.cfg:
nano ~/game-css-1/cfg/autoexec.cfg;
The autoexec.cfg file is executed once when the game-server is first started - not at every map change. Generally, stuff goes into autoexec.cfg to keep the startup command-line simple.
echo [Start of AutoExec.CFG] // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // // You can set "maxplayers" to // any value equal to or lower // than 32. // maxplayers "32" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "mp_teamplay": // // 1 = Team-based deathmatch // 0 = No teams, free-for-all deathmatch // // NOTE: Probably not relevant to CS:S. // mp_teamplay "1" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "mp_friendlyfire" // // 0 = friendly-fire disabled, you can NOT hurt teammates // 1 = friendly-fire enabled, you CAN hurt teammates // mp_friendlyfire "0" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "hostname": // // This is the name/description for the // server as it will be seen in-game by // clients on their server-listing. // hostname "Counter-Strike:Source (example, by Weasel)" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "sv_contact": // // The e-mail address or URL where the // owner/operator/admin of the server // may be reached ... // sv_contact "http://blogs.valvesoftware.com/sumdumgi" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "sv_downloadurl": // // This allows for various custom content // such as maps and sounds to be downloaded // via HTTP instead of using the (very slow) // in-game protocol download ... // // For more information about how this works, see: // https://developer.valvesoftware.com/wiki/Sv_downloadurl // //sv_downloadurl "http://blogs.valvesoftware.com/sumdumgi/css" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // Regarding "sv_tags": // // It is a comma-separated list of different "tag" // information that will be listed for each server // in the server-list that every CS:S game-client // sees. Clients may use the "include" or the // "exclude" function to find or filter-out servers // with various settings. // // Some suggested tags: // Server Type: // dedicated // listen // Other Suggestions: // music = custom in-game music // sourcemod = server runs SourceMod // [... etc ...] // sv_tags "dedicated,example" // // !! GENERAL, NON-CSS-SPECIFIC !! // ------------------------------- // More general, non-CSS-specific settings // below, Google each for more details ... // pausable "0" sv_clienttrace "3.5" sv_lan "0" // // Steam game-SERVER account, unique to // THIS game-server instance. It is used // to assist players in finding games that // they have added to their "favorite" // servers list, but whose IP addresses // have changed since they last played. // // See this URL for more details... // https://www.mail-archive.com/hlds_announce%40list.valvesoftware.com/msg00669.html // //sv_setsteamaccount SOMEBIGHEXIDECIMALNUMBERHERE // //echo [End of AutoExec.CFG] map de_dust2
18 - Running Game-Servers (Interactively)
Now that the games are both installed and configured, lets discuss how to actually start or "launch" each game-server.

Each game-server has its own copy of the the Source-engine dedicated server executable (commonly referred to as "SRCDS") - in it's own installation folder. This is the executable that will be run (with command-line parameters) to host your game.

Technically, the only parameter that must be passed at the command-line is the game/mod sub-folder (-game parameter). Any other required information that is not specified in the command-line, will be taken instead from the autoexec.cfg file. If a required parameter not specified in the autoexec.cfg file or the command-line, then some automatic default or dynamically generated value may be used - which may not be desirable (particularly in the case of "ports").

However, the author recommends specifying the following parameters in the start-up command-line:
  • Special game/mod sub-folder: -game parameter
  • Game communication port to use: +port parameter
  • Steam communication port to use: -steamport parameter (or -sport parameter for older games)
  • Game-server-is-also-a-client port: +clientport parameter
  • Disable SourceTV/HLTV: -nohltv
  • Enabled VAC: -secure
NOTE: It is also common-place to specify the initial map in the start-up command-line, using the "+map" parameter. In this guide, that functionality is included in the autoexec.cfg file instead of at the command-line.

Based on that, a typical SRCDS might be:
./srcds_run -secure -game gamemodfolderhere -nohltv +port portnumber -steamport portnumber +clientport portnumber
NOTE: Be sure that the srcds_run command starts with a period and a back-slash ("./")!

Obviously, since each installation has its own copy of SRCDS, the command-line to start SRCDS must be specified from within the correct folder.

This can be accomplished by combining a change-directory ("cd") command just prior to the command to start SRCDS - with a semi-colon (";") between the two commands.
cd ~/gameserversforceinstalldir/;./srcds_run -secure -game gamemodfolderhere -nohltv +port portnumber -steamport portnumber +clientport portnumber

NOTE: To STOP a game-server, generally you enter "quit" or "exit" to shut-down the game. Sometimes it is also necessary to use CTRL+C to ensure the game-server does not automatically restart, and instead returns you to the Linux command-prompt.
19 - Running EXAMPLE Game-Servers (Interactively)
Combining the per-game "port" assignments, "folder" assignments from earlier sections, with the per-game "game/mod" sub-folders from the previous section - yields the following list for folders and parameters required to determine the parameter for each game-server:

Game Port
Steam Port
Client Port
Game Server Path
Game/Mod
Game Server
6001
6101
6201
/home/game-server/game-fof-1
fof
Fistful-of-Frags (1 of 2)
6003
6103
6203
/home/game-server/game-fof-2
fof
Fistful-of-Frags (2 of 2)
6005
6105
6205
/home/game-server/game-tf2-1
tf
Team Fortress 2
6007
6107
6207
/home/game-server/game-css-1
cstrike
Counter-Strike:Source

Further below are the start-up command-lines for each of our standard example game-servers, including the "cd" command appended to the front-end of the command - to ensure SRCDS is started from the proper folder.

NOTE: To STOP a game-server, generally you enter "quit" or "exit" to shut-down the game. Sometimes it is also necessary to use CTRL+C to ensure the game-server does not automatically restart, and instead returns you to the Linux command-prompt.

Running FoF server #1 of 2 (team-deathmatch):

  • Folder: /home/game-server/game-fof-1
  • Game/mod sub-folder: fof
  • Game (client/server) communication port: 6001
  • Steam communication port: 6101
  • Game-server-is-also-a-client port: 6201
  • Disable SourceTV/HLTV: -nohltv
  • Enabled VAC: -secure
cd ~/game-fof-1/;./srcds_run -secure -game fof -nohltv +port 6001 -steamport 6101 +clientport 6201

Running FoF server #2 of 2 (non-team/free-for-all):

  • Folder: /home/game-server/game-fof-2
  • Game/mod sub-folder: fof
  • Game (client/server) communication port: 6003
  • Steam communication port: 6103
  • Game-server-is-also-a-client port: 6203
  • Disable SourceTV/HLTV: -nohltv
  • Enabled VAC: -secure
cd ~/game-fof-2/;./srcds_run -secure -game fof -nohltv +port 6003 -steamport 6103 +clientport 6203

Running the Team Fortress 2 server:

  • Folder: /home/game-server/game-tf2-1
  • Game/mod sub-folder: tf
  • Game (client/server) communication port: 6005
  • Steam communication port: 6105
  • Game-server-is-also-a-client port: 6205
  • Disable SourceTV/HLTV: -nohltv
  • Enabled VAC: -secure
cd ~/game-tf2-1/;./srcds_run -secure -game tf -nohltv +port 6005 -steamport 6105 +clientport 6205

Running the Counter-Strike:Source server:

  • Folder: /home/game-server/game-css-1
  • Game/mod sub-folder: cstrike
  • Game (client/server) communication port: 6007
  • Steam communication port: 6107
  • Game-server-is-also-a-client port: 6207
  • Disable SourceTV/HLTV: -nohltv
  • Enabled VAC: -secure
cd ~/game-css-1/;./srcds_run -secure -game cstrike -nohltv +port 6007 -steamport 6107 +clientport 6207
20 - Scripts to "Run" Game-Servers (Interactively)
In order to make it easier to run the game-servers, you can create small "scripts" for each one. Basically, each script file is just a text file (named ending with .sh) that contains the commands to be executed in it, and has been marked as executable (proceeded by "#!/bin/bash" so that Linux knows which language this script is for). Either nano or webmin may be used to create and/or edit the required files. Likewise, Webmin may be used to mark the script files as executable.

Having these scripts will accomplish several things:
  • You will not have to remember the exact commands involved.
  • You will not have to remember exactly which parameters are used for each game (i.e. which port number, etc.).
  • You can create additional scripts later that will execute these scripts for you - non-Interactively (more about that later).

A typical script to run a game-server might look like this:
  • Location: ~/scripts (effectively /home/game-server/scripts)
  • Filename: run-game-something.sh
  • Executable: YES
  • Contents
    #!/bin/bash cd ~/game-something/; ./srcds_run -secure -game something -nohltv +port #### -steamport #### +clientport ####;

For the standard example, we will put all our game-server management scripts in a new "scripts" folder within "home directory" for the game-server user. You can use the following command to create this folder:
mkdir ~/install;

For the standard example servers, you may create these script files for running each game-server as detailed further below. Afterwards, you may use the following commands to display the contents of the "scripts" folder:
ls -lah ~/install;

NOTES:
  • Each will be named with the convention "run-game-something.sh" to make it obvious that these are for manually running each game-server interactively (more about that later).
  • Ensure you mark each file as executable (presumably using Webmin)!
  • Ensure you include "#!/bin/bash" at the beginning of each file!
  • Ensure you end each subsequent line in the script with a semicolon (";")!

Fistful-of-Frags (1 of 2):
  • Location: /home/game-server/scripts
  • Filename: run-game-fof-1.sh
  • Contents:
    #!/bin/bash cd ~/game-fof-1/; ./srcds_run -secure -game fof -nohltv +port 6001 -steamport 6101 +clientport 6201;

Fistful-of-Frags (2 of 2):
  • Location: /home/game-server/scripts
  • Filename: run-game-fof-2.sh
  • Contents:
    #!/bin/bash cd ~/game-fof-2/; ./srcds_run -secure -game fof -nohltv +port 6031 -steamport 6103 +clientport 6203;

Team Fortress 2:
  • Location: /home/game-server/scripts
  • Filename: run-game-tf2-1.sh
  • Contents:
    #!/bin/bash cd ~/game-tf2-1/; ./srcds_run -secure -game tf -nohltv +port 6005 -steamport 6105 +clientport 6205;

Counter-Strike:Source:
  • Location: /home/game-server/scripts
  • Filename: run-game-css-1.sh
  • Contents:
    #!/bin/bash cd ~/game-server/game-css-1/; ./srcds_run -secure -game cstrike -nohltv +port 6007 -steamport 6107 +clientport 6207;

Example Screenshots:

21 - Simultaneous Game-Servers with "Screen"
About GNU Screen:

One limitation of accessing a host server only though the text-based command-prompt on the console or over SSH, is that you can only really do one thing at a time.

If you start a game-server interactively from the command-line (see examples in preceding sections), it will work fine. However, you have to exit the game-server to get back to the command-prompt. Worse-yet, if you get accidentally disconnected while running a game-server over SSH, the game-server will also shut-down. Even worse, this situation (by itself) does not provide a mechanism to have several game-servers (or other long-running processes) operating at the same time.

The answer to this situation is to use a free Linux utility, called "GNU screen[www.gnu.org]". Assuming you followed the instructions from the earlier sections regarding "Preparing Ubuntu", then screen is already installed. If not, you can install it now using this command:
sudo apt-get install screen;

The screen utility with help with several needs:
  • Leave a process running "in the background" (often also referred-to as "disconnected" or "detached").
  • Leave multiple processes running that way simultaneously.
  • Log-off your SSH or console session, leaving these "disconnected" processes running.
  • Get a list of such processing running "disconnected".
  • The ability to "reocnnect" to such "disconnected" processes again later, to enter commands into them (or shut them down).

To start a process right from the command-line as a detached screen session requires syntax such as:
screen -A -m -d -S somename ~/scripts/run-something.sh;
The command-line parameters involved are:

Parameter
Meaning
-A
Adapt to window/terminal-size changes. Must be an upper-case "A".
-m
Force creation of a new process. Must be a lower-case "m".
-d
Start the screen session as "detached". Should be a lower-case "d".
-S
Name the screen session. Must be an upper-case "S". This can be used later to "re-attach" to it.
somename
What name to give the session (requires the "-S" parameter in front)
somecommand
whatever command (or script!) should be automatically started inside this new screen session.

Using screen to run "detached" game-servers:

Typical screen usage in our game-server context would be things such as:
  • Start a game-server "detached", assigning it a name to use for managing and reconnecting to it later:
    screen -A -m -d -S somegameserver ~/scripts/run-somegameserver.sh;
  • Re-attach to a detached game-server, to see its "console" and enter commands:
    screen -r somegameserver;
  • Once done with a game-server "console" detach again from it, leaving it still running:
    CTRL-A, then D (for "detach").
  • List all such "detached" screen sessions (created by the current user):
    screen -ls;
  • Also makes it possible to create additional scripts that can start and stop such detached game-servers more easily.
22 - Running EXAMPLE Servers with "Screen"
Each of our standard example servers may be run as a detached screen session, with the commands below:
  • Running FoF game-server (1 of 2) detached:
    screen -A -m -d -S game-fof-1 ~/scripts/run-game-fof-1.sh;
  • Running FoF game-server (2 of 2) detached:
    screen -A -m -d -S game-fof-2 ~/scripts/run-game-fof-2.sh;
  • Running the TF2 game-server detached:
    screen -A -m -d -S game-tf2-1 ~/scripts/run-game-tf2-1.sh;
  • Running the CS:S game-server detached:
    screen -A -m -d -S game-css-1 ~/scripts/run-game-css-1.sh;

You can verify what is running as a detached screen session, with this command:
screen -ls;

You can re-attach to any of those sessions, with one of these commands:
  • Running FoF game-server (1 of 2) detached:
    screen -r game-fof-1;
  • Running FoF game-server (2 of 2) detached:
    screen -r game-fof-2;
  • Running the TF2 game-server detached:
    screen -r game-tf2-1;
  • Running the CS:S game-server detached:
    screen -r game-css-1;

While you are re-attached to one of the game-server screen sessions, you will have full access to the dedicated-server "console", and my enter any "console" commands as if you had run the game-server interactively. When you are done working on the "console" for that game-server, you may either:
  • Shut-down the game-server: Enter "exit" and press the ENTER key.
  • Leave the game-server running: Use CTRL+A, and then press "d" to leave the game-server running (again) in a "detached" state.

Some screenshots of what that looks-like are included below:
23 - Scripts to "Screen" Game-Servers
In order to make it easier to run the game-servers as "detached" screen sessions, you can create small "scripts" for each one. As with the "run" scripts created earlier, each script file is just a text file (named ending with .sh) that contains the commands to be executed in it, and has been marked as executable (proceeded by "#!/bin/bash" so that Linux knows which language this script is for). Either nano or webmin may be used to create and/or edit the required files. Likewise, Webmin may be used to mark the script files as executable.

Having these scripts will accomplish several things:
  • You will not have to remember exactly which parameters are used for screen.
  • After starting another screen sesssion, will automatically list all the running screen sesssions.
  • You can create additional scripts later that will execute these scripts for you - non-Interactively (more about that later).

A typical script to run a game-server might look like this:
  • Location: ~/scripts (effectively /home/game-server/scripts)
  • Filename: screen-game-something.sh
  • Executable: YES
  • Contents:
    #!/bin/bash cd ~/scripts/; screen -A -m -d -S game-something ./run-game-something.sh; screen -ls;

NOTES:
  • Each will be named with the convention "screen-game-something.sh" to make it obvious that these are for running each game-server as a detached screen session.
  • Ensure you mark each file as executable (presumably using Webmin)!
  • Ensure you include "#!/bin/bash" at the beginning of each file!
  • Ensure you end each subsequent line in the script with a semicolon (";")!

Fistful-of-Frags (1 of 2):
  • Location: /home/game-server/scripts
  • Filename: screen-game-fof-1.sh
  • Contents:
    #!/bin/bash cd ~/scripts/; screen -A -m -d -S game-fof-1 ./run-game-fof-1.sh; screen -ls;

Fistful-of-Frags (2 of 2):
  • Location: /home/game-server/scripts
  • Filename: screen-game-fof-2.sh
  • Contents:
    #!/bin/bash cd ~/scripts/; screen -A -m -d -S game-fof-2 ./run-game-fof-2.sh; screen -ls;

Team Fortress 2:
  • Location: /home/game-server/scripts
  • Filename: screen-game-tf2-1.sh
  • Contents:
    #!/bin/bash cd ~/scripts/; screen -A -m -d -S game-tf2-1 ./run-game-tf2-1.sh; screen -ls;

Counter-Strike:Source:
  • Location: /home/game-server/scripts
  • Filename: screen-game-css-1.sh
  • Contents:
    #!/bin/bash cd ~/scripts/; screen -A -m -d -S game-css-1 ./run-game-css-1.sh; screen -ls;

Example Screenshots:
3 Comments
[WL] Weasel (Probably AFK)  [author] 5 Dec, 2024 @ 9:47am 
IN7HESKY 5 Dec, 2024 @ 6:47am 
wot that was really helpful