Getting your Server Ready
There are a couple of things that you need to do in order to get your server ready to host a FiveM server. Without following the procedures below you will experience issues when configuring your FiveM server.
- Download and install the Visual C++ Redistributable 2019
- Ensure that your Windows VPS is up to date and restarted after all updates have been completed
Downloading your FiveM Server
Now that your server has the prerequisites installed you are ready to start downloading your FiveM server! The steps below outline one way to download a FiveM server and install it to your Windows VPS server, however there may be other variations to install a FiveM server. All actions below are to be conducted on your Windows VPS.
- On your Desktop, create a new folder named FXServer
- Navigate to the FiveM Artifacts server and download the Latest Recommended Build
- Once downloaded, drag and drop the entire contents of the ZIP download to your FXServer folder
- Next, you need to download the CFX-Server-Data from FiveM’s Github
- Once downloaded, drag the whole cfx-server-data into your FXServer folder and rename it to server-data
- Continuing with the installation, we need to now create our server.cfg file which contains all configuration options for your server. There is an example server.cfg that you can get from FiveM directly
- We will create a new file in the path FXServer\server-data and call it server.cfg (NOTE: You may need to enable file extensions to create the server.cfg properly. Go to View | File Name Extensions)
- Paste the entirety of the example server.cfg into your newly created file using a notepad editor. For the purpose of this tutorial we are using Notepad ++
- After your server.cfg is setup, you need to get a FiveM license key for your server. This can be created through the FiveM Keymaster (NOTE: You will require a FiveM forum account to create a license key)
- You need to create a license key for your VPS IP. When creating your license key, the system will ask you to provide your server type (VPS), and your hosting company
- Once you have your license key created, scroll to the very bottom line in your server.cfg and paste it into the option sv_licenseKey
Creating the Batch File to Start your Server
Now that your server is downloaded and configured, it’s time to create the batch file that will actually execute and run your FiveM server.
- Create a new file on your Desktop with the name and extension StartServer.bat
- Right-click on the newly created file and choose “Open With” and select your notepad editor
- Providing that you followed all instructions mentioned above, enter the following into your StartServer.bat file and save
cd /d C:\Users\Administrator\Desktop\FXServer\server-data
C:\Users\Administrator\Desktop\FXServer\FXServer.exe +exec server.cfg
- When you double-click on your StartServer.bat you should see the following result in the console if your server starts correctly
There is only one thing left to do, port forward!
Port Forwarding for your FiveM Server
Port forwarding for your FiveM server will allow you to connect through the FiveM client from over the internet. Port forwarding is required for others to be able to connect to your server.
- Open the “Windows Firewall with Advanced Security” application that is installed on all Windows servers by default
- Click on Inbound Rules | New Rule…
- Select Port | TCP | Specific Ports
- Enter 30110, 30120 and select Next
- Allow the Connection, select Next, and name the rule anything you’d like
- Repeat this same process for both TCP and UDP in Inbound and Outbound rules
If you’ve completed all of the steps listed above, then you should have a working FiveM server