How to Set Up a SA-MP Server on Linux: Step by Step

How to Set Up a SA-MP Server on Linux: Step by Step

Install a SA-MP server on a Linux VDS: 32-bit libraries, server.cfg, MySQL plugin setup, autostart with systemd and fixes for the most common problems.

White Bilişim

How to Set Up a SA-MP Server on Linux

Setting up a SA-MP server takes about half an hour once the right libraries are in place. This guide covers the Linux VDS install, the server.cfg configuration, plugin setup and autostart.

1. Preparing the System

The SA-MP server binary is compiled as 32-bit, so a 64-bit system needs compatibility libraries to run it:

sudo apt update && sudo apt upgrade -y
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32z1 lib32stdc++6 libc6-i386 screen unzip
sudo useradd -m -s /bin/bash samp
sudo su - samp

💡 Skip this step and the server exits silently without printing an error. Missing 32-bit libraries are behind most “my server will not start” reports.

2. Downloading the Server Files

mkdir -p ~/samp && cd ~/samp
# download the server package and extract it into this directory
chmod +x samp03svr

3. Configuring server.cfg

hostname Your Server Name
gamemode0 my-gamemode 1
filterscripts
plugins mysql.so streamer.so sscanf.so
rcon_password STRONG_PASSWORD
maxplayers 200
port 7777
lanmode 0
query 1
announce 1

⚠️ Always change the rcon_password. Servers left on a default or weak password get taken over quickly.

4. Installing Plugins

Plugin files (.so) go into the plugins/ directory and get listed on the plugins line in server.cfg. The three most common ones:

PluginPurpose
mysqlDatabase connectivity
streamerStreaming objects, markers and pickups
sscanfParsing command parameters

The plugin version has to match your server version. An incompatible build shuts the server down at startup.

5. Compiling the Gamemode

Turn your .pwn file into an .amx with the Pawn compiler:

cd ~/samp/gamemodes
../pawno/pawncc my-gamemode.pwn -d3

Do not ignore compiler warnings. A tag mismatch warning is usually pointing at a real bug.

6. Autostart

[Unit]
Description=SA-MP Server
After=network.target
 
[Service]
Type=simple
User=samp
WorkingDirectory=/home/samp/samp
ExecStart=/home/samp/samp/samp03svr
Restart=on-failure
RestartSec=10
 
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now samp

7. Firewall

PortProtocolPurpose
7777UDPGame traffic
7777TCPRCON
sudo ufw allow 7777

Common Problems

The server starts and immediately quits

  • Check that the 32-bit libraries are installed
  • Read server_log.txt, where plugin loading errors show up

The server does not appear in the list

  • Verify the announce 1 and lanmode 0 settings
  • Make sure UDP port 7777 is open

MySQL connection errors

  • Check that the plugin version matches your database version
  • Verify the user permissions and connection details

Conclusion

Setting up a SA-MP server goes smoothly once the 32-bit libraries and plugin versions line up. Long term performance, though, depends far more on the quality of your gamemode than on the hardware.

👉 See our SA-MP server hosting page to match a package, or browse game server hosting for other titles.