Difference between revisions of "Server Hosting/Body"

From Holdfast: Nations At War
Jump to navigation Jump to search
(Created page with "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...")
 
(Reworded & tided)
Line 2: Line 2:
  
 
== Quick Start Guide ==
 
== Quick Start Guide ==
Quick start guide for local testing:
+
For rapid local testing before hosting publicly:
  
# Download <code>Holdfast: Nations At War - Dedicated Server</code> from Steam (<code>Tools</code> section).
+
# '''Acquire files:''' Install <code>Holdfast: Nations At War - Dedicated Server</code> from your Steam library ('''Tools''' section).  
# Change the map rotation file (<code>serverconfig_default.txt</code>) and add mods or change maps.
+
# '''Configuration:''' Modify the default map rotation file, which is located in (<code>serverconfig_default.txt</code>).  
# Launch the server using <code>LaunchServer.ps1</code> (Windows) or <code>LaunchServer.sh</code> (Linux).
+
# '''Launch:''' Start the server using the provided launch script: <code>LaunchServer.ps1</code> (Windows) or <code>LaunchServer.sh</code> (Linux).
 +
# '''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 <code>Localhost</code> unless you changed the port).
 +
# ⚠️ '''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.
  
* In Holdfast’s server browser click **Join Custom Server**, then click the top **Connect** (leave localhost; change the port if required).
+
== 💾 Prevent Overwrites on Update ==
* If you want other players to connect, you’ll likely need to set up port forwarding on your router and open the ports in your local firewall.
+
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:
  
'''Warning: Game updates will overwrite the changes to the <code>LaunchServer</code> script and <code>serverconfig_default.txt</code>. To prevent this, create copies of both files and change the arguments of your custom <code>LaunchServer</code> script to point to your custom <code>serverconfig</code> file.'''
+
# Duplicate <code>serverconfig_default.txt</code> to a custom name (e.g., <code>serverconfig_myname.txt</code>).
 +
# Duplicate the launch script (e.g., <code>LaunchServer.ps1</code> to <code>LaunchServer_myname.ps1</code>).
 +
# Edit your custom launch script to point to your custom config file.
  
== Windows ==
+
== Windows Server Hosting ==
 
=== Obtaining the game files ===
 
=== Obtaining the game files ===
==== Download using Steam Client ====
+
==== Obtaining the Game Files ====
The easiest way is through Steam using the <code>Holdfast: Nations At War - Dedicated Server</code> app in your library.
+
You can acquire the dedicated server files using one of two methods:
  
# Open your Steam Library.
+
==== 1. Steam Client (Recommended) ====
# Choose **Tools** in the library filter (or search for <code>holdfast</code> and tick **Tools**).
+
This is the easiest method if you have Steam installed:
# Install **Holdfast: Nations At War - Dedicated Server**.
+
 
# After install, right-click the app → **Manage** **Browse local files**.
+
# Open your '''Steam Library'''.
 +
# Use the filter to select '''Tools''' (or search for ''Holdfast'' and tick the '''Tools''' box).
 +
# Install '''Holdfast: Nations At War - Dedicated Server'''.
 +
# Once installed, right-click the app → '''Manage''' '''Browse local files''' to access the server folder.
  
 
{|style="margin:0 auto;"
 
{|style="margin:0 auto;"
Line 28: Line 35:
 
|}
 
|}
  
==== Download using SteamCMD ====
+
==== 2. SteamCMD ====
The '''Steam Console Client''' or [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD] is a command-line Steam client used to install/update dedicated servers.
+
SteamCMD is a command-line utility used to install and update dedicated servers.
  
Download and set up SteamCMD (see Valve’s guide). Then run:
+
# Download and set up SteamCMD.
 +
# Run the following command, replacing <code>[LOGINNAME]</code> and <code>[PASSWORD]</code> with your Steam credentials:
 
<pre>
 
<pre>
steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastserver" +app_update 589290 +quit
+
steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastser
 
</pre>
 
</pre>
  
