FiveM Connection timed out / can't connect to the server
If FiveM gets stuck on "Connection timed out" or "Connecting timed out" when joining a server, here is the full diagnosis: port 30120 TCP and UDP, server.cfg endpoints, a blocked deferral and the client cache.
The problem
You try to join a FiveM server and after a few seconds you get "Connection timed out" (or "Connecting timed out"). The connection never completes, it kicks you back to the menu or hangs on the loading screen. This can hit both a server owner testing their own host and a player joining someone else's server.
The cause
There are TWO families of cause worth telling apart. (1) "Connecting timed out" = the server's deferral (connection handshake) didn't answer in time: usually a resource that takes too long to start and blocks the connect, or a queue/whitelist script that never calls deferrals.done(). (2) Network "Connection timed out" = the client can't reach the server: port 30120 isn't open on TCP and/or UDP, the router/firewall blocks it, the endpoint_add lines are missing in server.cfg, or something client-side (corrupt cache, antivirus, VPN) is cutting the traffic. FiveM needs port 30120 open on TCP (list/resources) AND on UDP (real-time gameplay); opening only one is the most common mistake.
The solution
SERVER side: declare the endpoints explicitly in server.cfg and open port 30120 on both TCP and UDP in the OS firewall and in the router (port forwarding). This is the correct configuration:
# server.cfg — FiveM endpoints
# Listen on ALL interfaces. Default port is 30120.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
# If your host has a different public IP, do NOT put it here:
# use 0.0.0.0 to listen and open 30120 on the router/firewall.
# Hide the endpoint IP in the server list (optional, doesn't affect connecting):
sv_endpointprivacy true
# Make sure you have a valid sv_licenseKey or the server won't accept connections.
# sv_licenseKey "your_key"
# OneSync and capacity: if maxclients > 32 you need OneSync enabled.
set onesync on
sv_maxclients 48Step by step
- 1.Open port 30120 on TCP AND UDP: in the OS firewall (Windows Defender / iptables) and in the router (port forwarding to the server's local IP). Opening only TCP is mistake #1 — real-time gameplay runs over UDP.
- 2.In server.cfg keep `endpoint_add_tcp "0.0.0.0:30120"` and `endpoint_add_udp "0.0.0.0:30120"`. Use 0.0.0.0 (all interfaces), never your public IP in the bind.
- 3.If the message is "Connecting timed out" (not network), the issue is the deferral: watch the server console as you connect. A resource that is slow to start, or a queue/whitelist script that never calls `deferrals.done()`, leaves the connection hanging until the timeout.
- 4.Check that the queue/whitelist resource responds: in the `playerConnecting` handler you must call `deferrals.done()` (or `deferrals.done('rejection reason')`) on ALL paths, or the client will wait until it times out.
- 5.Verify `sv_maxclients` and OneSync: above 32 slots you need `set onesync on`; an inconsistent config can block new connections.
- 6.CLIENT side — clear the FiveM cache: close the game and delete the contents of `FiveM Application Data/data/cache` (keep `data/cache/priv` if you want to preserve your session). A corrupt cache causes timeouts while loading resources.
- 7.Temporarily disable VPN, proxy and your antivirus network protection (they often block FiveM's UDP). Try connecting again without them.
- 8.Update FiveM/FXServer: a large version gap between client and server can prevent the handshake from completing. If nothing works, reinstall the FiveM client clean.
Related guides
Last updated: 2026-06-29. Crxative-M is not affiliated with Cfx.re or Rockstar Games.
