Server Hosting/Body

From Holdfast: Nations At War
Jump to navigation Jump to search

The following documentation details how to host a public or private game server for Holdfast: Nations At War. The game offers an anonymous dedicated server for both Linux and Windows.

Quick Start Guide

For rapid local testing before hosting publicly:

  1. Acquire files: Install Holdfast: Nations At War - Dedicated Server from your Steam library (Tools section).
  2. Configuration: Modify the default map rotation file, which is located in (serverconfig_default.txt).
  3. Launch: Start the server using the provided launch script: LaunchServer.ps1 (Windows) or LaunchServer.sh (Linux).
  4. Connect: In the Holdfast game, go to the server browser, click Join Custom Server, and then click the top Connect button (leaving the address as Localhost unless you changed the port).
  5. ⚠️ Important: To allow other players to connect, you must configure port forwarding on your router and open the necessary UDP ports in your local firewall.

Prevent Overwrites on Update

💾 Game updates often overwrite the default launch script and configuration file. To prevent this, always create copies of these files and use the copies for your custom server:

  1. Duplicate serverconfig_default.txt to a custom name (e.g., serverconfig_myname.txt).
  2. Duplicate the launch script (e.g., LaunchServer.ps1 to LaunchServer_myname.ps1).
  3. Edit your custom launch script to point to your custom config file.

Windows Server Hosting

Obtaining the game files

Obtaining the Game Files

You can acquire the dedicated server files using one of two methods:

1. Steam Client (Recommended)

This is the easiest method if you have Steam installed:

  1. Open your Steam Library.
  2. Use the filter to select Tools (or search for Holdfast and tick the Tools box).
  3. Install Holdfast: Nations At War - Dedicated Server.
  4. Once installed, right-click the app → ManageBrowse local files to access the server folder.
Steam application to download
Browse local files in Steam

2. SteamCMD

SteamCMD is a command-line utility used to install and update dedicated servers.

  1. Download and set up SteamCMD.
  2. Run the following command, replacing [LOGINNAME] and [PASSWORD] with your Steam credentials:
steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastser
  • Note: The account used must own the game; anonymous login will fail.
  • If the server has issues, run the command again with validate to verify files: +app_update 589290 validate.

Basic Configuration & Starting

Holdfast merged server & game files folder structure

The server files include example configs. See Server Configuration for all options.

Basic Configuration & Starting

Duplicate Files: Following the warning above, make copies of the default files:

serverconfig_default.txt → serverconfig_newserver.txt
LaunchServer.ps1 → LaunchServer_newserver.ps1

Edit Configuration (serverconfig_newserver.txt): Set up your ports and server details. Both ports must be unique for each server instance.

|Server & Steam Ports|
server_port 20100
steam_query_port 27000

|Basic variables|
server_name My Custom Server
server_region europe
#server_admin_password defaultAdminPWReplace (Uncomment and replace)
#server_password mypassword (Uncomment for private server)

Action: Ensure the server_port and steam_query_port (UDP) are open in your Windows firewall and have corresponding port forwarding rules on your router. The steam_query_port is what allows the server browser to display information like player count and map. Update Launch Script: Edit your custom launch script (LaunchServer_newserver.ps1) to ensure the arguments point to your custom config file:

# LaunchServer_newserver.ps1 - Example arguments
$args = '-s -r --serverConfigFilePath "serverconfig_newserver.txt" --outputLog "logs_output\outputlog_newserver.txt" ...'
Start-Process -FilePath "vapuriloadtester.exe" -Verb RunAs -ArgumentList $args

Start Server: Run LaunchServer_newserver.ps1 to start the server process.

Linux Server Hosting

Docker Setup (Recommended)

🐳 Using the official Docker image simplifies installation, maintenance, and updates:

  1. Basic Installation: This command runs the server and uses the host network to automatically map required ports.
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw

Custom Ports: To run multiple instances, you can specify custom ports using environment variables:):

docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw 

Docker Hub: https://hub.docker.com/r/cm2network/holdfastnaw/

Note: The container automatically checks for updates on start. You must restart the container after a game update to apply it. The configuration files are located inside the container at /home/steam/holdfastnaw-dedicated/.

Manual Setup

If you are not using Docker, you can manually set up the server using SteamCMD.

Install SteamCMD, then run the following to download the dedicated server files (App ID 1424230):

steamcmd.sh +login anonymous +force_install_dir /opt/holdfastserver +app_update 1424230 +quit 

Note: Use +app_update 1424230 validate later to verify the files if needed.

Basic Configuration & Starting the Server (Manual)

Duplicate Config: Navigate to the server directory and copy the default config:

cd /opt/holdfastserver
cp serverconfig_default.txt serverconfig_myserver.txt 
  • Edit Config (serverconfig_myserver.txt): Configure your ports and server details as detailed in the Windows section (setting server_port and steam_query_port).
cd /opt/holdfastserver
./Holdfast\ NaW \
-startserver -batchmode -nographics \
-screen-width 640 -screen-height 480 -screen-quality "Fastest" \
-framerate "120" --serverheadless \
-serverConfigFilePath "serverconfig_myserver.txt" \
-logFile "logs_output/outputlog_server.txt" \
-logArchivesDirectory "logs_archive/" \
-p "20100"

Note: Replace "serverconfig_myserver.txt" with your actual config file name and verify the port -p "20100" matches your configuration file.

Start Server: Execute the main game file with required arguments. This uses the -startserver flag and runs in a headless, no-graphics mode for stability:

"./Holdfast NaW" -startserver \
  -batchmode \
  -nographics \
  -screen-width 640 \
  -screen-height 480 \
  -screen-quality "Fastest" \
  -framerate "120" \
  --serverheadless \
  -serverConfigFilePath "serverconfig_myserver.txt" \
  -logFile "logs_output/outputlog_server.txt" \
  -logArchivesDirectory "logs_archive/" \
  -p "20100"

server_name My Server server_region europe # server_admin_password defaultAdminPWReplace

  1. server_password mypassword