Notes:
+
* '''Note:''' The account used must '''own the game'''; anonymous login will fail.
: ''+anonymous'' will fail here; the account must own the game to download these files.
+
* If the server has issues, run the command again with <code>validate</code> to verify files: <code>+app_update 589290 validate</code>.
: You may be prompted for a two-factor code.
 
: If the server stops working, run with ''+app_update 589290 validate'' to verify files.
 
  
=== Basic Configuration & Starting the Server ===
+
=== Basic Configuration & Starting ===
[[File:FolderStructure.jpg|thumb|Holdfast merged server & game files folder structure]]
+
[[File:FolderStructure.jpg|thumb|Holdfast merged server & game files folder structure|alt=|none]]
  
 
The server files include example configs. See [[Server_Configuration|Server Configuration]] for all options.
 
The server files include example configs. See [[Server_Configuration|Server Configuration]] for all options.
  
Duplicate the defaults:
+
== Basic Configuration & Starting ==
<pre>
+
'''Duplicate Files:''' Following the warning above, make copies of the default files:<pre>
serverconfig_default.txt -> serverconfig_newserver.txt
+
serverconfig_default.txt serverconfig_newserver.txt
LaunchServer.ps1         -> LaunchServer_newserver.ps1
+
LaunchServer.ps1 LaunchServer_newserver.ps1
 
</pre>
 
</pre>
  
Edit the new config:
+
'''Edit Configuration (<code>serverconfig_newserver.txt</code>):''' Set up your ports and server details. '''Both ports must be unique for each server instance.'''
 
<pre>
 
<pre>
### Server & Steam Ports (Both ports must be unique per server instance).
+
|Server & Steam Ports|
 
server_port 20100
 
server_port 20100
 
steam_query_port 27000
 
steam_query_port 27000
</pre>
 
 
'''Notes:'''
 
: Open the corresponding UDP ports in your firewall.
 
