Server Installation

Any questions regarding server installation or other general server questions can be answered in the Squad Hosting discord.

Important Notes
NAT Loopback is required to host and play on the same network.

Servers will show up in the "Custom Browser" unless they are licensed.

Windows
Visual C++ Redistributable for Visual Studio 2013 vc_redist.x64.exe

Visual C++ Redistributable for Visual Studio 2015 vc_redist.x64.exe

DirectX End-User Runtimes (June 2010)

Linux
GLIBC 2.17 or higher

Windows
1. Download SteamCmd and extract to your preferred directory.

2. Open SteamCmd or create a file called "update server.bat" with the following contents. SET STEAMCMD="C:\steamcmd\steamcmd.exe" %STEAMCMD% +login anonymous +force_install_dir "C:\servers\squad_server" +app_update 403240 validate 3. Run the .bat file to install the server files. When the installation is complete, you can close the window.

4. Go to the server folder ("C:\servers\squad_server"), and create a new file called "start.bat" with the following contents. This is the file you will use to start the server. start SquadGameServer.exe Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=ALWAYS -log Your server is now installed, however you must still configure your network to allow players to connect to your server from the internet. You can find Squad's connection ports in the "Ports to Open" section below.

Linux
First of all this guide assumes you've got a Linux Distribution installed with 64 bit architecture. Most hosting companies will run 64bit.

Other than that, this guide needs no Linux experience whatsoever and will be in completely "for dummies" mode.

Anything in this guide that comes after the symbol $ is a command that you're supposed to run in the Linux terminal.

'''PROTIP: The Linux terminal autocompletes with TAB. So if you have a file or folder called "testfolder" you can write "test" and press tab and it will autofill to testfolder!'''

A suggested software to use to connect to your Linux server terminal is PUTTY. https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe

All right, let's get started:

INSTALLING SERVER:

1. Log in as root and install the software screen and a library needed for SteamCMD Debian/Ubuntu: $ apt-get install screen lib32gcc1 CentOS: $ yum -y install screen glibc libstdc++ glibc.i686 libstdc++.i686 2. Create a user you want to use for the squadgameservers. $ adduser username Enter a password for the user of your own choosing. You may have to change the password with "sudo passwd username" When prompted for full name, room number, work phone, home phone, and other just press enter. When asked if information is correct write Y and press enter

3. Log on to the new user account: ssh username@localhost and then the password you selected.

4. Make a directory named SquadGameServer

$ mkdir SquadGameServer 5. Enter the folder $ cd SquadGameServer 6. Download and extract SteamCMD using one of these commands $ wget -q -O - https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar xzv $ curl -so - https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar xzv

NOTE: Some have complained about getting an untrusted/license error of some sort. If that is the case, try this:

$ wget -q -O - http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar xzv $ curl -so - http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar xzv

7. Create a script for installing (And later updating) the first server instance $ echo "./steamcmd.sh +login anonymous +force_install_dir server1 +app_update 403240 validate" > updateserver1.sh 8. Make the script executable $ chmod +x updateserver1.sh 9. Install the server instance (this same command is used later to update the server when a new version is released.) $ ./updateserver1.sh 10. When it's finished it will say "Success! App '403240' fully installed." Quit SteamCMD by writing $ exit and hitting enter. 11. Create a script for starting the server instance $ echo "cd server1; ./SquadGameServer.sh Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=NONE" > startserver1.sh 12. Make the script executable $ chmod +x startserver1.sh 13. Open a screen window to run the server in then enter that screen $ screen -dmS server1 $ screen -r server1 14. Start your server $ ./startserver1.sh Screen allows the server to run even if you've shut down your SSH session (putty).

EDITING CONFIG FILES:

1. Log on as your the user account running the server and go into the Serverconfig folder located in SquadGameServer/server1/SquadGame/ServerConfig in our example. $ cd SquadGameServer/server1/SquadGame/ServerConfig 2. Open the file you wish to edit with a text editor (in this case nano). $ nano Server.cfg Edit file. When you're done, save the file. If you are using nano save the file with ctrl+o and then enter. Exit nano with ctrl+x.

STOPPING SERVER:

