Check out our New Forums!
Donated: $1
Posts: 5 - KR:
Seen: 5 months ago
This guide will cover installing, and configuring a dedicated Battlefield 2 server on GNU/Linux. You can do this in localhost or, as in my case, using a VPS; the only restriction is on the OS, which must be based on Unix. You don’t need excellent technical knowledge, but for a complex configuration of the server, I suggest you to pay attention and learn some Unix base before proceeding. requirements
According to EA, these are the minimum requirements for a Linux dedicated server:
CPU: 1 Ghz
RAM: 256 Mb

Recommended Specification, based on playing a 64 player game:
CPU: 3 Ghz. For AMD Athlon 64 CPU: 3500+ (2.2 Ghz)
RAM: 2 Gb

It is reported that a full 64player server requires 8Mb/s of bandwidth. use a VPS?
A VPS is a compromise between a localhost solution and an expensive online pre-configured dedicated server. With a Virtual Private Server, you can have: big bandwidth, 24/7 uptime, no hardware maintenance, power saving… all for a small monthly charge. Here is a list of some of the Cloud Computing provider I've tried and they deserve to be tried.

- A2 Hosting
- Amazon EC2
- AtlanticNet
- Bandwagon Host
- BudgetVM
- DigitalOcean
- Dreamhost
- Google Compute Engine
- Linode
- Microsoft Azure
- Ramnode
- Scaleway
- StableHost
- VpsNet
- Vpsdime
- Vultr

For this guide I have chosen the famous DigitalOcean services for their distributed datacenter and for affordable costs, but to be honest I think that Scaleway is the best choice for a game server. For ONLY 3€/m (3.4 $/m) you could have 4 Cores, 2 Gb RAM and 200Mbit/s Internet bandwidth, 1Gbit/s Internal bandwidth. They are the first to provide bare metal services in the cloud computing sector with dedicated servers backed by SSD on ARM architecture. connection

Once you have chosen the service to use you just have to start your virtual machine and access it through SSH. You can use Putty as a client and PuTTYgen for SSH key management. You can download these software from the official site (it's no installation required):

Once connected to the server, we can finally start our installation.

As you can see I used Ubuntu 14.04.4 LTS (Trusty Tahr) x64, but you can choose any other distribution.

1) Create a new user under which the game server will run.
It is highly recommended not to run the server as root! bf2

Note: In some distributions you must create the new user's home using: /home/bf2

If you enter the wrong password or want to change it: bf2

2) Set the new user as owner of the home dir: -R bf2 /home/bf2

3) Login new user:

Note: Once authenticated we will be in /home/bf2, if not: /home/bf2

4) Get the server files:

5) Extract downloaded file: -xvzf bf2.linux.server.tar.gz

Note: For more info about tar type: man

6) Make the launcher executable: u+x server/bf2/

7) Now you have everything you need to start a new server, but before navigate to the dir: server/bf2

See the content:

And start the configuration!

1) Change into your BF2 installation directory and edit the server config file: -w mods/bf2/settings/serversettings.con

Note: These are the most important settings

sv.serverName "BF2 Server" // Name of your BF2-Server
sv.welcomeMessage "text line 1 | text line 2 | [...]" // Server welcome message
// Use '|' for a linebreak
sv.password "" // Password needed for players to join the server
sv.internet 0 // 0 = LAN server, 1 = internet server
sv.serverIP "" // IP of your server
sv.serverPort 16567 // Port of your server
sv.punkBuster 1 // 0 = disable Punkbuster, 1 = enable Punkbuster
sv.maxPlayers 32 // Maximum number of allowed players (16, 32, 64)
sv.numPlayersNeededToStart 10 // For ranked servers, this needs to be:
// 6 for maxPlayers 16, 10 for 32, 10 for 64
sv.roundsPerMap 2 // How often each map will be replayed
sv.friendlyFire 100 // For ranked servers: FF on and at 100% damage
sv.friendlyFireWithMines 1 // Same as above
sv.tkPunishEnabled 1 // For ranked servers, you need FF-punish on
sv.interfaceIP "" // IP of your server

2) Edit your maplist to contain the maps you want to have in your map cycle: -w mods/bf2/settings/maplist.con

Note: Here's an example:

