Squad Wiki
Advertisement

Requirements

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

Installation

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. Directions for port forwarding will be dependent on your model router / network setup.

Further info on server setup and configuration can be found in their respective sections on this page.


Linux

First of all this guide assumes you've got a Linux Distribution installed with 64 bit architecture. Most hosting companies will run 64bit so not to worry.
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


Any questions? Contact server owners on Discord, you can find them in the Squad Hosting discord
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).

    $ $EDITOR 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 config is located here: /home/steam/squad-dedicated/SquadGame/ServerConfig/

  • Docker Volumes

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.

docker run -d --net=host --volume=/<Your local directory>:/home/steam/squad-dedicated --name=squad-dedicated cm2network/squad
  • Multiple Instances

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).

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

MULTI INSTANCE

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

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

Tips

Make sure Steam Client is closed. If its open Squad Server will not run. For support issues related to server hosting please visit our 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.

AppID - 403240

Ports to Open

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

Port = Game port = UDP (Default 7787, 7788 UDP)
QueryPort = Steam query port = UDP (Default 27165 UDP)
QueryPort+1 = Second Steam query port = UDP and TCP (Default 27165, 27166 UDP and TCP)
RCON Port = UDP and TCP (Default 21114) must be open.


So following default ports to open:

Default Inbound TCP: 27165-27166, 21114

Default Inbound UDP: 7787-7788, 27165-27166, 21114

Command Line

All of the following parameters can be added to your starting command line for additional configuration. Be careful to avoid typos when adding these!

MULTIHOME = The IP Address you want to bind the server to. (Use only if you have multiple IPs on your server) (Optional)
Port = Game port
QueryPort = Steam query port
RANDOM = Randomize map rotation (ALWAYS, FIRST, NONE) (Optional)
FIXEDMAXPLAYERS = Player count cannot go higher than this (Optional)
FIXEDMAXTICKRATE = MAX server tickrate (Optional)
PREFERPREPROCESSOR = CPU Affinity (Optional) UNTESTED
-log = Display a log window on the server (Optional)
-fullcrashdump = Save a full dump file on crash (can become quite large sometimes) (Optional)

The following line implements additional start parameters as an example.

start SquadGameServer.exe MULTIHOME=1.2.3.4 Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 FIXEDMAXTICKRATE=50 RANDOM=ALWAYS -log

Set processor Affinity

Windows

You can use the start-command allows you to set the core thread affinity for each server (if you run several servers on one machine):

start /AFFINITY C /WAIT SquadGameServer.exe Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=ALWAYS -log

Calculating AFFINITY

Squad Affinity Calculator.png

Open your Windows calculator.

Step 1 - Click menu icon

Step 2 - Enable "programmer" mode

Step 3 - Toggle bit keypad

Step 4 - Click until you see BYTE which corresponds to 4 core 8 threads CPU (You can select other values to correspond your CPU).

Step 5 - Click on HEX

Core thread count starts from 0, you can see which number is responsible for which core thread on the third image. 1 means core thread is selected, 0 means core thread is ignored.

Result you need is shown in "HEX", if you have all core thread selected 0-7 you will see "FF" as your result. For our /AFFINITY parameter we need then "FF" to set the core affinity to all core threads. If you want to select only core threads 4-7 (0000 1111) your result should be "F".

Linux

Linux users can also set their core affinity by using the "taskset" command in their start line. Keep in mind that core threads are zero-indexed. This means if you have 8 processor threads, you can assign cores 0-7.

cd server1; taskset -c 0-3 ./SquadGameServer.sh Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=NONE

Files (Instanced hosts start here)

Configuration files are located in C:\servers\squad_server\SquadGame\ServerConfig\ Configuration files located in this directory are

Admins.cfg
Bans.cfg
License.cfg
MapRotation.cfg
Motd.cfg (optional)
Rcon.cfg
RemoteAdminListHosts.cfg
RemoteBanListHosts.cfg
Server.cfg
ServerMessages.cfg
Advertisement