Why Host SA-MP on Linux?

Linux is the preferred operating system for SA-MP server hosting. It's lightweight, stable, and more resource-efficient than Windows Server — meaning your VPS budget goes further. Most hosting providers offer affordable Linux VPS plans that run SA-MP servers with minimal overhead.

Prerequisites

  • A Linux VPS (Ubuntu 20.04 LTS or Debian 11 recommended)
  • SSH access to your server (use PuTTY on Windows or Terminal on Mac/Linux)
  • Basic familiarity with the command line
  • SA-MP server binaries (Linux version) from the official SA-MP website

Step 1: Prepare Your VPS

Log into your VPS via SSH and update the package list:

sudo apt update && sudo apt upgrade -y

SA-MP's Linux binary is a 32-bit application. On a 64-bit system, you'll need 32-bit compatibility libraries:

sudo apt install lib32gcc-s1 -y

Step 2: Download and Extract the SA-MP Server Files

mkdir ~/samp-server && cd ~/samp-server
wget https://sa-mp.mp/downloads/samp037svr_R2.tar.gz
tar -xzf samp037svr_R2.tar.gz

This extracts the server binary along with the default folder structure including /gamemodes/, /filterscripts/, and /plugins/.

Step 3: Configure server.cfg

The server.cfg file controls all core server settings. Open it with a text editor:

nano server.cfg

Key settings to configure:

SettingExample ValueDescription
hostnameMy SA-MP ServerServer name shown in the browser
gamemode0grandlarc 1Gamemode script to load
maxplayers50Maximum concurrent players
port7777UDP port (open this in your firewall)
password(leave blank)Set a join password or leave empty
announce1List server publicly (1 = yes)

Step 4: Open the Firewall Port

SA-MP uses UDP port 7777 by default. Open it using UFW:

sudo ufw allow 7777/udp
sudo ufw enable

Step 5: Start the Server

Make the server binary executable and launch it:

chmod +x samp03svr
./samp03svr

To run it in the background (so it keeps running after you close your SSH session), use screen or tmux:

screen -S samp
./samp03svr
# Press Ctrl+A then D to detach

Step 6: Keep the Server Running with a Startup Script

Create a simple shell script to restart the server automatically if it crashes:

#!/bin/bash
while true; do
  ./samp03svr
  echo "Server crashed. Restarting in 5 seconds..."
  sleep 5
done

Save it as start.sh, make it executable with chmod +x start.sh, and run it inside a screen session.

Troubleshooting Common Issues

  • Server not appearing in browser — Verify UDP 7777 is open and announce 1 is set.
  • Gamemode fails to load — Ensure the .amx file exists in /gamemodes/ and the name matches exactly in server.cfg.
  • Permission denied errors — Run chmod +x samp03svr to grant execute permission.