Linux BF1942 Server Scripts

Automated setup and patching scripts for running a Battlefield 1942 Dedicated Server on modern 64-bit Linux systems.

View on GitHub

Overview

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 sudo access.
  • git and curl installed:
    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.sh

The 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 systemd service file (bf1942-server.service) to run the server.
  • Configures a limited sudoers file to allow bf1942_user to safely manage the service without a password.

4. Managing Your Server

First, log in as the service user:

sudo -iu bf1942_user

From 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.service

The server's serversettings.con file is located in:/home/bf1942_user/bf1942/mods/bf1942/settings/

๐Ÿงช Supported Distributions

DistroStatusNotes
Ubuntu 24.04.3 LTSโœ… TestedPrimary tested platform
Ubuntu 22.04 LTS๐Ÿ“ TODOMinor package name adjustments
Debian 12 (Bookworm)๐Ÿ“ TODOSame multiarch flow