Battlefield 1942 Linux Dedicated Server
Enhanced Multi-Instance Setup with Secure Runtime
View on GitHubAutomated Setup Script
This solution installs the legacy 32-bit Battlefield 1942 dedicated server on modern 64-bit Linux systems using a dedicated, non-privileged account. It handles dependency resolution, user creation, and server installation in a single pass with support for running multiple server instances.
Features
- Single-Script Setup
One unified script handles everything - standalone or BFSMD modes.
- Multi-Instance Support
Run unlimited servers on one machine with automatic port allocation.
- Smart Configuration
Interactive IP detection, port conflict prevention, resource validation.
- Secure Runtime
Runs entirely under a dedicated service account (bf1942_user).
- Modern Compatibility
Automatically installs required i386 libraries on Ubuntu 24.04+ / Debian 12+.
- Management Tools
Comprehensive CLI tool for monitoring and managing all instances.
- Performance Optimized
CPU affinity, memory limits, I/O tuning automatically configured.
- Systemd Integration
Managed via standard systemctl commands with auto-start on boot.
โ๏ธ Port Configuration
Each instance gets automatically calculated ports based on its name. This prevents conflicts and makes managing multiple servers straightforward.
| Instance Name | Game Port | Query Port | Management Port |
|---|---|---|---|
| server1 | 14600 (UDP) | 23033 (UDP) | 14700 (TCP) |
| server2 | 14605 (UDP) | 23038 (UDP) | 14705 (TCP) |
| conquest | 14620 (UDP) | 23053 (UDP) | 14720 (TCP) |
| tdm | 14589 (UDP) | 23022 (UDP) | 14689 (TCP) |
View your actual ports with: ./bf1942_manager.sh ports
๐ Quick Start (Ubuntu 24.04 LTS)
Prerequisite
1๏ธโฃ Download Scripts
# Download main setup script
wget https://raw.githubusercontent.com/hootmeow/bf1942-linux/main/ubuntu/ubu_24.0.3_bfsmd_setup.sh
# Download management tool
wget https://raw.githubusercontent.com/hootmeow/bf1942-linux/main/ubuntu/bf1942_manager.sh
# Make executable
chmod +x ubu_24.0.3_bfsmd_setup.sh bf1942_manager.sh2๏ธโฃ Install Your First ServerBFSMD Recommended
sudo ./ubu_24.0.3_bfsmd_setup.shInteractive Setup Prompts:
- Choose installation mode (Standalone or BFSMD)
- Select IP address (auto-detected options provided)
- Choose BFSMD version (v2.0 recommended or v2.01 patched)
- Configure firewall rules (optional UFW configuration)
3๏ธโฃ Create Additional Instances (Optional)
Add more servers by passing an instance name. Each gets unique ports automatically.
sudo ./ubu_24.0.3_bfsmd_setup.sh server2
sudo ./ubu_24.0.3_bfsmd_setup.sh conquest
sudo ./ubu_24.0.3_bfsmd_setup.sh tdm๐ ๏ธ Management Commands
Use the bf1942_manager.sh tool to manage all your server instances.
# View all instances
./bf1942_manager.sh list
# Check port assignments
./bf1942_manager.sh ports
# View detailed status
./bf1942_manager.sh status server1
# Show configuration paths
./bf1942_manager.sh config server1
# Health check all instances
./bf1942_manager.sh health
# Security audit
./bf1942_manager.sh security
# Service control (requires sudo)
sudo ./bf1942_manager.sh start server1
sudo ./bf1942_manager.sh stop server1
sudo ./bf1942_manager.sh restart server1
# View live logs
./bf1942_manager.sh logs server1
# Remove instance (with confirmation)
sudo ./bf1942_manager.sh remove server2Direct Systemd Commands:
# BFSMD instance
sudo systemctl status bfsmd-server1.service
sudo systemctl restart bfsmd-server1.service
journalctl -u bfsmd-server1.service -f
# Standalone server
sudo systemctl status bf1942.service๐ฎ Connect to BFRM (BFSMD Mode)
Default Credentials
Username: bf1942
Password: battlefield
Critical Security Warning
Connection Steps
- Open BFRM client (Windows)
- Connect to
your-server-ip:management-port - Login with default credentials
- Change password immediately (Admin tab)

Set Server IP
Navigate to IP settings and set your server's IP address explicitly.

Secure Remote Console & Admin
Change default remote console password and create secure admin accounts.

Set Default Map
Add at least one map to the rotation before starting the server.

Update Admin Passwords
Create secure admin accounts and disable defaults.

Firewall Configuration
During installation, you can configure UFW firewall rules. For the management port, choose a security level:
Option 1: Open to All
Easiest setup
- Anyone can attempt connection
- Still requires password
- Good for testing or behind other firewall
Option 2: Restrict to IP
Recommended
- Only specified IP can connect
- Firewall + password protection
- Good for static admin IP
Option 3: SSH Tunnel
Most secure
- No direct internet access
- All traffic encrypted via SSH
- Good for maximum security
SSH Tunnel Example
# On your local machine
ssh -L 14700:localhost:14700 user@your-server-ip
# Then connect BFRM to localhost:14700๐ Network Scenarios
Home Server (Behind Router)
- During Install: Choose Local IP (192.168.x.x)
- Router Config: Forward Game + Query ports (UDP)
- Players Connect To: Your public IP
Cloud Server (AWS, DigitalOcean, etc.)
- During Install: Choose Local IP (10.x.x.x or private IP)
- Cloud Firewall: Allow Game + Query from 0.0.0.0/0
- Players Connect To: Instance's public IP
๐ง Troubleshooting
"Internal error!" Messages
This is normal! BFSMD v2.0/v2.01 shows these continuously when reading /proc on modern kernels. The server functions perfectly despite these messages.
journalctl -u bfsmd-server1.service -f | grep -v "Internal error"Can't Connect to Server
# 1. Check service is running
systemctl is-active bfsmd-server1.service
# 2. Check firewall
sudo ufw status
# 3. Check ports are listening
sudo ss -tulnp | grep 14567
# 4. View logs
./bf1942_manager.sh logs server1Port Conflict During Installation
If you get "port already in use", try a different instance name (generates different ports), check existing assignments with ./bf1942_manager.sh ports, or remove the conflicting instance.
๐ Configuration Files
Standalone Server
/home/bf1942_user/bf1942/mods/bf1942/settings/
โโโ ServerSettings.con # Game settings
โโโ MapList.con # Map rotationBFSMD Instance
/home/bf1942_user/instances/<name>/mods/bf1942/settings/
โโโ servermanager.con # BFSMD settings
โโโ useraccess.con # Admin accounts
โโโ ServerSettings.con # Game settings
โโโ MapList.con # Map rotationBFRM Downloads (Windows)
๐งช Supported Distributions
| Distribution | Status | Notes |
|---|---|---|
| Ubuntu 24.04 LTS | โ Tested | Primary tested platform. |
| Ubuntu 22.04 LTS | ๐ Planned | Minor package name adjustments may be needed. |
| Debian 12 (Bookworm) | ๐ Planned | Uses the same multiarch structure as Ubuntu. |
| Debian 11 (Bullseye) | ๐ Planned | Should work with adjustments. |
| Fedora / RHEL / CentOS | ๐ Planned | Requires converting apt commands to dnf/yum. |
Maximum Recommended Instances: CPU Cores ร 2 (e.g., 4 cores = 8 instances max)
๐ ๏ธ Applying Patches
The patches folder contains Python scripts to improve various server bugs. See individual patch files for details and instructions.
๐ License
Scripts released under the MIT License. All Battlefield 1942 game assets remain ยฉ Electronic Arts Inc.