: Properly configured servers respond to [https://developer.valvesoftware.com/wiki/Server_queries A2S queries] on ''steam_query_port'' (map, player count, etc.). Official servers do not respond to A2S; community servers do.
 
  
Basic variables:
+
|Basic variables|
<pre>
+
server_name My Custom Server
server_name My Server
+
server_region europe
server_region europe #
+
#server_admin_password defaultAdminPWReplace (Uncomment and replace)
server_admin_password defaultAdminPWReplace
+
#server_password mypassword (Uncomment for private server)
#server_password mypassword
+
</pre>'''Action:''' Ensure the <code>server_port</code> and <code>steam_query_port</code> (UDP) are open in your Windows firewall and have corresponding port forwarding rules on your router. The <code>steam_query_port</code> is what allows the server browser to display information like player count and map.
</pre>
 
  
Update the launch script to use your config:
+
'''Update Launch Script:''' Edit your custom launch script (<code>LaunchServer_newserver.ps1</code>) to ensure the arguments point to your custom config file:<pre>
<pre>
+
# LaunchServer_newserver.ps1 - Example arguments
# LaunchServer_newserver.ps1
+
$args = '-s -r --serverConfigFilePath "serverconfig_newserver.txt" --outputLog "logs_output\outputlog_newserver.txt" ...'
$args = '-s -r --serverConfigFilePath "serverconfig_newserver.txt" --outputLog "logs_output\outputlog_newserver.txt" --logArchivesDirectory "logs_archive" --framerate 120 --serverheadless --adminCommandLogFilePath "logs_adminactions\adminlog_newserver.txt" --chatLogFilePath "logs_chat\chatlog_newserver.txt" --playersLogFilePath "logs_playerlogin\playerlogin_newserver.txt" --scoreboardLogFilePath "logs_score\scorelog_newserver.txt"'
 
 
Start-Process -FilePath "vapuriloadtester.exe" -Verb RunAs -ArgumentList $args
 
Start-Process -FilePath "vapuriloadtester.exe" -Verb RunAs -ArgumentList $args
 
</pre>
 
</pre>
  
Run <code>LaunchServer_newserver.ps1</code> to start the server.
+
'''Start Server:''' Run <code>LaunchServer_newserver.ps1</code> to start the server process.
 +
== Linux Server Hosting ==
 +
=== 🐳 Docker Setup (Recommended) ===
 +
Using the official Docker image simplifies installation, maintenance, and updates:
  
== Linux ==
+
# '''Basic Installation:''' This command runs the server and uses the host network to automatically map required ports.
=== Docker ===
 
If you use [https://www.docker.com/ Docker]:
 
 
<pre>
 
<pre>
 
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw
 
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw
 
</pre>
 
</pre>
  
The container auto-updates on start—restart it after a game update.
+
'''Custom Ports:''' To run multiple instances, you can specify custom ports using environment variables:):<pre>
 
+
docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw  
Config path: <code>/home/steam/holdfastnaw-dedicated/</code>
 
 
 
Another instance (adjust ports):
 
<pre>
 
docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw
 
 
</pre>
 
</pre>
  
 
Docker Hub:
 
Docker Hub:
 
[https://hub.docker.com/r/cm2network/holdfastnaw/ https://hub.docker.com/r/cm2network/holdfastnaw/]
 
[https://hub.docker.com/r/cm2network/holdfastnaw/ 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 <code>/home/steam/holdfastnaw-dedicated/</code>.
  
 
=== Manual Setup ===
 
=== Manual Setup ===
==== Downloading using SteamCMD ====
+
If you are not using Docker, you can manually set up the server using SteamCMD.
Install [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD], then:
+
 
<pre>
+
Install [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD], then run the following to download the dedicated server files (App ID <code>1424230</code>):<pre>
steamcmd.sh +login anonymous +force_install_dir /opt/holdfastserver +app_update 1424230 +quit
+
steamcmd.sh +login anonymous +force_install_dir /opt/holdfastserver +app_update 1424230 +quit  
 
</pre>
 
</pre>
  
Notes:
+
'''Note:''' Use <code>+app_update 1424230 validate</code> later to verify the files if needed.
: To verify files later: ''+app_update 1424230 validate''.
+
== Basic Configuration & Starting the Server (Manual) ==
 
+
'''Duplicate Config:''' Navigate to the server directory and copy the default config:
==== Basic Configuration & Starting the Server (Linux) ====
 
Duplicate the default config:
 
 
<pre>
 
<pre>
 
cd /opt/holdfastserver
 
cd /opt/holdfastserver
cp serverconfig_default.txt serverconfig_myserver.txt
+
cp serverconfig_default.txt serverconfig_myserver.txt  
 
</pre>
 
</pre>
  
Configure ports:
+
* '''Edit Config (<code>serverconfig_myserver.txt</code>):''' Configure your ports and server details as detailed in the Windows section (setting <code>server_port</code> and <code>steam_query_port</code>).
 
<pre>
 
<pre>
### Server & Steam Ports (Both ports must be unique per server instance).
+
cd /opt/holdfastserver
server_port 20100
+
./Holdfast\ NaW \
steam_query_port 27000
+
-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"
 
</pre>
 
</pre>
  
Notes:
+
'''Note:''' Replace <code>"serverconfig_myserver.txt"</code> with your actual config file name and verify the port <code>-p "20100"</code> matches your configuration file.
: Open the UDP ports in your firewall.
 
: Properly configured servers respond to A2S on ''steam_query_port''.
 
 
 
Basic variables:
 
<pre>
 
server_name My Server
 
server_region europe #
 
server_admin_password defaultAdminPWReplace
 
#server_password mypassword
 
</pre>
 
  
Start the server:
+
'''Start Server:''' Execute the main game file with required arguments. This uses the <code>-startserver</code> flag and runs in a headless, no-graphics mode for stability:
 
<pre>
 
<pre>
 
"./Holdfast NaW" -startserver \
 
"./Holdfast NaW" -startserver \
Line 149: Line 140:
 
   -logArchivesDirectory "logs_archive/" \
 
   -logArchivesDirectory "logs_archive/" \
 
   -p "20100"
 
   -p "20100"
 +
</pre><pre>
 +
server_name My Server
 +
server_region europe #
 +
server_admin_password defaultAdminPWReplace
 +
#server_password mypassword
 
</pre>
 
</pre>

Revision as of 00:43, 12 October 2025

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