1. SSH to your linux server as the user running the squadgameserver. (Not root) Once in the terminal, open up the screen for said server instance, in above example called server1 $ screen -r server1 2. You will now see the SquadGameServer log window, press CTRL+C and it will shut the server down. After that you can start it again with your startcommand.

Docker
If your server is running Docker, you can skip the above steps and simply use: docker run -d --net=host --name=squad-dedicated cm2network/squad The container will automatically update the game on startup, so if there is a game update just restart the container.

The configs will be located here: /home/steam/squad-dedicated/SquadGame/ServerConfig/

When a Docker container is destroyed, it’s entire file system is destroyed too. Instead of editing files on the container, its a good idea to use Docker Volumes, the benefit of this is that the data is persistent, if you remove the container and create a new one from the image you wont need to amend any config files. In this example we have created a persistent volume called "squad_data", where a new file system will be automatically be generated. In order to get the Squad container to use the new volume we have to bind the volume utilizing the "-v" / "--volume" parameter. docker run -d --net=host -v squad_data:/home/steam/squad-dedicated --name=squad-dedicated cm2network/squad
 * Docker Volumes


 * Docker Bind-mounts

Docker Bind-mounts provide similar benefits to Volumes but utilize the host file system instead of virtualized Volumes thus providing easy access to the files.

If you want to launch another instance you can increment the environment variables, using -e (--env): docker run -d --net=host -e PORT=7788 -e QUERYPORT=27166 -e RCONPORT=21115 --name=squad-dedicated2 cm2network/squad Make sure you dont forget to update Rcon.cfg with the new port (the config defaults to 21114).
 * Multiple Instances

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

Linux
The important things to create different instance inside your server are these:

- Duplicate the directory and rename it.

- After that, edits the config files and set on the Rcon.cfg a port 10 numbers later the one of the previous instance.

EXAMPLE:

Server1 Rcon Port: 21114

Server2 Rcon Port: 21124

- Keep on your mind to change the port of connection in the start.sh script to avoid other problems.

BETA PARAMETERS
Licensed server owners will sometimes be given access to new testing versions of the game. These testing versions are typically released in a separate depot in steam. To accessing these testing versions replace NAMEOFTHEBETA and PASSWORD with the name and password of the beta.

Linux
./steamcmd.sh +login anonymous +force_install_dir server1 +app_update 403240 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit

Windows
SET STEAMCMD="C:\steamcmd\steamcmd.exe" %STEAMCMD% +login anonymous +force_install_dir "C:\servers\squad_server" +app_update 403240 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit

To install a server for the Squad - Public Testing app the app ID must be 774961 instead of 403240.

Linux
./steamcmd.sh +login anonymous +force_install_dir server1 +app_update 774961 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit

Windows
SET STEAMCMD="C:\steamcmd\steamcmd.exe" %STEAMCMD% +login anonymous +force_install_dir "C:\servers\squad_server" +app_update 774961 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit

Ports to Open
Port forwarding differs by router and ISP manufacturer but typically involves entering into an advanced tab in your router settings.

Need to be open on Windows firewall and router (only inbound)

Game port = UDP 7787 + 7788 Steam query port = UDP and TCP 27165 Steam query port+1 = UDP and TCP 27166 RCON Port = UDP and TCP 21114

Tips
Make sure Steam Client is closed. If its open Squad Server will not run. For support issues related to server hosting please visit the OWI Squad Hosting Discord Server http://discord.me/squadhosting

(Windows) Allowing the SquadGameServer.exe files through the firewall will save you headaches.

When hosting a Squad server and playing Squad on the same PC, the server must be started before logging on to Steam and launching Squad. Otherwise it won't work.

Files (Instanced hosts start here)
Configuration files are located in Configuration files located in this directory are Admins.cfg Bans.cfg CustomOptions.cfg ExcludedFactions.cfg ExcludedFactionSetups.cfg ExcludedLayers.cfg ExcludedLevels.cfg LayerRotation.cfg LevelRotation.cfg License.cfg Motd.cfg (optional) Rcon.cfg RemoteAdminListHosts.cfg RemoteBanListHosts.cfg Server.cfg ServerMessages.cfg VoteConfig.cfg

Server configuration
After we set up the server we need to configure it.

For this we're moving to the next page: Server Configuration