How I setup a dedicated / standalone wesnoth server.

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
iceburglar
Posts: 1
Joined: April 21st, 2022, 2:16 pm

How I setup a dedicated / standalone wesnoth server.

Post by iceburglar »

What;
My Wesnoth game installation via Steam on Windows 10 is ~650MB. You don't need the full game and all of it's assets to just host a game server though. I went to my wesnoth game directory ( mine was located at C:\Program Files (x86)\Steam\steamapps\common\wesnoth ) and copied all of the files ( and none of the sub-directories ) except for wesnoth.exe ( that's the game client, the server application is wesnothd.exe ). I transferred the files to a VPS which runs Windows Server 2016 and launched wesnothd.exe and created an Inbound Rule in Windows Firewall for TCP port 15000 ( default port for a wesnoth game-server ) and made the rule specific to wesnothd.exe. Now the game server is operating and accessible on the internet.

Why;
Previously we would take turns hosting the server on our PCs but the hosting player would have to configure port-forwarding on their router, and share their IP address with the other players ( which would change occasionally as most of us have dynamic IP's from our ISP ) and then someone has to leave their computer on with the server program running which in-practice lead to a lot of down-time when the hosting player closes the program, loses web connectivity, or shuts their computer down - purposely or not. Now we have a stand-alone wesnoth game server and it will be up 24/7.

How;
This worked for me with my game installation I play on in Windows 10, and my VPS running Windows Server 2016
Install the game, I did this through Steam. Navigate to the directory you installed the game in. If you don't want to put the full game on your server you should be able to just copy/retain these files on the server. ( I don't think ALL these files are necessarily required but many of the .dll's are, my goal was to save disk space vs installing the entire game and ~65MB for these files vs ~650MB for the full game was easy and 'lean' enough for me - but you can try just copying wesnothd.exe and running it and it will complain one-by-one about the dependencies it is missing if you want to try to trim this down some more )
Image
That's my game directory that I play from on my Windows 10 PC. I copied the highlighted files to my VPS. Then to start the server, run wesnothd.exe on the VPS.

Now the server needs a rule in the firewall to allow game clients to connect to the server.. So I open 'Windows Firewall with Advanced Security' and create a new 'Inbound Rule'
Image

I am going to make my rule based on the port number so I select the 'Port' option.
Image

Wesnoth uses the TCP protocol, and I am going to let my Wesnoth server use the default port number so I select 'TCP' and specify the 'Specific local ports' as 15000 ( the Wesnoth default port )
Image

When someone tries to connect to my server on this port, I am going to 'Allow the Connection'
Image

Whether the internet connection on my VPS is considered a 'Private' or 'Public' connection, I want this firewall rule to apply
Image

I pick a descriptive name for my firewall rule
Image
Then I hit finish. This creates the rule, and puts it on the list of 'Inbound Rules' . At this point my Wesnoth server becomes accessible to others on the internet.

There shouldn't be any other program running on my VPS trying to use port 15000 - so my Wesnoth server is the only thing I want this firewall rule to apply to. I right click it in the list of 'Inbound Rules' and choose the 'Properties' option
Image

This brings up a 'Properties' window for the rule, I select the 'Programs and Services' tab and in the 'Programs' frame I chose the 'This program:' option and I enter the full filepath for wesnothd.exe on the VPS.
Image
Then I clicked 'Apply', and 'OK'. Now I believe this firewall rule only applies to the server application ( wesnothd.exe ) and no other programs should be able to get thru my firewall on this port number.

NOTE: I had to manually paste the file path for my wesnothd.exe, NOT USE THE Browse button to navigate to it! When I used the browse button to navigate to and select wesnothd.exe , it filled the text field out with the filepath as "%USERPROFILE%\Desktop\wesnothserver\wesnothd.exe" and when I applied the rule my server was no longer accessible on the internet. So I copy and pasted the actual absolute file path ( in my case it is "C:\Users\Administrator\Desktop\wesnothserver\wesnothd.exe" ) and apply and now the server is accessible again. I don't really understand why it tried to use the %USERPROFILE% environmental variable and why it wasn't able to resolve that to the actual file path but that was a hang-up point for me and took me a bit to figure out.

I couldn't find any good results on just running the server 'stand-alone' ( just the server files not a full game install ) or anything about my firewall filepath environmental variable issue, so that's why I'm posting this.
Post Reply