How to set up a private Team Fortress 2 server with Meshnet
Discover how to set up your own Team Fortress 2 server using Meshnet on Windows and Linux and enjoy private gaming sessions with your friends.
Introduction
Team Fortress 2 (TF2), an online multiplayer first-person shooter developed by Valve Corporation, remains a favorite among its active and loyal community members even after more than a decade. Creating your own dedicated TF2 server not only provides enhanced stability and control compared to external servers but also enriches your gaming experience with exclusive maps, game modes, and other features. Additionally, a dedicated server is an excellent opportunity to give new life to an old PC.
Nonetheless, managing a public server can lead to potential vulnerabilities in your home network. Meshnet offers an effective solution that removes the necessity of opening ports and revealing your IP address. With Meshnet, you can establish a secure virtual network that links devices from around the globe, simulating a local area network (LAN) connection between remote participants.
This guide will show how to host a private TF2 game from within the game itself as well as how to set up a TF2 dedicated server on Linux and Windows systems, with instructions to connect using Meshnet.
Launch a private TF2 game without a dedicated server
If you're looking for a quick and simple way to create a private game without setting up a dedicated server, you can do so directly from the game.
Before you begin
To ensure that your devices can communicate with each other, enable Meshnet on your host machine and any other devices that will connect to your game.
Configure a private TF2 game session
Launch the TF2 game on your computer.
From the main menu, select Find a game > Create server.
Start a server with any map. Once the server loads, open Console by pressing the ~ (tilde) key.
Run the following commands, replacing
<meshnet_ip_address>
with your device's Meshnet IP address and<map_name>
with the name of the map you want to use:Example
After the server reloads with the specified map, other players can connect to your private game using your device's Meshnet IP address. For further details, see the Connect to the TF2 server section below.
Note
If you can't access Console, make sure it is enabled in the game's settings:
In the main menu, click the gear button at the bottom of the screen to open Options.
Under Keyboard, select Advanced, and then select Enable developer console and click OK.
Create a TF2 dedicated server on Windows and Linux
The TF2 server software is compatible with Windows and Linux, allowing you to create a private server on either system. This article covers the steps for both platforms.
Before you begin
Ensure you have the following:
A computer with a stable internet connection running Linux or Windows.
At least 20GB of free storage space for the game files.
A minimum of 8GB of RAM or, preferably, 16GB for optimal performance.
Meshnet is enabled on both your server machine and any devices that will be connecting to it.
Create a basic TF2 dedicated server with SteamCMD
The steps below outline how to install and configure the server software, create a configuration file, and launch the server with customized settings.
Note
This user guide is based on installing the server on Windows 11.
Download and install SteamCMD
To download and install SteamCMD, which is a command-line tool used to manage dedicated server files, follow these steps:
Create a new folder on your computer where you want to install SteamCMD.
D:\tf2_server
Download the SteamCMD for Windows from the Valve Developer Community website. Look for the download link under the “Windows” section.
Extract the contents of the downloaded ZIP file to the folder you created.
Double-click the steamcmd.exe file to launch the application.
If the Windows security alert box appears, select both the private and public networks options and then click the Allow access button to allow incoming connections through the firewall.
The SteamCMD tool will automatically update and, upon completion, will be ready to accept commands.
Download and install the TF2 server
Now that you have SteamCMD installed, it's time to download and install the TF2 server files.
You can log in anonymously to SteamCMD to download TF2 dedicated server files by entering the following command:
Example:
To log in to SteamCMD with your Steam account, enter the following command and replace
<username>
and<password>
with your Steam account credentials:Specify the installation directory for the TF2 server files by entering
force_install_dir
followed by the path to the installation folder of your choice. For example:Download and install the server files by entering this command:
The download process may take to complete because the dedicated server content is quite large. Once the "Success!" message appears, it means that the server files are fully downloaded and installed.
Exit SteamCMD by entering the following command:
Configure the server
After installing the server files, the next step is to configure the server settings.
Navigate to the
tf\cfg\
directory within the folder where you installed the TF2 server.Create a new text file named
server.cfg
and open it with a text editor, such as Notepad.Add the following lines to the file, replacing the placeholders with your desired settings, where:
<your_server_name>
is your server display name.<time_in_minutes>
is the maximum time in minutes a map can be played before switching to the next map.Example
Save and close the text editor.
The server.cfg
file allows you to store custom settings for your server. To learn more about additional configuration parameters, visit the TF2 Wiki's dedicated server configuration page.
Launch the server
Now that your server is configured, you can start it by creating a batch file to simplify the process.
Create a new text file in the
tf2server
folder in the folder where you installed the server. You can name itstart_tf2.bat
or choose another name for the file.Open the file with a text editor and add the following line:
These lines contain key server settings that can be modified according to your preferences:
To set a specific map, replace
+randommap
with+map
followed by the name of your preferred map. For example:+map ctf_2fort
.To limit the number of players who can connect to the server, adjust the
maxplayers
value.To control custom content from clients, set
sv_pure
to the desired value.1
restricts most custom content to ensure a consistent gaming experience.
Save the file and exit the text editor.
To launch the server, double-click the start_tf2.bat file you’ve just created.
If the Windows security alert box appears, select both the private and public networks options and then click the Allow access button to allow incoming connections through the firewall.
Now, your TF2 server should start with the specified settings.
Tip
To stop the server, type quit
or exit
in the console window and press Enter.
To ensure your server runs smoothly, regularly update the server files.
Connect to the TF2 server
To connect to the newly created server, follow these steps:
Copy the Meshnet IP address of the server computer from the NordVPN app by clicking it.
Launch the TF2 game on your computer.
Open Console by pressing the ~ (tilde) key and then typing the following command, replacing
<server_ip>
with the copied Meshnet IP address:Example
Click Submit.
Once connected to your server, you and your Meshnet peers can enjoy playing Team Fortress 2 together.
Last updated