How to run an SL:MP server
Step by step: what an SL:MP server on LuaJIT needs, how to fill in server.cfg, which port to open and how to join your own server through the launcher.
SL:MP is a Lua multiplayer for GTA: San Andreas that SEVEN and I built in 2020–2021. The last build is 1.0.0-alpha.1 from January 18, 2021, and the project hasn't been developed since. It's an alpha: a lot works, but don't expect SA:MP-level stability. Running a server for yourself and a few friends is still easy.
What you need
The client and the server have separate requirements.
| Side | Requirements |
|---|---|
| Client (player) | Clean GTA: San Andreas 1.0 US, ASI Loader and MoonLoader, the SL:MP client |
| Server | LuaJIT on Windows or Linux, the SL:MP server build |
| Network | An open UDP port (7777 by default) |
The client doesn't need SA:MP. Early prototypes ran on top of it, but we removed that dependency back in 2020. The game version does matter: MoonLoader and the client target 1.0 US, and on other versions the memory addresses won't match.
Client and server builds (for Windows and Linux) were published in the project thread on BLAST.HK.
Configuring server.cfg
All server settings live in server.cfg:
serverName = My SL:MP Server
version = 1.0.0
gamemode = freeroam
maxSlots = 10
stream = 200
address = 0.0.0.0
port = 7777
The fields:
serverName– the name players see in the launcher;version– the server version string;gamemode– the game mode the server loads on start;maxSlots– maximum number of players; for the alpha I recommend 10 or fewer;stream– the size of the stream zone: players beyond it aren't synced, which saves traffic;address– the address the server listens on;0.0.0.0means all network interfaces;port– the UDP port, 7777 by default, same as SA:MP.
The serverName, gamemode and stream values above are placeholders. If an SA:MP server already uses 7777 on the same machine, one of them has to move to another port.
Keep the stream zone modest. A bigger zone puts more players into each client's sync and sends more packets over the network.
Opening the UDP port
SL:MP talks over UDP using its own SL:NET protocol. With the port closed, the server still starts and you can even join it from the same machine, while everyone else sees nothing.
On Windows, add an inbound rule in Windows Defender Firewall → Advanced settings → Inbound Rules, or run one command from an administrator prompt:
netsh advfirewall firewall add rule name="SL:MP" dir=in action=allow protocol=UDP localport=7777
On Linux with ufw:
sudo ufw allow 7777/udp
Two common setups:
- A home server behind a router. Forward UDP 7777 to the computer's local IP (the Port Forwarding or Virtual Servers section of the router settings). If your ISP puts you behind CGNAT, forwarding won't help; use a VPS or a VPN with a public address.
- A VPS. Besides the OS firewall, many hosts have their own network filter in the control panel. Open the port there too.
The most common mistake is opening TCP instead of UDP.
Starting and connecting
Start the server under LuaJIT from the folder that holds its files and server.cfg. On Linux, run it inside screen or tmux so the process survives when the SSH session closes. Before inviting people, check the console output and join the server yourself.
Players connect through the SL:MP launcher. It's written in Java with an ImGui interface and handles the server list and connecting. For outside players the server must be reachable at your public IP (or domain) and the port from the config.
If you can join but your friends can't, the problem is almost always the network: the port, forwarding, or the host's filter.
What to expect from the alpha
1.0.0-alpha.1 has on-foot and in-vehicle sync (driver and passengers), three dialog types, pickups and virtual worlds. That's enough for a small freeroam or for experimenting with your own game mode in Lua. It isn't ready for a public server with dozens of players, and there won't be any more updates. If you're interested in the networking side, it lives on separately in the SNET library, and the LuaSocket beginnings are covered in UDP in Lua with LuaSocket.
Frequently asked questions
Can I set maxSlots above 10?
The value itself isn't capped, but for the alpha we recommended no more than 10 players: sync was tested with about ten people close to each other. Going higher is at your own risk.
I can join my server but my friends can't. What should I check?
Most likely the port is closed. Allow inbound UDP on the port from server.cfg (7777 by default) in the system firewall and forward it on your router. A TCP rule won't help: SL:MP uses UDP only.
Does the server machine need GTA: San Andreas installed?
No. The server is Lua code running under LuaJIT and doesn't need the game. GTA: SA 1.0 US with MoonLoader is only required on the players' side.