Squad Wiki
Advertisement

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.

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)
Latest C++ Redistrubutable

Linux[ | ]

GLIBC 2.17 or higher

Installation[ | ]

Preparations[ | ]

First we will need to install SteamCMD for our host and prepare our SteamCMD script.

To create the SteamCMD script create a file in the root directory of you SteamCMD installation and add following content:

// -> Start of "update_squad.txt"
@ShutdownOnFailedCommand 1 // -> set to 0 if updating multiple servers at once
@NoPromptForPassword 1 // -> disables promt for password on execution

force_install_dir ../squad_server // -> will create a folder named "squad_server" in SteamCMDs parent directory

login anonymous // -> logs in with steams public anonymous account

app_update 403240 validate // -> will update the squad server and validate the files recived

// -> End of the Script
quit

now we can proceed with the specific steps for each system.

Windows[ | ]

1. Follow the steps from Preperations.

2. Open SteamCmd or create a file called "start server.bat" with the following contents.

SET STEAMCMD=C:\steamcmd\steamcmd.exe
SET SQUADSERVER=C:\squad\SquadGame\Binaries\Win64\SquadGameServer.exe
SET UPDATESCRIPT=C:\steamcmd\update_squad.txt

start %STEAMCMD% +runscript %UPDATESCRIPT%
start %SQUADSERVER% Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 beaconport=15000 RANDOM=NONE -log
exit

3. Run the .bat file to install the server files. When the installation is complete, the server will be started.

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://www.putty.org/


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 the script of SteamCMD file(update_squad.txt) the first server instance and than starting it

    $ echo "./steamcmd.sh +runscript ./update_squad.txt; cd server1; ./SquadGameServer.sh Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=NONE"  > startserver1.sh
    $vim update_squad.txt

    Here you need to press'i' into insert mod and insert this text:

login anonymous
force_install_dir server1
app_update  403240 validate
quit

    When you ready, press'ESC' to stop insert,and input

:wq!

and press 'Enter' to save and quit

8. Make the script executable

    $ chmod +x startserver1.sh

9. Create a screen to run your server in

    $ screen -dmS server1
    $ screen -r server1

10. 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/

  • 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 volume create squad_data

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

  • 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/

Docker (Compose)[ | ]

This section is intended for advanced system administrators that know how to use docker compose. There is an example compose file below.

version: "3"
volumes:
  squad_data:

services:
  squad-event:
    image: cm2network/squad
    stdin_open: true
    tty: true
    restart: always
    volumes:
      - squad_data:/home/steam/squad-dedicated/

    environment:
      - PORT=7787
      - beaconport=15000
      - QUERYPORT=27165
      - RCONPORT=21114
      - FIXEDMAXPLAYERS=100
    ports:
      - 7787:7787/tcp
      - 7788:7788/tcp
      - 15000:15000/tcp
      - 27165:27165/tcp
      - 27166:27166/tcp
      - 21114:21114/tcp
      - 7787:7787/udp
      - 7788:7788/udp
      - 15000:15000/udp
      - 27165:27165/udp
      - 27166:27166/udp
      - 21114:21114/udp

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[ | ]

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 +force_install_dir server1 +login anonymous +app_update 403240 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit 

Windows[ | ]

SET STEAMCMD="C:\steamcmd\steamcmd.exe"
%STEAMCMD% +force_install_dir "C:\servers\squad_server" +login anonymous +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 +force_install_dir server1 +login anonymous +app_update 774961 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit 

Windows[ | ]

SET STEAMCMD="C:\steamcmd\steamcmd.exe"
%STEAMCMD% +force_install_dir "C:\servers\squad_server" +login anonymous +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
Beacon Port = UDP and TCP 15000
Steam query port = UDP and TCP 27165
Steam query port+1 = UDP and TCP 27166
RCON Port = UDP and TCP 21114
Ephemeral Ports** = UDP 30000+

Windows Firewall Script (Save as bat file run as administrator, change ports per installation as necessary included are the standard ports)

<<netsh advfirewall firewall add rule Name= "Squad Game Port 7787 TCP" dir=in protocol=tcp localport=7787 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7787 UDP" dir=in protocol=udp localport=7787 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7788 TCP" dir=in protocol=tcp localport=7788 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7788 UDP" dir=in protocol=udp localport=7788 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port27165 TCP" dir=in protocol=tcp localport=27165 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27165 UDP" dir=in protocol=udp localport=27165 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27166 TCP" dir=in protocol=tcp localport=27166 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27166 UDP" dir=in protocol=udp localport=27166 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Rcon 21114 TCP" dir=in protocol=tcp localport=21114 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Rcon 21114 UDP" dir=in protocol=udp localport=21114 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7787 TCP" dir=out protocol=tcp localport=7787 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7787 UDP" dir=out protocol=udp localport=7787 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7788 TCP" dir=out protocol=tcp localport=7788 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Game Port 7788 UDP" dir=out protocol=udp localport=7788 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port27165 TCP" dir=out protocol=tcp localport=27165 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27165 UDP" dir=out protocol=udp localport=27165 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27166 TCP" dir=out protocol=tcp localport=27166 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Steam Query Port 27166 UDP" dir=out protocol=udp localport=27166 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Rcon 21114 TCP" dir=out protocol=tcp localport=21114 action=allow profile=any
netsh advfirewall firewall add rule Name= "Squad Rcon 21114 UDP" dir=out protocol=udp localport=21114 action=allow profile=any


**Squad also uses Ephemeral Ports for connections between itself and individual clients, after the initial connection using the above ports. This can be observed with netstat after a client successfully connects and is in-game. Depending on your provider, you may need to allow all UDP ports above 30000 in your firewall.

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.

(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[ | ]

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

Advertisement