$ USD
  • $ USD
  • € EUR
  • £ GBP
  • $ AUD
  • R$ BRL
  • CHF CHF
  • ¥ JPY

Prices permanently reduced.

Create FiveM Server

How to Create a FiveM Server in 2025 – Complete Setup Guide

Want to run your own FiveM server so you and your friends can play? No worries! This guide will walk you through each step, and I’ll keep it simple.

Want to create your own FiveM server? This guide makes it easy. Really easy. We’ll go step-by-step. Setting up your server? Check. You’ll need to know what it takes to host it too. Don’t worry, we’ll tell you everything. Your server is live? Awesome. But you’re not done yet! You’ll need rules. And a whitelist. These are the important bits to keep your server running smoothly!

FiveM Logo

What is FiveM? {#what-is-fivem}

FiveM is a modification framework for GTA V enabling custom multiplayer servers with modified game modes, scripts, and up to 2048 concurrent players using OneSync Infinity.

Key components:

  • txAdmin: Web-based server management panel
  • FiveM Client: Modified GTA V launcher players use
  • FXServer: The server software (artifact) you’ll install

What is a FiveM Server?

A FiveM server is a computer or dedicated server that runs the FiveM server software, allowing players to connect and play together. Setting up a FiveM server gives you full control over your gameplay environment, from selecting the mods to enforcing the rules. These servers can be hosted on various platforms including Windows and Linux computers, as well as through dedicated server hosting providers.

Pre-Requirements

To begin setting up a GTA 5 roleplay server on FiveM, you will require the following:

How much does it cost to run a FiveM server? We answered that question right here


Server Templates – Ready to play!

If coding isn’t your preference or you’re short on time, we recommend purchasing a full server preset to kickstart your server setup. Recommended if you are looking for a quick start.

Most loved templates:

While using a template isn’t required, it’s often a good idea to begin with one!


FiveM Server Hosting

Selecting the appropriate hosting option is essential for establishing your FiveM server, as it affects performance, reliability, and scalability.

We tested & compared the best FiveM server hosters and published our outcome here:

If you prefer to self-host, go for Hetzner or OVH – both hosters are the best options – but you have to set up the server by yourself, while Zaphosting has a Gameserver option (so everything is set up).

Is Zaphosting recommended? For the start, you can use Zaphosting, as it is very easy to start up a server with their user-interface (UI). BUT (!) there are better server hosters.


To sum up this post, The best hosting options for your FiveM server:

It’s worth noting that Zaphosting provides an administration panel, while OvhCloud and Hetzner necessitate some technical expertise for server setup. However, if you’re able to configure the servers on your own, you’ll benefit from more powerful options with OvhCloud and Hetzner.

Install FiveM Server Files

  1. Create a New Folder:
    • Create a new folder on your desktop or preferred location.
    • Example: D:\FXServer\server. This directory will be used for your server.
  2. Download the Latest Version of FiveM Artifacts Server:
  3. Extract the Files:
    • Extract the downloaded files into the created directory (D:\FXServer\server).
  4. Download and Extract cfx-server-data:
    • Download cfx-server-data and extract it into a new folder.
    • Example: D:\FXServer\server-data.
  5. Create a server.cfg File:
    • Create a server.cfg file in the server-data folder.
    • Example configuration file: example server.cfg.
  6. Generate a New FiveM Server Key:
  7. Set the Server License in server.cfg:
    • Add the generated license key to the server.cfg file:sv_licenseKey "yourLicenseKeyHere"
  8. Start the Server:
    • Navigate to the server-data folder and start the server using the appropriate command.

Windows 11

# 1. Create directory structure
New-Item -Path "C:\FXServer" -ItemType Directory
Set-Location "C:\FXServer"

# 2. Download latest artifact
$artifactUrl = (Invoke-WebRequest "https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/").Links | 
    Where-Object {$_.href -match "^\d+.*\.zip$"} | 
    Select-Object -First 1
Invoke-WebRequest "https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/$($artifactUrl.href)" -OutFile "fx.zip"

# 3. Extract files
Expand-Archive -Path "fx.zip" -DestinationPath "." -Force
Remove-Item "fx.zip"

# 4. Download server-data template
git clone https://github.com/citizenfx/cfx-server-data.git server-data

# 5. Create run.bat
@"
@echo off
cd /d C:\FXServer\server-data
C:\FXServer\FXServer.exe +exec server.cfg
pause
"@ | Out-File -FilePath "run.bat" -Encoding ASCII

Ubuntu 24.04 Setup

#!/bin/bash
# Save as install_fivem.sh

# 1. Update system and install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y wget curl screen git xz-utils

# 2. Create fivem user (security best practice)
sudo useradd -m -s /bin/bash fivem
sudo usermod -aG sudo fivem

# 3. Download and extract artifact
cd /home/fivem
LATEST_ARTIFACT=$(curl -s https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/ | grep -o '[0-9]*-[a-z0-9]*' | head -1)
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${LATEST_ARTIFACT}/fx.tar.xz
tar xf fx.tar.xz
rm fx.tar.xz

# 4. Clone server-data
git clone https://github.com/citizenfx/cfx-server-data.git server-data

# 5. Create systemd service
sudo tee /etc/systemd/system/fivem.service > /dev/null <<EOF
[Unit]
Description=FiveM Server
After=network.target

[Service]
Type=simple
User=fivem
WorkingDirectory=/home/fivem/server-data
ExecStart=/home/fivem/run.sh +exec server.cfg
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# 6. Create run script
echo '#!/bin/bash
cd /home/fivem/server-data
exec /home/fivem/alpine/opt/cfx-server/ld-musl-x86_64.so.1 \
    --library-path "/home/fivem/alpine/usr/lib/v8/:/home/fivem/alpine/lib/:/home/fivem/alpine/usr/lib/" \
    /home/fivem/alpine/opt/cfx-server/FXServer +exec server.cfg' > /home/fivem/run.sh
chmod +x /home/fivem/run.sh

# 7. Set permissions
sudo chown -R fivem:fivem /home/fivem/

# 8. Enable and start service
sudo systemctl enable fivem
sudo systemctl start fivem

Docker Setup

# docker-compose.yml
version: '3.8'

services:
  fivem:
    image: spritsail/fivem:latest
    container_name: fivem-server
    stdin_open: true
    tty: true
    environment:
      LICENSE_KEY: "your_license_key_here"
      RCON_PASSWORD: "change_me_strong_password"
    ports:
      - "30120:30120"
      - "30120:30120/udp"
      - "40120:40120"  # txAdmin
    volumes:
      - ./server-data:/config
      - ./resources:/config/resources
    restart: unless-stopped
    
  mariadb:
    image: mariadb:10.11
    container_name: fivem-db
    environment:
      MYSQL_ROOT_PASSWORD: "strong_root_password"
      MYSQL_DATABASE: "fivem"
      MYSQL_USER: "fivem"
      MYSQL_PASSWORD: "strong_db_password"
    volumes:
      - ./mysql-data:/var/lib/mysql
    restart: unless-stopped
# Deploy with:
docker-compose up -d

# View logs:
docker-compose logs -f fivem

Database Configuration

For ESX/QBCore Frameworks

-- Create database and user
CREATE DATABASE IF NOT EXISTS `fivem` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivem'@'%' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON `fivem`.* TO 'fivem'@'%';
FLUSH PRIVILEGES;

Connection String in server.cfg

set mysql_connection_string "mysql://fivem:your_secure_password@localhost/fivem?charset=utf8mb4"

Adjust Power Settings (Windows)

If you’re running your FiveM server on a Windows operating system, it’s crucial to change the Power Settings from “Balanced” or “Power Saver” mode to “High performance.”

This adjustment ensures that your server operates at its maximum potential without any performance limitations.

Follow these steps to change the Power Settings:

  1. Open the Control Panel: Press the Windows key and type “Control Panel” in the search bar, then click to open it.
  2. Go to Power Options: In the Control Panel, select “System and Security,” then click on “Power Options.” This will display the available power plans.
  3. Choose “High performance”: In the Power Options menu, you’ll see several power plans listed. Select “High performance” to boost your system’s performance. If you don’t see it, click “Show additional plans” to reveal it.
  4. Confirm the Change: Once “High performance” is selected, the settings will automatically adjust. You can now close the Control Panel.

This ensures that your system allocates the maximum resources for your server, reducing lag and improving gameplay experience.


How to Add Mods (Scripts, MLOs)

You can add new scripts, mods or MLOs to your FiveM server. I’ll show you how:

Why doing so? Well, adding new content like scripts, mods, or MLOs to your FiveM server can greatly enhance the player experience (the fun your players have) and make your server unique.

  1. Prepare Your Server
  2. Download Content
    • Get scripts, mods, or MLOs from trusted sources.
    • Check for required dependencies.
  3. Install Scripts
    • Upload the script folder to server-data/resources.
    • Add ensure script_name to server.cfg.
    • Restart the server.
  4. Install Mods
    • Upload mod files to a new folder in resources.
    • Configure fxmanifest.lua or __resource.lua if needed.
    • Add ensure mod_name to server.cfg and restart.
  5. Install MLOs
    • Place MLO files in resources.
    • Add this_is_a_map 'yes' to the manifest file.
    • Update server.cfg with ensure mlo_name and restart.
  6. Troubleshooting
    • Double-check paths and dependencies.
    • Resolve any conflicts or errors.

Trusted Sources for Resources

  1. FiveMX – A trusted site for new resources.
  2. GTA5-Mods.com – Popular website for GTA V mods, including FiveM content.
  3. FiveM Forums (Releases Section)https://forum.cfx.re/c/releases/7 – Community-driven resource for FiveM scripts, maps, and more.

As said, I dislike Tebex for many reasons

Resource Performance Guidelines

  • Keep total resource count under 200
  • Monitor with resmon 1 in-game
  • Target <5ms per resource in resmon
  • Remove unused resources

Resource Monitoring Script

-- monitor.lua - Add to server resources
Citizen.CreateThread(function()
    while true do
        local resources = {}
        for i = 0, GetNumResources() - 1 do
            local resource = GetResourceByFindIndex(i)
            if GetResourceState(resource) == "started" then
                table.insert(resources, {
                    name = resource,
                    cpu = GetResourceCpuUsage(resource),
                    memory = GetResourceMemoryUsage(resource)
                })
            end
        end
        -- Log high usage resources
        for _, res in ipairs(resources) do
            if res.cpu > 10.0 then
                print(("^3WARNING: %s using %.2f ms CPU^7"):format(res.name, res.cpu))
            end
        end
        Citizen.Wait(60000) -- Check every minute
    end
end)

Configuring Your Server

Editing the Server Config

Next, there are many variables of the server from within the server.cfg file. Before making any edits, ensure your server is turned off. Once edits are made, you are finally allowed to restart the server.

Example server.cfg:

# Network configuration
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# Server info
sv_hostname "^4My FiveM Server ^7- ^2Roleplay ^7| ^3Recruiting Staff"
sv_projectName "My FiveM Project"
sv_projectDesc "Best RP Server NA"
sets tags "roleplay, custom, esx, police, ems"
sets locale "en-US"

# Security
sv_licenseKey "your_license_key_here"
sv_scriptHookAllowed 0
sv_endpointprivacy true

# Slots configuration
sv_maxclients 128
set onesync on  # Required for 32+ players

# Steam API (optional but recommended)
set steam_webApiKey "your_steam_api_key"

# Admin setup
add_ace group.admin command allow
add_ace group.admin command.quit deny
add_principal identifier.fivem:1234567 group.admin  # Replace with your FiveM ID

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

# Framework (choose one)
#ensure es_extended  # For ESX
#ensure qb-core      # For QBCore

Setting Yourself as Admin

Of course you want to admin permissions to moderate your server. Here’s how you can make yourself admin:

  1. Join your server
  2. Press F8 for console
  3. Type playerlist
  4. Find your name and copy the identifier

But, it depends on the framework of your server.

Generating a Steam API Key

If using a framework like ESX, you may need a Steam API key:

  1. Visit the Steam API key site.
  2. Log in with Steam.
  3. Enter a domain name (your server name).
  4. Finally, copy the generated key and paste it into the server.cfg file.

Enabling OneSync

To enable OneSync:

  1. First, find your startup parameters (Startup file or Game Panel).
  2. Then, add +set onesync on or enable OneSync in the Game Panel.
  3. Finally, restart your FiveM server

If you’re on a Windows server, right-click the .bat file to edit it.

Security & Hardening

Firewall Rules

# UFW (Ubuntu)
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow 40120/tcp  # txAdmin
sudo ufw allow 22/tcp     # SSH
sudo ufw enable

# Windows Firewall (PowerShell as Admin)
New-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -LocalPort 30120 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -LocalPort 30120 -Protocol UDP -Action Allow

Advanced Security Checklist

  • Enable sv_endpointprivacy true
  • Use strong RCON password or disable entirely
  • Implement IP whitelist for admin connections
  • Enable txAdmin 2FA
  • Regular automated backups
  • Monitor for unusual resource usage
  • Implement rate limiting
  • Use fail2ban for SSH (Linux)

DDoS Protection

# nginx proxy configuration
limit_req_zone $binary_remote_addr zone=fivem:10m rate=10r/s;

server {
    listen 30120;
    location / {
        limit_req zone=fivem burst=20 nodelay;
        proxy_pass http://localhost:30121;
    }
}

Connecting to Server

Connecting to your Server
  1. Locate Your Server Address: Once you have your FiveM server connection address (CFX/IP address), you’re ready to connect.
  2. Connect via FiveM Client:
    • Open the FiveM client.
    • Navigate to “Servers”.
    • Enter your CFX/IP address and connect.

By following these steps, you’ll now have your FiveM server created & running, ready for players to join and enjoy!

How To Make Your FiveM Server Popular (How to get players)

Adding New Resources

  • Access the server configuration file: The configuration file is usually named server.cfg and is located in the main directory of your FiveM server.
  • Edit the server configuration file: Open server.cfg with a text editor (such as Notepad++ or VS Code).
  • Add the resource: At the end of the server.cfg file, add a new line with the following command to start the resource: start resourceNameReplace resourceName with the actual name of the resource folder you uploaded. For example, if the folder is named coolcar, you would add:sqlstart coolcar
  • Save and close: Save the changes and close the text editor.

If your’re looking for new resources, check out our store here!

Setting Up Rules

Before you publish your server, it’s essential to establish a clear set of rules to ensure a fair and enjoyable gaming experience for everyone involved. Key rules to consider include prohibiting Fail RP (Roleplay) and any form of cheating, as these can significantly detract from the immersive atmosphere you aim to create.

To help you navigate this process, we’ve put together a comprehensive tutorial that outlines best practices for rule-setting in gaming communities. This resource will guide you through the necessary steps to draft effective rules and maintain a positive environment. You can find the tutorial linked here for your convenience!

Creating a Whitelist

If you’re looking to safeguard your FiveM server from disruptive trolls and maintain a positive gaming environment, implementing a whitelist is an effective solution. This tutorial will guide you through the steps to create and manage a whitelist, ensuring that only approved players can join your server.

Why using a whitelist? By restricting access to trusted individuals, you can significantly reduce the risk of harassment and unwanted behavior, allowing for a more enjoyable experience for all participants. Follow along as we explore the necessary tools and settings to establish a secure and welcoming community on your FiveM server.


fivem server popular

How To Get New Players to your Server


The Next Steps (After Setup)

  • The Complete FiveM Server GDPR Compliance Guide for 2025

    The Complete FiveM Server GDPR Compliance Guide for 2025

    ⚠️ Legal Disclaimer: This guide provides general information only and does not constitute legal advice. GDPR violations can result in fines up to €20 million or 4% of worldwide turnover. Always consult qualified legal counsel for your specific situation. Why This Guide Could Save Your Server (And Your Business) Running a FiveM server automatically makes…

  • What is Power Gaming (FiveM)?

    What is Power Gaming (FiveM)?

    Power gaming is forcing unrealistic actions or outcomes on other players without allowing them to respond or react naturally in roleplay scenarios. Core Violations 1. Denying Player Agency 2. Forcing Impossible Actions 3. Ignoring Game Mechanics Common Examples in FiveM Police Scenarios: Criminal Scenarios: Medical Scenarios: Server Rule Implementation Most servers define power gaming as:…

  • How To Uninstall FiveM

    How To Uninstall FiveM

    So you want to know how to uninstall FiveM – here you go. Windows Method 1: Standard Uninstall Method 2: Manual Removal (if not listed in Control Panel) Registry Cleanup (Optional) Linux Important Notes Verification Confirm complete removal: One-sentence summary: Uninstall FiveM through Control Panel, manually delete its folders in AppData, and optionally clean registry…


FAQ

What Type of Server can I create with FiveM?

You can create any server-type you want – Deathmatch, Roleplay (GTA RP) or Racing Server. We recommend creating a RP server!

What are the requirements to run a FiveM server?

To run a FiveM server, you’ll need a copy of Grand Theft Auto V, server hardware (a PC or a dedicated server), an internet connection, and the FiveM server software. Having a VPS or a dedicated server with good specifications is recommended for larger player counts.

Is it free to create a FiveM server?

Yes, setting up a FiveM server is free. However, if you choose to host your server on a dedicated machine or use a VPS (Virtual Private Server), there will be hosting costs involved.

How to make my server popular?

We wrote a tutorial about how your server gets the attention it deserves here:
How to get players

Can I monetize my FiveM server?

Yes, FiveM indeed allows server owners to monetize their servers through donations or paid memberships, as long as they follow FiveM’s community guidelines and terms of service.
Read more about it here

How to create a FiveM server fast?

Use our Complete FiveM Servers & you’ll be able to create a FiveM server within minutes!

Is Zaphosting recommended?

If you’re beginning to build a server, Zaphosting is recommended as it is the only hoster offering a game-panel. If you need stability, choose Ovh or Hetzner :)


