2021-04-25 08:17:32 +00:00
## Insurgency: Sandstorm Docker Container
2021-04-28 06:34:10 +00:00
[](https://github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/actions/workflows/docker-image.yml)
2021-05-03 12:00:36 +00:00

2021-05-03 15:40:29 +00:00

2021-04-25 08:17:32 +00:00
2021-05-03 11:46:04 +00:00
< p align = "center" >
< img src = "https://github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/blob/master/sandstorm-logo.png" >
< img src = "https://github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/blob/master/docker-logo.png"
< / p >
< / p >
2021-04-24 08:20:09 +00:00
2021-05-05 19:26:09 +00:00
This repository contains a docker image with a dedicated server for Insurgency Sandstorm that you can fully customize to your need for COOP and PVP servers.
2021-04-24 08:20:09 +00:00
2021-05-05 19:26:09 +00:00
This image will be build daily so you don’ t have to update anything inside a container. I tried to build the image as “best-practice” as possible and to document everything for you.
2021-04-25 08:17:32 +00:00
#### Official documentation: [Sandstorm Server Admin Guide](https://sandstorm-support.newworldinteractive.com/hc/en-us/articles/360049211072-Server-Admin-Guide)
2021-05-03 10:25:02 +00:00
#### Another Server Admin Guide [Server Admin Guide by mod.io](https://insurgencysandstorm.mod.io/guides/server-admin-guide)
#### More config examples: [Configs by zWolfi](https://github.com/zWolfi/INS_Sandstorm)
#### ISMC Guide: [ISMCmod Installation Guide](https://insurgencysandstorm.mod.io/guides/ismcmod-installation-guide)
2021-05-11 16:10:58 +00:00
## How to build/get Insurgency Sandstorm dedicated server
2018-12-18 13:59:42 +00:00
cd directory where ```Dockerfile```
2021-05-11 16:12:01 +00:00
```docker build -t andrewmhub/insurgency-sandstorm:latest .``` or get it on [docker hub ](https://hub.docker.com/r/andrewmhub/insurgency-sandstorm ) ```docker pull andrewmhub/insurgency-sandstorm```
2021-04-25 08:17:32 +00:00
## How to launch Insurgency Sandstorm dedicated server
2021-05-11 16:10:58 +00:00
Running multiple instances (use PORT, QUERYPORT and HOSTNAME) and LAUNCH_SERVER_ENV in [modmap.env ](https://github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/blob/master/modmap.env ):
2018-12-18 13:59:42 +00:00
```
2021-04-18 07:33:16 +00:00
docker run -d --restart always --env-file /home/user/coop-modmap/modmap.env \
2021-04-25 16:32:40 +00:00
--name sandstorm-modmap --net=host \
2021-04-18 07:33:16 +00:00
-v /home/user/coop-modmap/Mods:/home/steam/steamcmd/sandstorm/Insurgency/Mods:rw \
-v /home/user/coop-modmap/config/ini:/home/steam/steamcmd/sandstorm/Insurgency/Saved/Config/LinuxServer:ro \
2021-04-24 13:27:48 +00:00
-v /home/user/coop-modmap/config/txt:/home/steam/steamcmd/sandstorm/Insurgency/Config/Server:ro andrewmhub/insurgency-sandstorm:latest
2018-12-18 13:59:42 +00:00
```
2021-05-11 16:10:58 +00:00
Examples config files in directory [config ](https://github.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/tree/master/config )
2018-12-18 16:30:26 +00:00
2021-04-22 18:59:13 +00:00
### docker-compose.yml example
```dockerfile
version: '3.7'
services:
insurgency-sandstorm:
image: andrewmhub/insurgency-sandstorm:latest
container_name: insurgency-sandstorm
restart: unless-stopped
2021-04-22 19:00:46 +00:00
env_file:
- .env
2021-04-22 18:59:13 +00:00
volumes:
- /home/user/coop-modmap/config/ini:/home/steam/steamcmd/sandstorm/Insurgency/Saved/Config/LinuxServer:ro
2021-04-24 13:27:48 +00:00
- /home/user/coop-modmap/config/txt:/home/steam/steamcmd/sandstorm/Insurgency/Config/Server:ro
2021-04-22 18:59:13 +00:00
- /home/user/coop-modmap/Mods:/home/steam/steamcmd/sandstorm/Insurgency/Mods:rw
ports:
- "${PORT}:${PORT}"
- "${QUERYPORT}:${QUERYPORT}"
```
2021-04-22 19:00:46 +00:00
### .env example
```.env
HOSTNAME=[ISMC] MOD MAPS ONLY @120hz
PORT=12345
QUERYPORT=54321
LAUNCH_SERVER_ENV=-MapCycle=MapCycle -Mods ModList=Mods.txt -mutators=ISMCarmory_legacy,ImprovedAI,NoRestrictedArea,ScaleBotAmount,AdvancedSupplyPoints,WelcomeMessage,JoinLeaveMessage,FpLegs,JumpShoot -GameStatsToken=my_token -GameStats -GSLTToken=my_token -ModDownloadTravelTo=TORO?Scenario=Scenario_TORO_Checkpoint_Security
```
2021-04-24 08:20:09 +00:00
2021-05-01 08:15:00 +00:00
## Server auto update
2021-05-03 05:52:45 +00:00
Autoupdate game server. This script will keep your game servers automaticly updated updating intervals announce the server is shutting down for updates
2021-04-29 06:24:21 +00:00
Requirements: [rcon-cli ](https://github.com/gorcon/rcon-cli/releases )
```
wget https://github.com/gorcon/rcon-cli/releases/download/v0.9.1/rcon-0.9.1-amd64_linux.tar.gz
tar -xvzf rcon-0.9.1-amd64_linux.tar.gz
cp rcon-0.9.1-amd64_linux/rcon /usr/local/bin/
```
2021-04-24 08:20:09 +00:00
Get restart script example
2021-04-24 08:26:11 +00:00
2021-04-24 08:20:09 +00:00
```
wget --no-check-certificate -O /opt/restart-ins.sh https://raw.githubusercontent.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/master/AutoUpdater/restart-ins.sh
chmod +x /opt/restart-ins.sh
```
The next script make version comparison
2021-05-03 05:52:45 +00:00
if game server version changed in steam or ISMC mod version you insurgency sandstorm server will automatically restarted and get update
2021-04-24 08:20:09 +00:00
```
wget --no-check-certificate -O /opt/check-manifest.sh https://raw.githubusercontent.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/master/AutoUpdater/check-manifest.sh
chmod +x /opt/check-manifest.sh
```
Get systemd unit daemon
```
wget --no-check-certificate -O /etc/systemd/system/my-server-check.service https://raw.githubusercontent.com/AndrewMarchukov/insurgency-sandstorm-server-dockerize/master/AutoUpdater/my-server-check.service
systemctl daemon-reload
systemctl enable my-server-check.service
systemctl start my-server-check.service
```
2021-05-16 20:09:37 +00:00
## Tips and Tricks
### How to save RAM on UE4 Linux(Docker) dedicated server
if you launch multiple servers on same host you can save some memory, on 2 servers more than 1gb memory saved
```echo 1 > /sys/kernel/mm/ksm/run```
and add launch options ```-useksm -ksmmergeall``` then restart servers
wait some amount of time and check statistics ```grep -H '' /sys/kernel/mm/ksm/*```
```pages_unshared``` means just what it says: the pages could not be shared because they're unique.
```pages_shared``` indicates how many pages are actually in use and being shared.
```pages_sharing``` indicates how many pages the VMs think there are. If you didn't have KSM running, this is how many pages would actually be in use.
2021-05-16 20:14:01 +00:00
So, in your example, 264281 pages have been found to be shareable, and so they were merged into 162221 pages, while 241483 pages were not shareable. KSM saved you about 1032 MB of memory.