terminal

LinuxScripts

menu

BeamMP

Install Script (Debian/Ubuntu / clean)

download content_copy expand_more
#!/bin/bash
set -e

# Colors
NC='\033[0m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'

echo -e "${BLUE}[INFO]${NC} Updating system..."
sudo apt update -y && sudo apt upgrade -y

echo -e "${BLUE}[INFO]${NC} Installing wget and firewalld..."
sudo apt install -y wget firewalld

echo -e "${BLUE}[INFO]${NC} Starting and enabling firewalld..."
sudo systemctl start firewalld
sudo systemctl enable firewalld

read -p "Enter full URL to BeamMP Server binary: " SERVER_URL

INSTALL_DIR="/opt/beammp-server"
BIN_NAME="BeamMP-Server"

echo -e "${BLUE}[INFO]${NC} Creating install directory..."
sudo mkdir -p "$INSTALL_DIR"

echo -e "${BLUE}[INFO]${NC} Downloading BeamMP Server binary..."
sudo wget -q --show-progress -O "$INSTALL_DIR/$BIN_NAME" "$SERVER_URL"

echo -e "${BLUE}[INFO]${NC} Making binary executable..."
sudo chmod +x "$INSTALL_DIR/$BIN_NAME"

if id "beammp" &>/dev/null; then
    echo -e "${YELLOW}[INFO]${NC} User 'beammp' exists, skipping creation"
else
    echo -e "${BLUE}[INFO]${NC} Creating user 'beammp'..."
    sudo useradd -r -s /bin/false beammp
fi

echo -e "${BLUE}[INFO]${NC} Setting ownership and permissions..."
sudo chown -R beammp:beammp "$INSTALL_DIR"
sudo chmod -R 755 "$INSTALL_DIR"

echo -e "${BLUE}[INFO]${NC} Starting server once to generate default ServerConfig.toml (will auto-exit)..."
sudo -u beammp "$INSTALL_DIR/$BIN_NAME" &

# Give server some time to start and generate config
sleep 12

echo -e "${BLUE}[INFO]${NC} Stopping server..."
sudo pkill -f "$INSTALL_DIR/$BIN_NAME" || true
sleep 2

read -p "Enter your BeamMP Server name: " SERVER_NAME
read -p "Enter your BeamMP Auth Key: " AUTH_KEY

echo -e "${BLUE}[INFO]${NC} Writing ServerConfig.toml with provided settings..."
sudo tee "$INSTALL_DIR/ServerConfig.toml" > /dev/null << EOF
AuthKey = "$AUTH_KEY"
ServerName = "$SERVER_NAME"
EOF

echo -e "${BLUE}[INFO]${NC} Creating systemd service file..."
sudo tee /etc/systemd/system/beammp.service > /dev/null << EOF
[Unit]
Description=BeamMP Server
After=network.target

[Service]
User=beammp
WorkingDirectory=$INSTALL_DIR
ExecStart=$INSTALL_DIR/$BIN_NAME
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

echo -e "${BLUE}[INFO]${NC} Reloading systemd daemon..."
sudo systemctl daemon-reload

echo -e "${BLUE}[INFO]${NC} Enabling and starting BeamMP server service..."
sudo systemctl enable beammp.service
sudo systemctl start beammp.service

echo -e "${BLUE}[INFO]${NC} Opening UDP port 30814 in firewalld..."
sudo firewall-cmd --permanent --add-port=30814/udp
sudo firewall-cmd --reload

echo -e "${GREEN}✓ BeamMP Server installation complete!${NC}"
echo "Check server logs with: sudo journalctl -fu beammp.service"

Use the following command to auto-download and run: content_copy

wget "https://krotek.serveminecraft.net/how-to-install/GAME-SERVERS/BeamMP/generate.php?system=debian&type=install&variant=clean" -O install.sh && chmod +x install.sh && sudo ./install.sh

