Difference between revisions of "Server Hosting/Body"
(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...") |
m (Reworded) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
== Quick Start Guide == | == Quick Start Guide == | ||
| − | + | For rapid local testing before hosting publicly: | |
| − | # | + | # '''Acquire files:''' Install <code>Holdfast: Nations At War - Dedicated Server</code> from your Steam library ('''Tools''' section). |
| − | # | + | # '''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. | ||
| − | + | == 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: | |
| − | + | # 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 === | ||
| − | ==== | + | ==== Obtaining the Game Files ==== |
| − | + | You can acquire the dedicated server files using one of two methods: | |
| − | # Open your Steam Library. | + | ==== 1. Steam Client (Recommended) ==== |
| − | # | + | This is the easiest method if you have Steam installed: |
| − | # Install | + | |
| − | # | + | # 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: | ||
|} | |} | ||
| − | ==== | + | ==== 2. SteamCMD ==== |
| − | + | SteamCMD is a command-line utility used to install and update dedicated servers. | |
| − | Download and set up SteamCMD | + | # 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:\ | + | steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastser |
</pre> | </pre> | ||
| − | + | * '''Note:''' The account used must '''own the game'''; anonymous login will fail. | |
| − | : ' | + | * If the server has issues, run the command again with <code>validate</code> to verify files: <code>+app_update 589290 validate</code>. |
| − | |||
| − | |||
| − | === Basic Configuration & Starting | + | === 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 | + | == Basic Configuration & Starting == |
| − | <pre> | + | '''Duplicate Files:''' Following the warning above, make copies of the default files:<pre> |
| − | serverconfig_default.txt | + | serverconfig_default.txt → serverconfig_newserver.txt |
| − | LaunchServer.ps1 | + | LaunchServer.ps1 → LaunchServer_newserver.ps1 |
</pre> | </pre> | ||
| − | Edit | + | '''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| | |
server_port 20100 | server_port 20100 | ||
steam_query_port 27000 | steam_query_port 27000 | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | Basic variables | + | |Basic variables| |
| − | + | 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 | + | '''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" | ||
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: | ||
| − | + | # '''Basic Installation:''' This command runs the server and uses the host network to automatically map required ports. | |
| − | |||
| − | |||
<pre> | <pre> | ||
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw | docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw | ||
</pre> | </pre> | ||
| − | + | '''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 | |
| − | |||
| − | |||
| − | |||
| − | <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 === | ||
| − | + | 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> | ||
| − | + | '''Note:''' Use <code>+app_update 1424230 validate</code> 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: | |
| − | |||
| − | 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> | ||
| − | + | 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" | ||
</pre> | </pre> | ||
| − | + | '''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. | |
| − | |||
| − | : | ||
| − | |||
| − | |||
| − | < | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | </ | ||
| − | Start the | + | '''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> | ||
Latest revision as of 00:45, 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:
- Acquire files: Install
Holdfast: Nations At War - Dedicated Serverfrom your Steam library (Tools section). - Configuration: Modify the default map rotation file, which is located in (
serverconfig_default.txt). - Launch: Start the server using the provided launch script:
LaunchServer.ps1(Windows) orLaunchServer.sh(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
Localhostunless 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.
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:
- Duplicate
serverconfig_default.txtto a custom name (e.g.,serverconfig_myname.txt). - Duplicate the launch script (e.g.,
LaunchServer.ps1toLaunchServer_myname.ps1). - 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:
- 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.
2. SteamCMD
SteamCMD is a command-line utility used to install and update dedicated servers.
- Download and set up SteamCMD.
- 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
validateto verify files:+app_update 589290 validate.
Basic Configuration & Starting
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:
- 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 (settingserver_portandsteam_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
- server_password mypassword


