This repository provides a safe container image for the Sons of the Forest game server. It is designed to be used with Docker Compose, making it easy to set up and manage your game server environment.
- Docker
- Docker Compose
- At least 8GB RAM
Once Docker and Docker Compose are installed, clone this repository to your local machine:
git clone https://github.com/ALTERRQ/sotf-server.git
cd sotf-serverTo start the Sons of the Forest server, navigate to the cloned repository's directory and use Docker Compose:
docker compose build
docker compose up -dThis will build the latest image and start the server in detached mode.
When starting the server for the first time:
- The config files and folders will be automatically created in the
config/folder. - The server will download the latest version of the game from Steam to the
data/folder.
You have to restart after the first start.
To restart the server after making changes to the configuration, use the following command:
docker compose restartTo check the server logs, use the following command:
docker compose logs -fTo update the server, just restart the container. The server checks for updates and validates on every boot per default.
To skip update and validation of the server files on every boot, set the
FAST_BOOTenv variable totrue.
Although this dedicated server generates numerous unnecessary errors and debug logs, this does not indicate malfunction. This project filters out these logs by default.
To turn off log filtering, set the
FILTER_SHADER_AND_MESH_AND_WINE_DEBUGenv variable tofalse.
The server configuration does not differ from the official server configuration. Just follow an existing server configuration guide like this.
The config folder contains the configuration files for the game server:
- The server owners list, in a file called
ownerswhitelist.txt - The game server configuration, in a file called
dedicatedserver.cfg - The game saves, in a folder called
Saves - The game settings, in a file called
SonsGameSettings.cfg
All files and folders in the config will be created automatically when the server is started for the first time.
SkipNetworkAccessibilityTestis always forced totrue, because the test method is not working in a container environment.
The data/ folder contains the game server data.
Feel free to modify files in this folder,
but be aware that the game server must be restarted for changes to take effect.
The folder can be deleted to reset the game server to its default state.
- Try to change server type (far left at the join tab)
- Direct connect to the server:
Example: 192.168.1.100:27016(the option bottom right at the join tab) - Disable any virtual or real network adapters on your pc except the main one (VirtualBox, NordVPN)
- Test via Steam server discovery: (Steam/View/Game Servers), test the LAN discovery or try to add server to favourites by the same syntax as the above suggestion
- If you can connect inside your LAN, but your friends can't from WAN, you need to setup your routers port forwarding, and firewall rules properly
- Try to change the ports (they can be used already, or your ISP is blocking them over the WAN) (you will need to change them at 3 places inside this project + your firewall)
- Set container to host networking
- Use Google, forums, or some AI
If you think everything is set up properly, and you still can't connect to your server, then you could have this problem:
Bad client side config files.
- They can prevent you from discovering, and connecting to any LAN server.
- Deleting them is the solution, but be carefull, because they hold all your settings and game saves
- You also should temporarely disable Steam Cloud for SOTF, otherwise Steam will just redownload the faulty files
- They are located at
C:\Users\$USERNAME\AppData\LocalLow\Endnight\SonsOfTheForeston Windows
I recommend you to:
- Disable Steam Cloud for SOTF (This could have saved me 4 days)
- Turn off Steam compleately
- Backup your Saves inside the
SonsOfTheForestfolder into a different location - Screenshot your important settings in the game (if you need them)
- Delete the folder
- Launch SOTF, check if you can see the server in the LAN section or can connect to it directly, then stop
- Copy back your Saves folder
- Dial back your important settings
- Turn back Steam Cloud
- Play
If you still can't connect, then you can try the: CUSTOM_ACCESSIBILITY_TEST
It checks if the server is accessible, to rule out bad networking configuration
Hier is how to do it:
- Launch the server with
DO_CUSTOM_ACCESSIBILITY_TESTset totrue - When the test appears launch:
./assessibility-test.sh $SERVER_IPfrom a client computer and make sure it's not blocked by a firewall (Default inbound port: 18766 for client)
It will try to do a handshake with your server 3 times. If it succeeds, then we ruled out bad network configuration.
- Inspired by: https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server
- Built from: https://github.com/RouHim/sons-of-the-forest-container-image
- Built to: https://hub.docker.com/r/rouhim/sons-of-the-forest-server
- Based on: https://github.com/RouHim/steamcmd-wine-container-image
- SteamCMD Documentation: https://developer.valvesoftware.com/wiki/SteamCMD
- Dedicated server guide: https://steamcommunity.com/sharedfiles/filedetails/?id=2992700419&snr=1_2108_9__2107
