FiveM Server Setup Guide

A comprehensive guide to setting up your own FiveM server from scratch

Before You Begin

Setting up a FiveM server requires some technical knowledge and patience. This guide will walk you through the basic steps, but remember that every server is unique and may require additional configuration.

If you get stuck or need help, don't hesitate to join our Discord community for support.

1. Server Requirements

Recommended Hosting Provider

Enzonix Logo

Enzonix - Our Top Choice for FiveM Hosting

We recommend Enzonix as the best server hosting provider for FiveM servers. Their AMD EPYC and Ryzen powered servers deliver exceptional performance at affordable prices, starting at just $2/mo.

Special Discount: Use code EEeKOdOD at checkout for 5% off your Enzonix hosting!

Before setting up your FiveM server, ensure your hardware meets these minimum requirements:

  • CPU: Dual-core processor (Intel Core i5 or better recommended)
  • RAM: 4GB minimum (8GB+ recommended)
  • Storage: 15GB+ of free space (SSD recommended)
  • Network: Stable internet connection with 10+ Mbps upload
  • OS: Windows Server 2019/2022 or Linux (Ubuntu 20.04+ recommended)

For production servers with 32+ players, we recommend at least 16GB RAM, a quad-core CPU, and a dedicated server with DDoS protection.

2. Download FiveM Server

Follow these steps to download and set up the FiveM server artifacts:

  1. Visit the FiveM Artifacts Page
  2. Download the latest recommended server artifact (Windows or Linux based on your OS)
  3. Create a new folder for your server (e.g., "FiveM-Server")
  4. Extract the downloaded artifacts to your server folder
  5. Create a new folder named "server-data" inside your server folder - this will contain your resources and configuration files

Pro Tip: Keep your server artifacts and server-data in separate folders. This makes it easier to update the server without affecting your configuration and resources.

3. Configure server.cfg

The server.cfg file is the main configuration file for your FiveM server. Create this file in your server-data folder and configure it with your server settings:

server.cfg
# Server Info
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
sv_hostname "Lynora Labs Development Server"
sets sv_projectName "Lynora Labs"
sets sv_projectDesc "Development Server"
sets tags "default, lynora, labs"
sv_maxclients 48

# Steam Web API Key
set steam_webApiKey "YOUR_STEAM_API_KEY"

# License Key
sv_licenseKey "YOUR_FIVEM_LICENSE_KEY"

# Scripts/Resources
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure basic-gamemode
ensure hardcap

# Add your custom resources below
# ensure [resource_name]

# Server Icon (96x96 PNG)
load_server_icon myLogo.png

# Nested Config
exec resources.cfg
exec permissions.cfg

# Misc Settings
sets locale "en-US" 
sv_scriptHookAllowed 0
sv_endpointprivacy true
sv_enforceGameBuild 2802

# Uncomment to enable OneSync
# set onesync on

Make sure to replace YOUR_STEAM_API_KEY and YOUR_FIVEM_LICENSE_KEY with your actual keys.

4. Set Up Database

Most FiveM servers use a database to store player data and other information. MySQL/MariaDB is the most common choice:

  1. Install MySQL or MariaDB on your server
  2. Create a new database for your FiveM server
  3. Create a user with permissions to access this database
  4. Configure your connection string in your server configuration
database.cfg
# MySQL Connection String
set mysql_connection_string "mysql://username:password@localhost/database_name?charset=utf8mb4"

# MySQL Async Resource
ensure mysql-async

# Database Debug Mode (0 = off, 1 = on)
set mysql_debug 0

Replace username, password, and database_name with your actual database credentials.

5. Install Resources

You'll need to install a framework and essential resources for your server. The two most popular frameworks are ESX and QBCore:

ESX Setup
# ESX Core Resources
ensure es_extended
ensure esx_menu_default
ensure esx_menu_dialog
ensure esx_menu_list
ensure esx_identity
ensure esx_skin
ensure esx_datastore
ensure esx_addonaccount
ensure esx_addoninventory
ensure esx_society

# ESX Jobs
ensure esx_policejob
ensure esx_ambulancejob
ensure esx_mechanicjob

# ESX Misc
ensure esx_status
ensure esx_basicneeds
ensure esx_billing
QBCore Setup
# QBCore Resources
ensure qb-core
ensure qb-inventory
ensure qb-clothing
ensure qb-multicharacter
ensure qb-spawn
ensure qb-houses
ensure qb-apartments
ensure qb-garages
ensure qb-vehiclekeys
ensure qb-vehicleshop
ensure qb-radialmenu

# QBCore Jobs
ensure qb-policejob
ensure qb-ambulancejob
ensure qb-mechanicjob

# QBCore Misc
ensure qb-phone
ensure qb-banking
ensure qb-target

Download these resources from their official repositories and place them in your resources folder. Make sure to follow the installation instructions for each resource.

6. Start Your Server

Now that everything is set up, you can start your server:

  1. Navigate to your server folder
  2. For Windows: Run FXServer.exe +exec server.cfg
  3. For Linux: Run ./run.sh +exec server.cfg
  4. Check the console for any errors and fix them if necessary
  5. Connect to your server by opening FiveM client and entering localhost:30120 in the direct connect box

Success! If everything is set up correctly, you should now be able to connect to your server. Remember to port forward 30120 (TCP/UDP) if you want others to connect to your server.

Need More Help?

This guide covers the basics of setting up a FiveM server. For more advanced topics, troubleshooting, or specific questions, join our Discord community where our experienced members can help you.

FiveM Server Console