Now you know How To Create a FiveM server! We hope you liked our tutorial :)

How to Show FPS in FiveM (+ Performance Boost)

Growth & Monetization

Player Acquisition Strategy

  1. Server listing optimization: Update tags, description, banner every week
  2. Content creation: Record 60-second clips for TikTok/YouTube Shorts
  3. Events: Weekly scheduled events (races, heists, community meetings)
  4. Partnerships: Cross-promote with other servers

Monetization Options

  • Donations: Tebex alternative – use Stripe + Discord bot (save 5% fees)
  • Priority queue: $5-10/month for queue skip
  • Cosmetics: Custom cars, clothing (non-gameplay affecting)
  • Property slots: Additional houses/garages

13 comments

  1. POSSIBLE DE VOUS CONTACTER POUR que vous puissiez code notre serveur ? je mettrais le prix veuillez me contacter sur mon adresse mail

    1. bitte kann ich ihren server beitreten wenn ja

  2. How can i play this on localhost

  3. Tiffany Rachells

    any help installing thru zap host PLEASSSE

  4. Autumn Graham

    This tutorial is very helpful and detailed for anyone looking to create their own FiveM server. It covers all the necessary steps and requirements, making it easy to follow along. Great job!

  5. donald medhurst

    This article provides a helpful guide for choosing a hosting provider and setting up a FiveM server. The step-by-step instructions are clear and easy to follow. Great resource for beginners!

  6. stefan keeling

    This article provides a clear and detailed guide on how to install scripts, mods, and MLOs for FiveM servers. It’s helpful to have trusted sources listed for these resources.

  7. Neal Sporer

    Great step-by-step guide for setting up a FiveM server! This is really helpful for beginners like me. Thank you!

  8. rosario emard

    This article provides helpful information for setting up a FiveM server, especially for beginners. It’s great that it recommends different hosting providers based on skill level. I appreciate the step-by-step guide for installing the server files and adjusting power settings. Overall, a useful resource for anyone looking to start their own FiveM server.

  9. edwardo thiel

    Great article with clear and detailed instructions on choosing a hosting provider and setting up a FiveM server. The tips on adjusting power settings and adding content are very helpful for improving performance and player experience.

Leave a Reply
Instant Download

For all orders

Our Guarantee

30 days money back guarantee

Satisfaction Warranty

100% Satisfaction Guarantee

Secure Checkout

Crypto / MasterCard / Visa

Success!

The discount has been applied. You will see it when you checkout.

There has been a problem

Unfortunately this discount cannot be applied to your cart.