Difference between revisions of "Server Hosting"
Jump to navigation
Jump to search
(→Download using SteamCMD: Adds support information for A2S queries.) |
|||
| Line 1: | Line 1: | ||
| + | {{DISPLAYTITLE:Server Hosting}} | ||
| + | {{ContentTemplateModernInline | ||
| + | | welcome = [[File:Forum Logo.png|link=|left|alt=Server Hosting]] | ||
| + | | blurb = How to host a public or private Holdfast server on Windows or Linux (Steam client, SteamCMD, Docker) | ||
| + | | sections_title = On this page | ||
| + | | sections_content = | ||
| + | * [[#Quick Start Guide|Quick Start Guide]] | ||
| + | * [[#Windows|Windows]] | ||
| + | ** [[#Obtaining the game files|Obtaining the game files]] | ||
| + | *** [[#Download using Steam Client|Download using Steam Client]] | ||
| + | *** [[#Download using SteamCMD|Download using SteamCMD]] | ||
| + | ** [[#Basic Configuration & Starting the Server|Basic Configuration & Starting the Server]] | ||
| + | * [[#Linux|Linux]] | ||
| + | ** [[#Docker|Docker]] | ||
| + | ** [[#Manual Setup|Manual Setup]] | ||
| + | *** [[#Downloading using SteamCMD|Downloading using SteamCMD]] | ||
| + | *** [[#Basic Configuration & Starting the Server (Linux)|Basic Configuration & Starting the Server (Linux)]] | ||
| + | |||
| + | | featured_title = Server Hosting | ||
| + | | featured_content = | ||
| + | |||
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. | 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. | ||
| Line 4: | Line 25: | ||
Quick start guide for local testing: | Quick start guide for local testing: | ||
| − | # Download <code>Holdfast: Nations At War - Dedicated Server</code> from Steam (<code>Tools</code> | + | # Download <code>Holdfast: Nations At War - Dedicated Server</code> from Steam (<code>Tools</code> section). |
# Change the map rotation file (<code>serverconfig_default.txt</code>) and add mods or change maps. | # Change the map rotation file (<code>serverconfig_default.txt</code>) and add mods or change maps. | ||
| − | # Launch the server using | + | # Launch the server using <code>LaunchServer.ps1</code> (Windows) or <code>LaunchServer.sh</code> (Linux). |
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | * In Holdfast’s server browser click **Join Custom Server**, then click the top **Connect** (leave localhost; change the port if required). | |
| − | + | * 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. | |
| − | |||
| − | |||
| − | To | + | '''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.''' |
| − | + | == Windows == | |
| + | === Obtaining the game files === | ||
| + | ==== Download using Steam Client ==== | ||
| + | The easiest way is through Steam using the <code>Holdfast: Nations At War - Dedicated Server</code> app in your library. | ||
| − | + | 1. Open your Steam Library. | |
| + | 2. Choose **Tools** in the library filter (or search for <code>holdfast</code> and tick **Tools**). | ||
| + | 3. Install **Holdfast: Nations At War - Dedicated Server**. | ||
| + | 4. After install, right-click the app → **Manage** → **Browse local files**. | ||
| − | + | {|style="margin:0 auto;" | |
| − | {|style="margin: 0 auto;" | + | | [[File:ServerSteamLocation.png|thumb|Steam application to download]] |
| − | | [[File:ServerSteamLocation.png|thumb|Steam | + | | [[File:ServerBrowseLocalFiles.png|thumb|Browse local files in Steam]] |
| − | | [[File:ServerBrowseLocalFiles.png|thumb|Browse local files | ||
|} | |} | ||
| − | ====Download using SteamCMD==== | + | ==== Download using SteamCMD ==== |
| − | The '''Steam Console Client''' or [https://developer.valvesoftware.com/wiki/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. |
| − | + | Download and set up SteamCMD (see Valve’s guide). Then run: | |
<pre> | <pre> | ||
| − | + | steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastserver" +app_update 589290 +quit | |
</pre> | </pre> | ||
Notes: | Notes: | ||
| − | : ''+anonymous'' will fail | + | : ''+anonymous'' will fail here; the account must own the game to download these files. |
| − | : You | + | : 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 the Server === |
[[File:FolderStructure.jpg|thumb|Holdfast merged server & game files folder structure]] | [[File:FolderStructure.jpg|thumb|Holdfast merged server & game files folder structure]] | ||
| − | The server files | + | The server files include example configs. See [[Server_Configuration|Server Configuration]] for all options. |
| − | |||
| − | |||
| + | Duplicate the defaults: | ||
<pre> | <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: | |
| − | |||
<pre> | <pre> | ||
### Server & Steam Ports (Both ports must be unique per server instance). | ### Server & Steam Ports (Both ports must be unique per server instance). | ||
| Line 63: | Line 81: | ||
'''Notes:''' | '''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 | + | Basic variables: |
<pre> | <pre> | ||
server_name My Server | server_name My Server | ||
| Line 75: | Line 92: | ||
</pre> | </pre> | ||
| − | + | Update the launch script to use your config: | |
<pre> | <pre> | ||
| + | # LaunchServer_newserver.ps1 | ||
$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"' | $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. | |
| − | ==Linux== | + | == Linux == |
| − | ===Docker=== | + | === Docker === |
| − | If | + | 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 | + | The container auto-updates on start—restart it after a game update. |
| − | + | Config path: <code>/home/steam/holdfastnaw-dedicated/</code> | |
| − | + | Another instance (adjust ports): | |
<pre> | <pre> | ||
docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw | docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw | ||
</pre> | </pre> | ||
| − | + | 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/] | ||
| − | ===Manual Setup | + | === Manual Setup === |
| − | + | ==== Downloading using SteamCMD ==== | |
| − | + | Install [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD], then: | |
| − | ====Downloading using SteamCMD==== | ||
| − | |||
| − | |||
| − | |||
<pre> | <pre> | ||
| − | + | steamcmd.sh +login anonymous +force_install_dir /opt/holdfastserver +app_update 1424230 +quit | |
| − | |||
| − | |||
| − | |||
</pre> | </pre> | ||
Notes: | Notes: | ||
| − | : | + | : To verify files later: ''+app_update 1424230 validate''. |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | ==== Basic Configuration & Starting the Server (Linux) ==== | ||
| + | Duplicate the default config: | ||
<pre> | <pre> | ||
| − | + | cd /opt/holdfastserver | |
| − | + | cp serverconfig_default.txt serverconfig_myserver.txt | |
</pre> | </pre> | ||
| − | + | Configure ports: | |
| − | |||
| − | |||
| − | |||
<pre> | <pre> | ||
### Server & Steam Ports (Both ports must be unique per server instance). | ### Server & Steam Ports (Both ports must be unique per server instance). | ||
| Line 141: | Line 145: | ||
Notes: | Notes: | ||
| − | : | + | : Open the UDP ports in your firewall. |
| − | : | + | : Properly configured servers respond to A2S on ''steam_query_port''. |
| − | Basic | + | Basic variables: |
<pre> | <pre> | ||
server_name My Server | server_name My Server | ||
| Line 152: | Line 156: | ||
</pre> | </pre> | ||
| − | + | Start the server: | |
| − | + | <pre> | |
"./Holdfast NaW" -startserver \ | "./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> | ||
| + | |||
| + | | image_content = | ||
| + | | layout = auto | ||
| + | | left_width = 320px | ||
| + | | aside_width = 320px | ||
| + | | gap = 0.5rem | ||
| + | | show_toc = no | ||
| + | | show_section_edit = yes | ||
| + | }} | ||
Revision as of 08:45, 19 September 2025
![]() |
How to host a public or private Holdfast server on Windows or Linux (Steam client, SteamCMD, Docker) |
|---|
