Skip to content

Instantly share code, notes, and snippets.

@Aldiwildan77
Last active February 27, 2024 13:55
Show Gist options
  • Save Aldiwildan77/86056e985c66037c2ab19802a3149ca3 to your computer and use it in GitHub Desktop.
Save Aldiwildan77/86056e985c66037c2ab19802a3149ca3 to your computer and use it in GitHub Desktop.
The Forest Dedicated Server LINUX
id -u the-forest &>/dev/null 2>&1 || useradd -m the-forest;
cd /home/the-forest;
sudo dpkg --add-architecture i386;
echo -e "\e[32mArchitecture for 32bit successfully added\e[0m";
sudo apt update && sudo apt install lib32gcc1 steamcmd wine-stable winbind xvfb -y;
sudo apt dist-upgrade -y && sudo apt autoremove -y;
echo -e "\e[32mModules successfully installed\e[0m";
sudo ln -s /usr/games/steamcmd steamcmd;
echo -e "\e[32msteamcmd linked into /usr/games/steamcmd\e[0m";
cd ~;
steamcmd +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir ~/the-forest +app_update 556450 validate +quit;
echo -e "\e[32mThe Forest successfully installed\e[0m";
mkdir -p ~/games/data/forest/{saves,config};
SERVERNAME="ChromaGaming";
SERVERIP="10.0.0.4";
SERVERPASS=$1;
SERVERPASSCONFIRM=$2;
if [[ ("$SERVERPASS" != "$SERVERPASSCONFIRM") || ( -z "$SERVERPASS" ) || ( -z "$SERVERPASSCONFIRM" ) ]]
then
echo -e "\e[31mPassword validation error!\e[0m";
exit 1;
fi
echo -e "\e[32mCreating The Server...\e[0m";
screen -t 'forest' -S 'forest' -dm bash -c 'cd /home/the-forest; xvfb-run --auto-servernum --server-args="-screen 0 640x480x24:32" wine /home/the-forest/the-forest/TheForestDedicatedServer.exe -batchmode -dedicated -nosteamclient -serverip '"$SERVERIP"' -serversteamport 8766 -servergameport 27015 -serverqueryport 27016 -servername '"$SERVERNAME"' -serverplayers 14 -serverautosaveinterval 15 -difficulty Normal -inittype Continue -slot 3 -serverpassword '"$SERVERPASS"' -enableVAC on; exec sh';
echo -e "\e[32mThe screen has been initialized and the forest dedicated server is running\e[0m \nCheck server info run \"screen -r forest\"";
SERVERNAME="ChromaGaming";
SERVERIP="10.0.0.4";
SERVERPASS=$1;
SERVERPASSCONFIRM=$2;
if [[ ("$SERVERPASS" != "$SERVERPASSCONFIRM") || ( -z "$SERVERPASS" ) || ( -z "$SERVERPASSCONFIRM" ) ]]
then
echo -e "\e[31mPassword validation error!\e[0m";
exit 1;
fi
echo -e "\e[32mCreating The Server...\e[0m";
screen -t 'forest' -S 'forest' -dm bash -c 'cd /home/the-forest; xvfb-run --auto-servernum --server-args="-screen 0 640x480x24:32" wine /home/the-forest/the-forest/TheForestDedicatedServer.exe -batchmode -dedicated -nosteamclient -serverip '"$SERVERIP"' -serversteamport 8766 -servergameport 27015 -serverqueryport 27016 -servername '"$SERVERNAME"' -serverplayers 14 -serverautosaveinterval 15 -difficulty Normal -inittype Continue -slot 3 -serverpassword '"$SERVERPASS"' -enableVAC on; exec sh';
echo -e "\e[32mThe screen has been initialized and the forest dedicated server is running\e[0m \nCheck server info run \"screen -r forest\"";
@Aldiwildan77
Copy link
Author

THE FOREST DEDICATED SERVER LINUX

HOW TO INSTALL

  1. Download this zip
  2. Extract on your own location path
  3. Run $ chmod +x ./server-install.sh
  4. Run $ ./server-install.sh

HOW TO RUN

If you already run the server-install.sh then your server is shutting down, you can re-run the server using server-run.sh

  1. Run $ chmod +x ./server-run.sh
  2. Run $ ./server-sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment