Linux BF1942 Server Scripts
Automated setup and patching scripts for running a Battlefield 1942 Dedicated Server on modern 64-bit Linux systems.
View on GitHubOverview
This project automates the setup of the 32-bit BF1942 server on a modern 64-bit Linux OS, following best security practices.
1. Prerequisites
Before you begin, you will need:
- A server running a supported OS (see list below). Ubuntu 24.04 LTS is recommended.
- Root or
sudoaccess. gitandcurlinstalled:sudo apt update && sudo apt install -y git curl
2. Installation
Clone the repository and run the setup script as root. The script will guide you through the process.
# Clone the repository
git clone https://github.com/hootmeow/bf1942-linux.git
cd bf1942-linux
# Make the script executable
chmod +x setup_env.sh
# Run the setup script as root
sudo ./setup_env.shThe script will prompt you to create a secure password for the new, unprivilegedbf1942_user.
3. How It Works
The setup_env.sh script performs the following actions:
- Creates a dedicated, non-privileged service account named
bf1942_user. - Enables i386 multiarch and installs all required 32-bit libraries (e.g.,
lib32stdc++6). - Downloads the BF1942 1.61b server files and all necessary patches.
- Applies the "No-CD" patch and the community master server patch.
- Sets up a
systemdservice file (bf1942-server.service) to run the server. - Configures a limited
sudoersfile to allowbf1942_userto safely manage the service without a password.
4. Managing Your Server
Security Best Practice
All server commands should be run as the
bf1942_user, not as root.First, log in as the service user:
sudo -iu bf1942_userFrom there, you can use sudo (which will not require a password) to manage the service:
# Start the server
sudo systemctl start bf1942-server.service
# Stop the server
sudo systemctl stop bf1942-server.service
# Check the server's status
sudo systemctl status bf1942-server.service
# View the live server console/log
journalctl -fu bf1942-server.serviceThe server's serversettings.con file is located in:/home/bf1942_user/bf1942/mods/bf1942/settings/
๐งช Supported Distributions
| Distro | Status | Notes |
|---|---|---|
| Ubuntu 24.04.3 LTS | โ Tested | Primary tested platform |
| Ubuntu 22.04 LTS | ๐ TODO | Minor package name adjustments |
| Debian 12 (Bookworm) | ๐ TODO | Same multiarch flow |