# How to Host a SA-MP Server (GTA San Andreas Multiplayer)

Host a SA-MP 0.3.7 server on Windows or Linux: download the server, edit server.cfg, set a gamemode and RCON password, open UDP 7777 and connect.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-host-a-sa-mp-server

To host a SA-MP server, download the SA-MP 0.3.7 server package for Windows or Linux, edit `server.cfg` to set a hostname, an RCON password and the gamemode you want, open UDP port 7777 on your firewall and router, and start `samp-server.exe` (Windows) or `./samp03svr` (Linux). Friends then add your public IP and port to their SA-MP client favourites and connect. The whole job takes about 15 minutes if your connection allows incoming traffic.

The server itself is tiny and will run on almost anything. The hard parts are the network side and getting the right gamemode, plugins and includes together, so this guide spends its time there.

![A street scene from GTA San Andreas on a multiplayer server](https://gamezservers.com/games/sa-mp/shot-1.webp)

## What you need before you start

- **A PC copy of GTA: San Andreas at version 1.0** for each player. The Steam and Rockstar Launcher builds must be downgraded first, and the Definitive Edition cannot run SA-MP at all.
- **The SA-MP 0.3.7 server package** from the [official SA-MP downloads page](https://www.sa-mp.mp/downloads/). Pick the Windows zip or the Linux tarball to match the machine that will run the server, not the machine you play on.
- **A machine that stays on.** Your gaming PC works for an evening session, but the server goes down when you shut it off.
- **A connection that accepts incoming traffic.** If your ISP puts you behind CGNAT, port forwarding will not work at all. Check with [this CGNAT guide](https://gamezservers.com/guides/how-to-tell-if-you-are-behind-cgnat) before you spend time on router settings.

## Step 1: Extract the server files

Unzip the package into its own folder, for example `C:\samp-server` or `~/samp-server`. You will see:

| File or folder | What it is |
| --- | --- |
| `samp-server.exe` or `samp03svr` | The server itself |
| `announce` / `announce.exe` | Helper that registers the server with the public list |
| `server.cfg` | The main config file |
| `gamemodes/` | Compiled `.amx` gamemodes, plus `.pwn` source |
| `filterscripts/` | Side scripts loaded on top of the gamemode |
| `scriptfiles/` | Data your scripts read and write |
| `pawno/` | The Pawn compiler and include files (Windows package) |

On Linux, make the binaries executable and install 32 bit libraries, because `samp03svr` is a 32 bit program:

```bash
chmod +x samp03svr announce
sudo dpkg --add-architecture i386
sudo apt update && sudo apt install libc6:i386 libstdc++6:i386
```

## Step 2: Edit server.cfg

Open `server.cfg` in a text editor. A clean starting point looks like this:

```
echo Executing Server Config...
lanmode 0
rcon_password ChangeThisToSomethingLong
maxplayers 50
port 7777
hostname My San Andreas Server
gamemode0 grandlarc 1
filterscripts
announce 1
query 1
weburl www.sa-mp.mp
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
language English
```

The lines that matter most:

- **rcon_password**: the server refuses to start while this is still `changeme`. Pick something long, since anyone with it controls the server.
- **gamemode0**: the `.amx` file in `gamemodes/` to load, without the extension, followed by how many times to repeat it before moving to `gamemode1`. `grandlarc 1` loads the bundled Grand Larceny freeroam mode.
- **maxplayers**: up to 1000 in 0.3.7. Set it to what your machine and upload speed can carry.
- **announce**: `1` asks the public list to show your server. Set `0` for a private server.
- **query**: must be `1`, or the client cannot read your server's name and player count, and it looks offline.

For the full list of in game admin commands that go with `rcon_password`, see [SA-MP RCON commands](https://gamezservers.com/guides/sa-mp-rcon-commands).

## Step 3: Add your gamemode, filterscripts and plugins

Most people want something beyond the bundled modes, usually a roleplay, freeroam or deathmatch script.

1. Put the compiled `.amx` file in `gamemodes/` and change `gamemode0` to its name.
2. Put filterscripts in `filterscripts/` and list them on one line: `filterscripts admin anticheat`.
3. Create a `plugins/` folder and add plugins your script needs, such as MySQL or streamer. List them on one line: `plugins mysql.so streamer.so` on Linux, or `plugins mysql streamer` on Windows.

Plugins must match the server's operating system. Windows needs the `.dll` build and Linux the `.so` build, and a plugin built for the wrong one fails to load with no obvious hint in game. If a script uses a MySQL database, create the database and user before the first start and put the credentials where the script expects them.

## Step 4: Open UDP port 7777

SA-MP uses a single UDP port for both game traffic and queries, 7777 by default (the `port` line).

1. Allow UDP 7777 inbound in the firewall. On Windows: `netsh advfirewall firewall add rule name="SA-MP" dir=in action=allow protocol=UDP localport=7777`. On Linux with ufw: `sudo ufw allow 7777/udp`. More detail in [Windows firewall rules for a game server](https://gamezservers.com/guides/windows-firewall-rules-for-a-game-server) and [Linux firewall for game servers](https://gamezservers.com/guides/linux-firewall-for-game-servers-ufw-firewalld).
2. Give the server machine a fixed local IP in your router.
3. Forward UDP 7777 from the router to that local IP. If your router menus are unfamiliar, the [port forwarding guide](https://gamezservers.com/guides/how-to-port-forward-a-game-server) walks through it.

If you run several servers on one IP, give each its own `port` value and forward each one.

## Step 5: Start the server and test it

On Windows, double click `samp-server.exe`. On Linux, run it in a session that survives logging out:

```bash
screen -S samp
./samp03svr
```

Detach with Ctrl+A then D. A good start prints the plugins and filterscripts it loaded, then `Number of vehicle models:` and the gamemode lines. Errors here usually mean a missing plugin, a wrong file name in `gamemode0`, or the default RCON password.

Now test from outside your network. On the PC you play on:

1. Open the SA-MP client, type a nickname at the top and go to **Favourites**.
2. Click the add server button and enter `your.public.ip:7777`.
3. Select it and click **Connect**.

If you are on the same network as the server, connect with the local IP instead, since many routers do not loop the public IP back to your own network. When the server shows in favourites but connecting stops at "The server didn't respond. Retrying..", the port forward or firewall is the usual cause, and [the not showing guide](https://gamezservers.com/guides/sa-mp-server-not-showing-in-internet-list) covers the rest.

![Cars and players in a San Andreas multiplayer session](https://gamezservers.com/games/sa-mp/shot-2.webp)

## Keeping it running

- **Back up `scriptfiles/` and your database** before every gamemode update. Player accounts live there.
- **Restart on a schedule** if your gamemode leaks memory over long uptime. A nightly `gmx` from RCON reloads the mode without a full restart.
- **Watch `server_log.txt`** for crashes and RCON logins. Failed logins show up here first.
- **Consider open.mp.** It runs the same `.amx` gamemodes, keeps working with the SA-MP client and is still maintained. [Moving a SA-MP server to open.mp](https://gamezservers.com/guides/how-to-move-a-sa-mp-server-to-open-mp) explains the switch.

## The easier route

Self hosting is fine for a test night. For a roleplay city or a freeroam server that people expect to find online at 3 am, a home PC gets awkward fast: it has to stay on, your upload speed caps the player count, and your home IP is the server address. A [GamezServers SA-MP server](https://gamezservers.com/games/sa-mp) is live in about a minute with its own address, sets the RCON password and port in the panel for you, gives you the file manager and SFTP for gamemodes and `.so` plugins, and keeps one click backups of `scriptfiles`. If a few friends run the city together, they can [split the bill](https://gamezservers.com/split-the-bill-game-server-hosting) and each pay their share.

## FAQ

### What port does a SA-MP server use?

UDP 7777 by default, set by the `port` line in `server.cfg`. The same port handles game traffic and server browser queries, so only that one needs forwarding.

### Why will my SA-MP server not start?

The most common reason is that `rcon_password` is still `changeme`. After that, look for a wrong `gamemode0` name or a plugin built for the other operating system.

### How much RAM does a SA-MP server need?

Very little. 1 GB covers freeroam for friends, 2 GB suits a roleplay city with a database and several plugins, and only large communities need more. Script quality matters more than memory.

### Can friends join from the Steam version of San Andreas?

Only after downgrading it to version 1.0 with a community downgrader. The Definitive Edition cannot join at all.

### Should I use SA-MP or open.mp for a new server?

open.mp is the safer choice for a new server since it is maintained and runs SA-MP gamemodes. Players on the plain SA-MP client can join either one.
