Datafex LogoDatafex
All guides

How to set up a SA-MP or MTA:SA server: a step-by-step guide

By Published Updated 5 min read

This guide sets up servers for the two separate projects that make GTA San Andreas multiplayer: SA-MP and MTA:SA. They run on top of the same game but they are not the same thing — SA-MP uses the Pawn language on the server side while MTA:SA uses Lua, their clients are separate, and scripts do not transfer from one to the other. So the guide's first job is helping you decide which one you are installing, and then covering each installation separately.

Before you start

  • A decision about the platform. If you already have a gamemode or a team with experience, the decision is made; if you are starting from scratch, look at whose script ecosystem you will be building on. Switching later means rewriting the gamemode.
  • A server. These two are among the lightest workloads on this list: a 100-slot roleplay server runs on 2 GB / 1 vCPU, and up to 500 players 4 GB / 2 vCPU is enough. What decides quality is not the amount of resources but single-core performance, because both Pawn and Lua execution run on one thread. The general logic of sizing: how many vCPUs and how much RAM?
  • A nearby location. On these games the quality a player feels depends almost entirely on latency, so if you serve a Turkish audience, location matters more than hardware: server location and ping
  • MySQL/MariaDB if you are doing roleplay. Run it on the same machine; the real load usually comes from queries.

1. Operating system

Debian 12 or Ubuntu 22.04 LTS suits both, but there is one difference and it decides the first half hour of your install.

The SA-MP server is compiled as 32-bit; modern distributions do not install 32-bit libraries by default, and when this step is skipped the process exits without an error. The MTA:SA 64-bit server binary carries no such requirement. On the SA-MP side, see the missing libraries first and then install them:

ldd ./samp03svr
dpkg --add-architecture i386
apt update
apt install lib32z1 lib32stdc++6

2. Installing SA-MP and server.cfg

Extracting the SA-MP server package is the whole installation; all configuration lives in server.cfg in the root directory and is read line by line:

hostname Server name
gamemode0 gamemode 1
filterscripts
plugins
maxplayers 100
port 7777
rcon_password STRONG_PASSWORD
announce 1
query 1
lanmode 0

The name on the gamemode0 line is the name of the compiled .amx file in the gamemodes/ folder, written without the extension. If you use plugins, the files listed on the plugins line have to be in the plugins/ folder and compiled for the same architecture as the server; a 64-bit plugin will not load into a 32-bit server.

On current projects open.mp is increasingly common: an actively developed server program designed to work with SA-MP clients and with most existing Pawn gamemodes. Its configuration is JSON-based rather than server.cfg, so a migration means rewriting the settings. If you are moving an existing server, try a copy of it on a separate port first.

3. Installing MTA:SA and mtaserver.conf

The MTA:SA server runs 64-bit and its configuration lives under mods/deathmatch/. Two files matter: mtaserver.conf, which carries the server settings, and acl.xml, which carries permissions. Resources live in the resources/ folder beside them, and the ones started on boot are listed individually in the configuration file.

The first job is closing the administration resource's default account. An MTA server ships with an administrator account ready to use, and until its password is changed, administration of your server is effectively open to everyone. Handle it on the first boot, not "later".

MTA's practical difference from SA-MP is that it distributes resources to players through its own internal HTTP server. That needs a separate port open, and with large resource packs it is this transfer that determines how long a first join takes.

4. Ports

PortProtocolPurpose
7777UDPSA-MP game and query traffic
22003UDPMTA:SA game traffic
22005TCPMTA:SA internal HTTP server (resource transfer)

On MTA, appearing in the server list needs the ASE query port reachable from outside alongside the game port; in the default configuration that is the game port plus 123. If your server is running but missing from the list, this is the first place to look. If you are on Datafex, port management and extra IP requests are handled from the customer panel.

The most common first-boot mistakes

  1. The 32-bit libraries were never installed for SA-MP. The process appears to start and exits immediately.
  2. The file name on the `gamemode0` line is wrong. The server starts and you land in an empty world.
  3. Plugin architecture does not match. A "plugin failed to load" line scrolls past in the console and the gamemode half-works.
  4. Only the game port was opened on MTA. The server does not appear in the list, or players cannot download resources.
  5. The default administrator account was left in place. Administration of the server is open to everyone.
  6. The hardware was scaled up without optimising scripts. On these two games the limit is usually the amount of code running each tick, not the hardware; and on the database side the first place to look is indexes: MySQL performance settings

On the DDoS side

Both servers run over UDP, and server list queries arrive on the game port itself, which makes query floods a classic problem on these games. Because source addresses can be forged in UDP, blocking attacking addresses does not help; filtering has to happen at the network layer: what is DDoS protection?

On Datafex servers, layered Fexwall DDoS protection is included free on every plan.

Next step

On roleplay servers player progress lives in the database, so regular backups and a restore you have actually tested once are essential: server backup strategy We have put the recommended plans by player count and the processor options on one page: SA-MP and MTA server plans. If you plan to run several server instances on the same machine, the vCPU steps on the virtual server plans become your decision point, and you can pick resources yourself and see the monthly total in the server configurator.

If you want to act on what is in this guide:

See recommended server plans for SA-MP and MTA

Related guides