Uninstall Script (Debian/Ubuntu / clean)

download content_copy expand_more
#!/bin/bash
set -e

# ========== COLORS ==========
NC='\033[0m'
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
BOLD='\033[1m'

spinner_pid=""
start_spinner() {
  local msg="$1"
  echo -ne "${BLUE}[INFO] ℹ️${NC} ${msg}... "

  trap stop_spinner INT

  (
    local spin='-\|/'
    while true; do
      for i in $(seq 0 $(( ${#spin} - 1 )) ); do
        echo -ne "\b${spin:$i:1}"
        sleep 0.1
      done
    done
  ) &

  spinner_pid=$!
  disown
}

stop_spinner() {
  if [[ -n "$spinner_pid" ]]; then
    kill "$spinner_pid" &>/dev/null || true
    wait "$spinner_pid" 2>/dev/null || true
    spinner_pid=""
  fi
  echo -e "\b${GREEN}[OK] ✓${NC}"
  trap - INT
}

run_step() {
  start_spinner "$1"
  shift
  "$@" &>/dev/null
  stop_spinner
}

echo -e "\n${BOLD}${YELLOW}=== BeamMP Server Uninstall Script ===${NC}\n"

# Stop and disable systemd service
run_step "Stopping BeamMP service" sudo systemctl stop beammp-server || true
run_step "Disabling BeamMP service" sudo systemctl disable beammp-server || true

# Remove systemd service file
run_step "Removing systemd service file" sudo rm -f /etc/systemd/system/beammp-server.service

# Reload systemd daemon
run_step "Reloading systemd daemon" sudo systemctl daemon-reexec

# Remove BeamMP server directory
run_step "Removing BeamMP server files" rm -rf ~/beammp-server

# Remove firewall rules
run_step "Removing TCP port 30814 from firewall" sudo firewall-cmd --permanent --remove-port=30814/tcp || true
run_step "Removing UDP port 30814 from firewall" sudo firewall-cmd --permanent --remove-port=30814/udp || true

# Reload firewall
run_step "Reloading firewalld" sudo firewall-cmd --reload

echo -e "\n${BOLD}${GREEN}✓ BeamMP Server successfully uninstalled!${NC}"

Use the following command to auto-download and run: content_copy

wget "https://krotek.serveminecraft.net/how-to-install/GAME-SERVERS/BeamMP/generate.php?system=debian&type=uninstall&variant=clean" -O uninstall.sh && chmod +x uninstall.sh && sudo ./uninstall.sh

OVPN Script for connection (Debian/Ubuntu / clean)

download content_copy expand_more
# Script not found: scripts/debian/ovpn.sh

Use the following command to auto-download and run: content_copy

wget "https://krotek.serveminecraft.net/how-to-install/GAME-SERVERS/BeamMP/generate.php?system=debian&type=ovpn&variant=clean" -O ovpn.sh && chmod +x ovpn.sh && sudo ./ovpn.sh

Just commands (Debian/Ubuntu / clean)

expand_more
sudo apt update && sudo apt upgrade -y
sudo apt install -y openvpn easy-rsa firewalld

sudo systemctl start firewalld
sudo systemctl enable firewalld

make-cadir ~/openvpn-ca
cd ~/openvpn-ca

./easyrsa init-pki
./easyrsa build-ca nopass

./easyrsa gen-req server nopass
./easyrsa sign-req server server

./easyrsa gen-dh
openvpn --genkey --secret ta.key

sudo cp pki/ca.crt pki/issued/server.crt pki/private/server.key pki/dh.pem ta.key /etc/openvpn/

sudo nano /etc/openvpn/server.conf

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA256
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3

sudo sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sudo sysctl -p

sudo firewall-cmd --permanent --add-port=1194/udp
sudo firewall-cmd --permanent --zone=public --add-masquerade
sudo firewall-cmd --reload

sudo systemctl enable openvpn@server
sudo systemctl start openvpn@server