FiveM
Server
Portforwarding

Forwarding ports for your FiveM server

This guide will teach you how to forward your ports for your FiveM server!

⚠️

If your goal is to have a lot of people on your FiveM server, home hosting is definitely not recommended. Home hosting is fine if you just want to mess around with friends or for testing purposes. If you want to get serious with the FiveM server I personally recommend a VPS from any hosting company such as Hetzner.

What is portforwarding?

Port forwarding is a networking technique used to make sure that devices from outside the host network can communicate with the host network over the specified port. When you want people to be able to join your FiveM server, you need to forward the port.

Ports we use

  • FXServer uses port 30120 by default (TCP/UDP).
  • txAdmin uses port 40120 by default (TCP).

Windows Defender Firewall

  • Look for Windows Powershell on your computer, it should look like this
  • Make sure to run this app as administrator!
  • In the Powershell command line you paste the following:
netsh advfirewall firewall add rule name="FXServer-TCP" dir=in action=allow protocol=TCP localport=30120
netsh advfirewall firewall add rule name="FXServer-UDP" dir=in action=allow protocol=UDP localport=30120

In case you also want to open the txAdmin port, paste this as well:

netsh advfirewall firewall add rule name="txAdmin-TCP" dir=in action=allow protocol=TCP localport=40120
  • If the console says "Ok" 2 or 3 times, you have successfully added the rules to the Windows Defender Firewall.

Router

  • First of all, open a CMD on your computer.
  • In the CMD you type ipconfig.
  • You should get a result that looks like this.
  • What you need is the value of "Default Gateway", in my case this is 192.168.1.254.
  • The next step is using this IP to browse to your router's webpage. It should look like this but with your IP.
  • You should now be on the webpage of your router, it will prompt for a username and a password, you can find these 2 on the back of your router, physically.
  • Once you are logged in you need to look for the "Port forward" option. Where this is located differs per router, I suggest Googling your router brand + model to find out where this option is if you can't find it.
  • This is an example of what it could look like example.
  • Once you have done the whole configuration you can check if the port is opened using this website (opens in a new tab).
  • All you need to do there is fill in the port number and see if it says "Closed" or "Opened".
  • If it says "Opened", your FiveM server should be accessible from the outside!
⚠️

If it still does not work after following this guide, some Internet Service Providers don't allow portforwarding by default, contact your ISP and explain the issue. They should be able to activate it for you.

;