Editing the Metin2 client to connect to your private server comes down to modifying a handful of configuration files so the game points to your server’s IP address instead of the official Gameforge servers. I have helped dozens of server admins through this process over the years, and the steps are the same whether you are running a local test box or a full VPS for hundreds of players.
This guide covers the complete process: extracting pack files, editing serverinfo.py or serverinfo.xml, matching XTEA encryption keys, repacking files, configuring ports, testing the connection, and troubleshooting errors. By the end, you will know exactly how to edit the Metin2 client to connect to your private server.
The default Metin2 client ships hardcoded to connect to official servers. Without modifying the serverinfo files, port settings, and encryption keys, your client cannot reach a private server. Skip any step and you will run into connection refused errors, version mismatches, or instant crashes on launch.
Table of Contents
What You Need Before You Start: Prerequisites and Tools?
Gathering the right tools first saves you hours of frustration. I learned this the hard way when I first tried client modding with the wrong archive extractor and corrupted an entire pack file.
Here is what you need before editing the Metin2 client:
A clean Metin2 client matching your server files version. The client and server must use the same protocol version, or you will get version mismatch errors immediately.
A pack extractor tool such as EterNexus or a Python-based pack unpacker. This lets you open the encrypted .epk/.eix archive files in the client’s pack folder.
A text editor with code support like Notepad++ or VS Code. You will be editing Python (.py) and XML files, so syntax highlighting helps spot errors.
A hex editor (HxD or similar) for modifying binary files and checking XTEA keys embedded in the client executable.
Your server’s IP address and port numbers ready. Most Metin2 servers use port 13000 for the game server and port 11002 for the auth/login server.
Your XTEA encryption keys from both the server source and client. These must match exactly, or the client and server cannot decrypt each other’s packets.
A backup of the original client folder. If something breaks during editing, you can restore instantly instead of re-downloading the full client.
If you are hosting on a VPS, make sure FreeBSD is installed and your server files are already running. Testing the connection only works if the server side is fully operational. If you need help with that side first, check community-trusted sources like RaGEZONE or Elitepvpers for verified server file packages.
Understanding the Metin2 Client Architecture
The Metin2 client stores most of its configuration data inside encrypted pack files with .epk and .eix extensions. These archives sit in the pack folder inside your client directory and contain everything from server connection details to UI textures and game logic.
Three file types matter most for connecting to a private server:
serverinfo.py is a Python script that defines your server list, channel names, IP addresses, and port numbers. This is the file you edit most often when pointing a client at a new private server. Some older or custom clients use serverinfo.xml instead, which serves the same purpose in XML format.
root.epk and root.eix are the pack files that contain serverinfo.py along with other core client scripts. You extract these files, edit the contents, and repack them before the client can use your changes.
The client reads serverinfo during startup, builds a server selection screen from the data, and attempts TCP connections to the IP and port specified for each channel. If those details point to official Gameforge servers, your private server never appears. That is why editing serverinfo is the single most important step.
Step 1: Locate and Extract the ServerInfo Files
The serverinfo files live inside the root pack archive, not as loose files in the client directory. You need to extract them first before any editing can happen.
Follow these steps to locate and extract the serverinfo files:
Open your Metin2 client folder and navigate to the pack subdirectory.
Look for root.epk and root.eix. Some clients rename these files for security, so if you do not see them, look for similarly sized .epk/.eix pairs. The root archive is typically between 1-5 MB.
Launch your pack extractor tool (EterNexus is the most common choice for this). Select the root.epk file and choose an extraction output folder.
Extract the entire archive. You should see a folder structure containing Python scripts including serverinfo.py, intrologin.py, systemsetting.py, and other game scripts.
Copy serverinfo.py to a safe location as a backup before making any changes.
If your client uses serverinfo.xml instead of serverinfo.py, the extraction process is identical. The XML variant is common in older client builds and some custom distributions. Either way, the file lives inside the root archive.
One common mistake I see is extracting the wrong archive. If you open a pack file and do not see serverinfo, you probably opened a texture or map archive instead. The root pack is always the one containing Python scripts.
Step 2: Edit serverinfo.py to Point to Your Private Server
This is the core step where you redirect the Metin2 client to your private server. Open serverinfo.py in your text editor and prepare to modify the server definitions.
Here is the exact process to edit serverinfo.py for your private server:
Open serverinfo.py in Notepad++ or VS Code.
Find the SERVER_INFO dictionary or the REGION_INFO block near the top of the file. This is where server definitions begin.
Locate the server name and IP address entries. You will see lines defining the server with an IP like “127.0.0.1” or an official Gameforge IP.
Replace the IP address with your server’s IP. For local testing, use “127.0.0.1”. For a VPS, use the VPS public IP address. For public access by other players, use your server’s public IP or domain name.
Check the port numbers. The auth server typically runs on port 11002 and the game server channels run on port 13000 and above (13001, 13002 for additional channels).
Update the server display name to your server’s name. Change fields like SERVER_NAME or the name string in the dictionary entry.
If you have multiple channels (CH1, CH2, etc.), update each channel’s IP and port. All channels usually point to the same IP but different port numbers.
Save the file with UTF-8 encoding. Metin2 Python scripts require proper encoding or the client may fail to parse them.
A typical edited serverinfo.py entry looks something like this structure:
The REGION_AUTH_SERVER_INFO section maps your server to an auth IP and port. The REGION_GAME_SERVER_INFO section maps each channel to a game server IP and port. Both must point to your private server’s addresses.
Double-check every IP and port before saving. A single typo in the serverinfo.py file prevents the client from connecting, and the error message will not tell you which line is wrong. I always read through the entire file one more time after editing.
Step 3: Understanding and Matching XTEA Encryption Keys
XTEA (eXtended Tiny Encryption Algorithm) keys are the encryption layer between your Metin2 client and server. Both sides must use identical keys, or packets sent between them cannot be decrypted and the connection fails silently.
Most private server admins skip this step because they reuse default keys from popular server file releases. If you generated custom XTEA keys for security, you need to update the client to use those same keys.
Here is how XTEA keys work in the Metin2 client-server relationship:
The server stores XTEA keys in its source code, typically in a configuration file or header on the FreeBSD server. The client stores matching keys in either the binary executable or a configuration file embedded in the pack archives.
To match XTEA keys between client and server:
Find the XTEA keys on your server. Check the server source files for a key array, often in files related to packet encryption or session handling.
Open the client side with your hex editor. Search for the XTEA key bytes in the client executable (typically metin2client.bin or the main .exe file).
Compare the key values. If they match the server keys, no changes are needed.
If keys differ, replace the client-side key bytes with your server’s key values using the hex editor. Save the modified executable.
Some modern clients store XTEA keys in settings.py or a dedicated config file inside the root pack. Check there first before modifying the binary.
Using default XTEA keys from public server file releases is fine for testing and small communities. For public servers with real players, generating custom keys adds a layer of protection against packet manipulation tools.
Step 4: Repack and Replace the Modified Files
After editing serverinfo.py and any other root scripts, you must repack them into the root.epk and root.eix archive format. The client cannot read loose files from the pack folder.
Follow these steps to repack the modified files:
Open your pack tool (EterNexus or equivalent) and select the option to create or repack an archive.
Add all the files from your extracted root folder, including the modified serverinfo.py.
Make sure the directory structure matches the original archive. Files in the wrong subfolder will not be found by the client.
Generate new root.epk and root.eix files.
Move the new root.epk and root.eix into your client’s pack folder, replacing the originals.
Keep the original files as a backup in case the repacked version causes errors.
Test the client immediately after repacking. If the client crashes on launch or shows a blank server list, the most likely cause is a corrupted repack or an incorrect directory structure inside the archive.
Step 5: Configure Ports and Firewall for Client-Server Communication
Even with a perfectly edited client, connections fail if the server’s ports are not open. Port configuration is critical for both local testing and public access.
Metin2 uses specific ports for different services:
Port 11002 is the auth/login server port. The client connects here first to authenticate credentials.
Port 13000 and above are game server channel ports. CH1 uses 13000, CH2 uses 13001, and so on.
Port 3306 is the MySQL database port. This stays internal and should not be exposed to the public.
To configure ports and firewall for your Metin2 private server:
On your FreeBSD server, open /etc/rc.conf or your firewall configuration file.
Add rules to allow incoming TCP traffic on ports 11002 and 13000-13099 (or however many channels you run).
Apply the firewall rules using service pf reload or the equivalent command for your firewall system.
If running on a VPS, also check the cloud provider’s security group or network firewall settings. Many VPS providers block ports by default at the network level.
For public servers, configure port forwarding on your router if hosting from home. Forward TCP ports 11002 and 13000+ to your server’s local IP.
Verify ports are open by connecting from a different machine using telnet your-server-ip 13000 or an online port checker tool.
I have seen more connection issues caused by closed firewall ports than by any other factor. Always confirm ports are reachable from outside the server before troubleshooting client configuration.
Step 6: Test the Connection
With the client edited and server ports open, it is time to test the connection end to end.
Follow these steps to test your Metin2 private server connection:
Launch the modified Metin2 client from your client folder.
Watch the login screen. If it loads without errors, the client successfully read your modified serverinfo.py file.
Check the server selection screen. Your private server name should appear in the list.
Select your server and enter test credentials. If the auth server is running and port 11002 is open, the login should process.
Select a channel and enter the game. A successful character selection screen means the game server connection on port 13000 is working.
Create a character and load into the game world to confirm full connectivity.
If the client reaches the login screen but cannot connect after entering credentials, the issue is almost always the auth server or port 11002. If you can log in but cannot enter a channel, the game server port (13000+) is the problem.
Troubleshooting Common Metin2 Connection Errors
Connection problems are normal when setting up a Metin2 private server for the first time. Here are the most common errors and how to fix each one.
Wrong Version of File Error
This error appears when the client and server use different protocol versions. The fix is to ensure your client version matches your server file version exactly. Check the client version in the version.txt or config file and compare it to the server’s configured version. If they differ, either update the client or change the server version setting to match.
Connection Refused or Cannot Connect to Server
This means the client reached the server IP but no service responded on the expected port. Check three things: the server process is actually running, the firewall allows the port, and the serverinfo.py IP and port match the server configuration. Use telnet or a port checker to verify the port is open from the client machine.
Server Not Showing in Server List
If your server does not appear in the selection screen, the serverinfo.py file was not repacked correctly or the file structure inside the archive is wrong. Re-extract the root pack, verify the serverinfo.py changes are present, and repack with the correct directory structure.
XTEA Key Mismatch
Symptoms include successful TCP connections but immediate disconnection after the handshake, or characters appearing frozen. This happens when client and server XTEA keys do not match. Verify the key values in both the client binary and server source, and make them identical.
Client Crashes on Launch
A crash immediately after launching usually means a corrupted repack or a syntax error in the modified Python files. Open serverinfo.py and check for missing commas, brackets, or quotes. Even a single syntax error in a Python file inside the root pack can crash the entire client on startup.
Other Players Cannot Connect
If you can connect locally but other players cannot, the server is binding to localhost instead of the public IP. Check the server configuration files and change the bind IP from 127.0.0.1 to 0.0.0.0 or your server’s public IP address. Also verify port forwarding is set up on your router or VPS firewall.
How to Edit the Metin2 Client to Connect to Your Private Server: Best Practices
Following best practices from the start prevents most issues and makes your server easier to maintain.
Always keep backups. Before modifying any file, copy the original to a backup folder. This applies to serverinfo.py, the client executable, and especially the root.epk/root.eix archives. A clean backup means you can revert in seconds instead of re-downloading the entire client.
Match client and server versions exactly. The biggest source of connection errors is version mismatch. Download your client from the same source as your server files whenever possible. Popular server file releases on RaGEZONE and Elitepvpers often include a matching client.
Distribute a pre-configured client to players. Instead of asking players to edit files themselves, prepare a ready-to-use client with serverinfo.py already pointing to your server. Package it as a full download or use an autopatcher to deliver the modified root pack files automatically.
Be cautious with downloaded server files. Community-trusted sources exist, but some server file packages from unknown sources contain malware. Stick to well-known repositories and scan downloads before use. The Metin2 community on RaGEZONE, Elitepvpers, and metin2.dev has vetted file sections.
Document your changes. Keep a text file listing every modification you made to the client: which files you edited, what values you changed, and what tools you used. This documentation helps enormously when you need to update the client or troubleshoot issues weeks later.
Frequently Asked Questions
How do I set up a Metin2 private server?
Setting up a Metin2 private server requires FreeBSD server files, a MySQL database, and the game server binaries. You install FreeBSD on a VPS or local machine, extract the server files, configure the database connection, set up the auth and game server ports (11002 and 13000), and then edit your client’s serverinfo.py to point to the server IP.
How do I edit serverinfo.py in Metin2?
Extract root.epk and root.eix using a pack tool like EterNexus, open serverinfo.py in a text editor, replace the server IP address and port numbers with your private server details, update the server display name, save with UTF-8 encoding, and repack the files into root.epk and root.eix.
How do I fix the wrong version of file error in Metin2?
The wrong version of file error means your client and server use different protocol versions. Check the version number in both the client configuration and server settings, and make them match. The simplest fix is to use a client that came from the same server file release package.
Is Metin2 still active?
Yes, Metin2 is still active as of 2026. The official servers operated by Gameforge continue to run, and a large private server community exists on forums like RaGEZONE, Elitepvpers, and metin2.dev with active development and new server file releases.
How do I host a Metin2 server for other players?
To host for other players, run your server on a VPS with a public IP, open ports 11002 and 13000+ on the firewall, configure the server to bind to the public IP instead of localhost, and distribute a pre-edited client with serverinfo.py pointing to your server IP so players can connect directly.
What are XTEA keys in Metin2?
XTEA keys are encryption keys used to secure packet communication between the Metin2 client and server. Both sides must use identical key values. If the keys do not match, the client and server cannot decrypt each other’s packets, causing connection failures or instant disconnections after login.
Conclusion
Learning how to edit the Metin2 client to connect to your private server comes down to six core steps: extract the root pack, edit serverinfo.py with your server’s IP and ports, match XTEA keys, repack the files, configure firewall ports, and test the connection. Each step builds on the previous one, and skipping any of them leads to connection failures.
The most common pitfalls are version mismatches between client and server, closed firewall ports, and corrupted repacks. Keep backups of every file you modify, document your changes, and always use trusted server file sources from the Metin2 community forums.
Once your connection is working, prepare a pre-configured client for your players and set up an autopatcher for future updates. This saves everyone time and keeps your server community running smoothly.