mapList.append dalian_plant gpm_cq 32
mapList.append daqing_oilfields gpm_cq 32
mapList.append dragon_valley gpm_cq 32
mapList.append fushe_pass gpm_cq 32
mapList.append gulf_of_oman gpm_cq 32
mapList.append kubra_dam gpm_cq 32
mapList.append mashtuur_city gpm_cq 32
mapList.append operation_clean_sweep gpm_cq 32
mapList.append sharqi_peninsula gpm_cq 32
mapList.append songhua_stalemate gpm_cq 32
mapList.append strike_at_karkand gpm_cq 32
mapList.append zatar_wetlands gpm_cq 32

3) Enable rcon editing in admin: –w admin/

Note: Be sure to save your password somewhere:

'port': '4711',
'password': 'mypassword',

4) For manage unlocks (ex. weapons) navigate to /server/bf2/python/bf2/stats and: –w

Note: Edit 0 value to 1 to unlock. the server

1) I highly recommend not starting the server as root,
so logout and login as we already seen before with bf2 user.

2) Navigate to server folder: server/bf2/

3) To view the different starting parameters: +help

4) Starting the server: +dedicated +lowPriority

Note: It is a good idea to start the game using screen, because the server keeps a command line open.

5) If you are not using rcon, you can directly input your admin command via command line.
Search on Google for a complete list of command.

Note: For kill the server process use Ctrl+c as usual.

Port Information
Posts: 1856 - KR:
Seen: 6 days ago
Nice guide :) Well put together... I'm going to sticky it if you don't mind!

What's the benefit of using +lowPriority?
Posts: 2253 - KR:
Seen: 1 month ago
+lowPriority can be used to make sure the server runs smooth even if bf2 causes heavy load
Donated: $1
Posts: 5 - KR:
Seen: 5 months ago
Spencer You can use +lowPriority to make sure the server runs smooth even if bf2 causes heavy load... I used it in the guide because my server is not very performant :(
Posts: 17 - KR:
Seen: 2 months ago
Thanks for tutorial. i tried to run a bf2 server with p4f mod on Debian 64bits OVH vps, but don't start with the error :

PlayerManager created ObjectManager created GameLogic created ServerSettings created
No maps in maplist. Please add atleast one map, or use +loadLevel command.

i tried this maplist.con :

mapList.append gulf_of_oman_p4f gpm_cq 32
mapList.append strike_at_karkand_p4f gpm_cq 32
mapList.append basra_p4f gpm_cq 32
mapList.append sharqi_p4f gpm_cq 32
mapList.append mashtuur_city_p4f gpm_cq 32
mapList.append dragon_valley_p4f gpm_cq 32
mapList.append dalian_plant_p4f gpm_cq 32
mapList.append trail_p4f gpm_cq 32

i also tried to start the server with classic bf2 mod with the maplist.con:

mapList.append strike_at_karkand gpm_cq 32

but same result.. i specify that these two maplist.con and serversettings.con works great to my windows local server.. so i tried many starting commands:


./ +dedicated

./ +dedicated +lowPriority

./ +dedicated +modPath mods/p4f (and mods/bf2)

./ +dedicated +modPath mods/p4f +mapList mods/p4f/settings/maplist.con

./ +dedicated +modPath mods/p4f +mapList mods/p4f/settings/maplist.con +config mods/p4f/settings/serversettings.con

./ +dedicated +modPath mods/p4f +mapList mods/p4f/settings/maplist.con +config mods/p4f/settings/serversettings.con +lowPriority +loadLevel mods/p4f/levels/strike_at_karkand_p4f

also these commands without +dedicated ..

i search on several forums and website but don't find a solution for now.. any idea please ?
Posts: 1 - KR:
Seen: 1 year ago
firewall exceptions ?
Posts: 17 - KR:
Seen: 2 months ago
you think Iptables can prevent maplist.con ? i haven't changed iptables and all is open (input, forward,output) by default for now.. so i think there is no exception needed ? ;)

edit: problem solved : if it helps others the BF2 Linux server will read lower-case filenames ONLY. All file names encountered at runtime are lower-cased before a filesystem access is attempted. The only exception is Python-scripts. You should therefore make sure all files are lower-case when installing third-party modifications and maps.

To aid you with this there is an included python script called (server/bf2/ path) which recursively changes the case of files and directories from the directory where it's run.

Quote: [--pretend] [--verbose]

You can simulate the actions of the script with these options:
$ ./ mods/yourMod --pretend

When you're certain it looks good run the conversion:
$ ./ mods/yourMod --verbose

and your server start..
Posts: 4 - KR:
Seen: 4 days ago

I have a problem with installation, I am stuck at:

"6) Make the launcher executable: u+x server/bf2/ "

I get :
"chmod: cannot access `server/bf2/': No such file or directory"

Could you help me ?
Ubuntu 12.04 64Bit

Edit :

I created a "bf2" folder in the "server" folder.

I have copied all the files from the "server" folder to the "server / bf2 /" folder

The command "chmod" works but I can not start the server:

bf2@server:~/server/bf2$ ./ +dedicated +lowPriority
ln: failed to create symbolic link `pb': File exists
./ 27: exec: /home/bf2/server/bf2/bin/amd-64/bf2: Permission denied

Could you help me ?
Sorry for my bad English
Donated: $1
Posts: 5 - KR:
Seen: 5 months ago
I created a "bf2" folder in the "server" folder.

I have copied all the files from the "server" folder to the "server / bf2 /" folder

The command "chmod" works but I can not start the server:

bf2@server:~/server/bf2$ ./ +dedicated +lowPriority
ln: failed to create symbolic link `pb': File exists
./ 27: exec: /home/bf2/server/bf2/bin/amd-64/bf2: Permission denied

Could you help me ?
Sorry for my bad English

You should check if the symbolic link 'pb' exists. If it does, you could unlink it:
sudo unlink pb

then redo the sh command:
sudo sh +dedicated +lowPriority
Posts: 866 - KR:
Seen: 2 months ago
Hey guys,

Maybe this image will help, or be a bit easier for some... This is currently only guaranteed to work on Vultr at the moment, as I do not have accounts with other providers for any testing at the moment. So far Vultr VPSes have been the best performing out of the several different providers we tested months ago. They do not over-provision their resources anywhere near as poorly as other providers have done to us in the past. When we tried DigitalOcean and Linode, their networks were -okay- however the CPUs could not handle our full 64 man servers at all. Vultr was and still is able to run these servers without major CPU lag. They also have dedicated instances available but we've never needed to use them.

Right now they are also running a pretty sweet deal for any new sign ups where they will match your contribution on prepaid credit up to $100. Smaller severs can easily get away with a $5/month instance for a small 16 player game, so if you were to deposit $15 you'd basically get a server for 6 months. You can always upgrade your instance at anytime for more resources if necessary.

Below is a link that you can use for a Vultr VPS to basically have an instant BF2 server. If you sign up and login to your panel, then head to the "snapshots" tab, you'll see an option to upload a snapshot. Simply copy/paste the following URL into the "Remote URL" box and it will begin to download to your account.

Signup for Vultr:

Download the Snapshot Image:

This may take some time to completely download to your account. Get up and go grab a coffee or something, maybe play a round while you wait :) Once completed, use the giant + button at the top right from any page to create a new instance.

