Any questions regarding server installation or other general server questions can be answered in the Squad Hosting discord.
- 1 Important Notes
- 2 Requirements
- 3 Installation
- 4 MULTI INSTANCE
- 5 BETA PARAMETERS
- 6 Ports to Open
- 7 Tips
- 8 Files (Instanced hosts start here)
- 9 Server configuration
NAT Loopback is required to host and play on the same network.
Servers will show up in the "Custom Browser" unless they are licensed.
GLIBC 2.17 or higher
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 login anonymous // -> logs in with steams public anonymous account // -> Your Server instance force_install_dir ../squad_server // -> will create a folder named "squad_server" in SteamCMDs parent directory 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.
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\SquadGameServer.exe SET UPDATESCRIPT=C:\steamcmd\update_squad.txt start %STEAMCMD% +runscript %UPDATESCRIPT% start %SQUADSERVER% Port=7787 QueryPort=27165 FIXEDMAXPLAYERS=80 RANDOM=ALWAYS -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.
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:
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 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
8. Make the script executable
$ chmod +x updateserver1.sh
9. Create a screen to run your server in
$ screen -dmS server1 $ screen -r server1
10. Start your server
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.
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.
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/
This section is intended for advanced system administrators that know how to use docker compose. There is an example compose file below.
1 version: "3" 2 volumes: 3 squad_data: 4 5 services: 6 squad-event: 7 image: cm2network/squad 8 stdin_open: true 9 tty: true 10 restart: always 11 volumes: 12 - squad_data:/home/steam/squad-dedicated/ 13 14 environment: 15 - PORT=7787 16 - QUERYPORT=27165 17 - RCONPORT=21114 18 - FIXEDMAXPLAYERS=100 19 ports: 20 - 7787:7787/tcp 21 - 7788:7788/tcp 22 - 27165:27165/tcp 23 - 27166:27166/tcp 24 - 21114:21114/tcp 25 - 7787:7787/udp 26 - 7788:7788/udp 27 - 27165:27165/udp 28 - 27166:27166/udp 29 - 21114:21114/udp
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.
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.
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.
./steamcmd.sh +login anonymous +force_install_dir server1 +app_update 403240 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit
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.
./steamcmd.sh +login anonymous +force_install_dir server1 +app_update 774961 -beta NAMEOFTHEBETA -betapassword PASSWORD validate +quit
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
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
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
After we set up the server we need to configure it.
For this we're moving to the next page: Server Configuration