<!-- fivemad.com, Markdown source of https://fivemad.com/docs/server-setup/ports-and-networking -->
> Source: https://fivemad.com/docs/server-setup/ports-and-networking
> Section: Server setup
> Tags: ports, 30120, 40120, port forwarding, firewall, server list, proxy, cloudflare, networking
> Last updated: 2026-09-22
> Site map for assistants: https://fivemad.com/llms.txt

# Ports and networking

Which ports FiveM and txAdmin use, how to port forward at home, why a server is missing from the list, multiple servers on one IP, proxies and the listing convars.

Most "my friends can't join" and "my server isn't in the list" problems are network problems, not FiveM problems. This page covers the ports, home port forwarding, the server list and the more advanced proxy options.

[How To Port Forward A FiveM Server! (HTNetwork)](https://www.youtube.com/watch?v=Y0jLMc_zEDw) (YouTube video)

## The ports

| Port | Protocol | Used by | Who needs to reach it |
| --- | --- | --- | --- |
| `30120` | **TCP and UDP** | FXServer: TCP for HTTP (info, file downloads, connection handshake), UDP for game traffic | Every player |
| `40120` | TCP | txAdmin web panel | Only you and your admins |
| `3306` | TCP | MariaDB / MySQL | Only the server itself. Never open it to the internet. |

Both TCP **and** UDP must be open on `30120`. Opening only TCP gives the classic symptom: the server shows up and players can see the player count, but joining hangs or times out.

You can change the game port with the `endpoint_add_tcp` / `endpoint_add_udp` lines in [server.cfg](/docs/server-setup/server-cfg), and the txAdmin port with the `TXHOST_TXA_PORT` environment variable. txAdmin refuses to use `30120` for its panel, and the game port cannot be `40120`, to avoid mixing them up.

## Hosting from home: port forwarding

If the server runs on a PC at home, your router must forward the port to that PC.

1. Give the server PC a fixed local IP (a DHCP reservation in the router, or a static IP in Windows), for example `192.168.1.50`.
2. In the router's admin page, find **Port Forwarding** (sometimes "Virtual Server" or "NAT").
3. Add a rule: external port `30120`, internal port `30120`, protocol **TCP and UDP** (or two rules), target `192.168.1.50`.
4. Allow FXServer in **Windows Defender Firewall** (Windows asks the first time you run it, allow both private and public if you're unsure, or add inbound rules for port 30120 TCP and UDP).
5. Test from outside: ask a friend to `connect YOUR_PUBLIC_IP:30120` in the F8 console, or use a port checker like canyouseeme.org while the server runs.

> [!WARNING]
> Some ISPs use **CGNAT**: your router doesn't have a real public IP, so port forwarding can't work. If the WAN IP in your router differs from what "what is my IP" sites show, you are probably behind CGNAT. Ask your ISP for a public IP, or rent a VPS.

Don't forward `40120` at home unless you really need remote access, and if you do, use strong passwords and 2FA.

## Why isn't my server in the list?

Straight from the official server FAQ, plus experience:

1. **Ports.** Bad port forwarding or firewall rules are the usual cause. Test with direct connect first: `connect IP:30120` in F8. If that fails, it's the network.
2. **Private mode.** Make sure `sv_master1 ""` is commented out (`#sv_master1 ""`) or not present.
3. **Project info.** Set `sets sv_projectName` and `sets sv_projectDesc`.
4. **Time.** It can take **up to 8 minutes** after start for a server to appear.
5. **Blacklisted IP.** Some hosting ranges are blocked from the platform. Check with the [Cfx Blacklist Checker](/tools/cfx-blacklist-checker).
6. **Outdated artifact.** Very old builds are refused. Update, see [Updating artifacts safely](/docs/server-setup/updating-artifacts).

To see what the world sees, enter your IP:port or join code in the [Server Status Checker](/tools/server-status-checker). It shows players, build, resources and map as reported by your server.

## Join links

Every listed server gets a `cfx.re/join/xxxxxx` code tied to its license key. You can share it instead of an IP, and it keeps working if the IP changes. Find it in the server browser details, in txAdmin, or in the Discord status embed (`{{serverJoinUrl}}`). To show your live status on a website or Discord, use a [Server Status Badge](/tools/server-uptime-badge).

## Running more than one server on one machine

Give each server its own:

- **game port**: `endpoint_add_tcp "0.0.0.0:30121"` and `endpoint_add_udp "0.0.0.0:30121"`,
- **license key** (one key per server),
- **txData** (`TXHOST_DATA_PATH`) and **txAdmin port** (`TXHOST_TXA_PORT=40121`),
- **database**.

txAdmin's docs strongly recommend separate txData folders per server, otherwise `admins.json` conflicts.

```bat title="start-dev.bat (Windows example from the txAdmin docs pattern)"
@echo off
set TXHOST_DATA_PATH=C:\FXServer\txData-dev
set TXHOST_TXA_PORT=40121
set TXHOST_FXS_PORT=30121
set TXHOST_MAX_SLOTS=8
C:\FXServer\server\FXServer.exe
```

## OneSync and networking

OneSync (`set onesync on`) is the server side sync model: the server tracks all entities and decides which client sees what, culling entities to a radius (424 units by default) around each player. It lowers bandwidth per client compared to the old peer to peer model, allows up to 2048 slots with the right tier, and enables routing buckets and entity state bags. Every modern framework expects it. See [State bags and OneSync](/docs/development/state-bags-onesync) for what it means for scripts.

## Proxies, DDoS protection and Cloudflare

Large servers often put a proxy or DDoS filter in front of FXServer so the real IP stays hidden. This is advanced and easy to get wrong. The relevant convars (from the official server commands reference):

| Convar | What it does |
| --- | --- |
| `sv_forceIndirectListing true` | Prevents the server from being advertised with its real IP. |
| `sv_listingIpOverride "1.2.3.4"` | Overrides the IP sent to the server list (useful behind NAT or a proxy). |
| `sv_listingHostOverride "play.example.com"` | Overrides the host name sent to the list (useful behind a proxy). |
| `sv_proxyIPRanges "1.2.3.0/24 5.6.7.0/24"` | Space separated CIDR ranges of your own proxies, so FXServer trusts forwarded client IPs from them. |
| `sv_requestParanoia 0-3` | Extra checks against proxy based HTTP floods. |
| `sv_endpointPrivacy true` | Hides player IPs in public output. |

Some things to know before you try:

- **Cloudflare's normal (orange cloud) proxy only handles HTTP(S) traffic**, not the UDP game traffic, so you can't just point a proxied DNS record at FXServer. Setups that proxy FiveM traffic use a proxy that supports both TCP and UDP (Cloudflare Spectrum on paid plans, or a dedicated game DDoS provider), or a separate file server/CDN for downloads.
- If you set up a proxy without `sv_proxyIPRanges`, every player appears to come from the proxy's IP, which breaks IP bans and some anticheats.
- Test with a small group first. A broken proxy config makes the server invisible or unjoinable.

For the **txAdmin panel**, the txAdmin team's advice is not to expose it with SSL inside txAdmin but to put a reverse proxy (nginx, Caddy) or a Cloudflare Tunnel in front of it if you want HTTPS.

## Quick diagnosis

| Symptom | Likely cause |
| --- | --- |
| Nobody can connect, not even with direct connect | Port closed, wrong IP, firewall, CGNAT |
| Server in list, joining times out at "handshaking" or "connecting" | UDP 30120 blocked |
| Works on LAN (`192.168.x.x`), not from outside | Router port forward or ISP |
| Direct connect works, not in list | `sv_master1`, missing project name/desc, wait 8 minutes, blacklisted IP |
| Everyone shows the same IP in txAdmin | Proxy without `sv_proxyIPRanges` |