Under Step 2 (Server Type), select the Snapshot tab. You will see your new bf2.image snapshot available for deployment.

This server has BF2 as well as the xpack installed. BF2CCD is also setup and running out of the box with mono.

Once deployed, the default credentials for the instance are as follows

SSH Default
Username: root
Password: battlelog-image

BF2CCD default
Username: admin
Password: admin

The following ports are already open for use with BF2

Firewall ports open
SSH - 22
BF2 Game - UDP 16567
BF2 Query - UDP 29900
BF2 Voip - UDP 55128
BF2 RCON - TCP 4711
BF2CC Port - TCP 4712

I HIGHLY recommend you login and change the passwords immediately. You can use the passwd command once logged in via ssh to change the root password to something a bit more secure and the BF2CC password can be changed via the BF2CC client. MAKE SURE you have .net 1.1 and .net 1.1 SP1 installed, otherwise you WILL end up causing issues with the server.

Once the snapshot is on your account, you can re-deploy or restore the snapshot to the existing server at any time for a fresh installation of BF2.
Posts: 4 - KR:
Seen: 4 days ago
Hello mDaWg

I get an error,
Posts: 4 - KR:
Seen: 4 days ago

It's okay, after a second attempt it works
Posts: 5 - KR:
Seen: 3 months ago
Hi, I got this error on ubuntu linux:
bf2@server:~/server/bf2$ ./ +dedicated +lowPriority
ln: failed to create symbolic link `pb': File exists
./ 27: exec: /home/bf2/server/bf2/bin/amd-64/bf2: Permission denied

I tried above mentioned solutions but still no luck, anyone know how to solve this problem?
previous123 next

Quick Reply

You must be logged in to post. Not a member yet? Register!