This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

FiveM Server Tutorials for GTA V

Comprehensive guides to help you set up and manage your own FiveM servers for GTA V.

Welcome to the FiveM Server Tutorials

Explore our detailed tutorials designed to assist you in setting up and managing your FiveM servers for Grand Theft Auto V. Perfect for both beginners and experienced server administrators, these guides cover everything from basic setup to advanced configurations.

Tutorials

Getting Started

To begin, choose the tutorial that corresponds to your operating system and follow the instructions carefully. Each guide is designed to be easy to understand and will walk you through the process from start to finish.

Need Help?

If you encounter any issues or have questions, don’t hesitate to visit our community support forum for assistance.

Happy gaming and server managing!

1 - Installing a FiveM Server on CentOS

This tutorial will guide you through the process of installing a FiveM server on a CentOS operating system.

Installing a FiveM Server on CentOS

Prerequisites

  • A server running CentOS.
  • Root or sudo access on the server.
  • Basic knowledge of the Linux command-line interface.

Step 1: Installing Dependencies

  1. Update your system:

    sudo yum update
    
  2. Install the EPEL repository:

    sudo yum install epel-release
    
  3. Install required packages:

    sudo yum install git curl screen xz wget -y
    

Step 2: Adding a New User for FiveM

It’s recommended to run the FiveM server as a separate user for security purposes.

  1. Create a new user:

    sudo adduser fivem
    
  2. Switch to the new user:

    su - fivem
    

Step 3: Downloading and Extracting FiveM Server Files

  1. Download the latest server artifact:

    wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest.tar.xz
    
  2. Extract the server files:

    tar xf latest.tar.xz
    

Step 4: Configuring the Server

  1. Create a server configuration file (server.cfg):

    nano server.cfg
    
  2. Add basic configuration settings to server.cfg. Refer to the FiveM documentation for sample configurations.

  3. Save and exit the nano editor.

Step 5: Running the Server

  1. Start the server using the screen utility:
    screen -S fivem-server ./run.sh +exec server.cfg
    

Step 6: Server Management

  • To detach from the screen session, press Ctrl+A followed by Ctrl+D.
  • To return to the session, use screen -r fivem-server.

Conclusion

Your FiveM server should now be operational on CentOS. Always manage your server responsibly and in compliance with FiveM’s terms of service.


For detailed configuration options and more advanced settings, consult the FiveM Documentation.

2 - Setting Up a FiveM Server on Debian

A comprehensive guide to setting up a FiveM server on a Debian-based system.

Setting Up a FiveM Server on Debian

Creating a FiveM server on a Debian server involves several steps. This guide will walk you through the process from start to finish.

Prerequisites

  • A server running Debian or a Debian-based Linux distribution.
  • Root or sudo access on the server.
  • Basic knowledge of Linux command-line interface.

Step 1: Installing Dependencies

Before installing the FiveM server, you need to install the required dependencies.

  1. Update your package lists:

    sudo apt update
    
  2. Install the necessary packages:

    sudo apt install git curl screen xz-utils wget -y
    

Step 2: Creating a User for FiveM

It’s a good practice to run services like FiveM under a separate user.

  1. Create a new user:

    sudo adduser fivem
    
  2. Switch to the new user:

    su - fivem
    

Step 3: Downloading and Preparing FiveM Server Files

  1. Download the latest server artifact:

    wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest.tar.xz
    
  2. Extract the server files:

    tar xf latest.tar.xz
    
  3. Clone the cfx-server-data repository from GitHub. This repository contains essential data for your FiveM server:

    git clone https://github.com/citizenfx/cfx-server-data.git
    
  4. Move the resources folder from cfx-server-data to your main FiveM server directory:

    mv cfx-server-data/resources /home/fivem/
    
  5. Remove the now-empty resources directory from cfx-server-data:

    rm -rf cfx-server-data/resources
    

Step 4: Configuring the Server

  1. Create a new configuration file (server.cfg):

    nano server.cfg
    
    # Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
    endpoint_add_tcp "0.0.0.0:30120"
    endpoint_add_udp "0.0.0.0:30120"
    
    # These resources will start by default.
    ensure mapmanager
    ensure chat
    ensure spawnmanager
    ensure sessionmanager
    ensure basic-gamemode
    ensure hardcap
    ensure rconlog
    
    # This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
    # Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
    sv_scriptHookAllowed 0
    
    # Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
    #rcon_password ""
    
    # A comma-separated list of tags for your server.
    # For example:
    # - sets tags "drifting, cars, racing"
    # Or:
    # - sets tags "roleplay, military, tanks"
    sets tags "default"
    
    # A valid locale identifier for your server's primary language.
    # For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
    sets locale "root-AQ" 
    # please DO replace root-AQ on the line ABOVE with a real language! :)
    
    # Set an optional server info and connecting banner image url.
    # Size doesn't matter, any banner sized image will be fine.
    #sets banner_detail "https://url.to/image.png"
    #sets banner_connecting "https://url.to/image.png"
    
    # Set your server's hostname. This is not usually shown anywhere in listings.
    sv_hostname "FXServer, but unconfigured"
    
    # Set your server's Project Name
    sets sv_projectName "My FXServer Project"
    
    # Set your server's Project Description
    sets sv_projectDesc "Default FXServer requiring configuration"
    
    # Set Game Build (https://docs.fivem.net/docs/server-manual/server-commands/#sv_enforcegamebuild-build)
    #sv_enforceGameBuild 2802
    
    # Nested configs!
    #exec server_internal.cfg
    
    # Loading a server icon (96x96 PNG file)
    #load_server_icon myLogo.png
    
    # convars which can be used in scripts
    set temp_convar "hey world!"
    
    # Remove the `#` from the below line if you want your server to be listed as 'private' in the server browser.
    # Do not edit it if you *do not* want your server listed as 'private'.
    # Check the following url for more detailed information about this:
    # https://docs.fivem.net/docs/server-manual/server-commands/#sv_master1-newvalue
    #sv_master1 ""
    
    # Add system admins
    add_ace group.admin command allow # allow all commands
    add_ace group.admin command.quit deny # but don't allow quit
    add_principal identifier.fivem:1 group.admin # add the admin to the group
    
    # enable OneSync (required for server-side state awareness)
    set onesync on
    
    # Server player slot limit (see https://fivem.net/server-hosting for limits)
    sv_maxclients 48
    
    # Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
    # -> replace "" with the key
    set steam_webApiKey ""
    
    # License key for your server (https://keymaster.fivem.net)
    sv_licenseKey changeme
    
  2. Populate the configuration file. A basic example can be found in the FiveM documentation.

  3. Save and exit the editor:

    • Once you have finished editing the file in nano, you need to save your changes. To do this, press Ctrl + O. This command stands for ‘write Out’, which is nano’s way of saying ‘save’.
    • After pressing Ctrl + O, nano will ask you to confirm the file name. By default, it will use the name of the file you’re editing. Simply press Enter to confirm.
    • Now that your changes are saved, you can exit nano. Press Ctrl + X to close the editor and return to the command prompt.

Step 5: Configuring Firewall for FiveM

Before enabling the firewall, it’s important to ensure you won’t lose remote access to your server, especially if you’re using SSH.

  1. Check if UFW (Uncomplicated Firewall) is installed:

    sudo apt install ufw
    
  2. Allow SSH connections to ensure you can still access your server after the firewall is enabled:

    sudo ufw allow 22/tcp
    
  3. Enable UFW:

    sudo ufw enable
    
  4. Allow the default FiveM ports. FiveM typically uses ports 30120 and 30110 for server and HTTP server:

    sudo ufw allow 30120/tcp
    sudo ufw allow 30110/tcp
    
  5. Optionally, if you are using additional ports for specific resources or services, open them similarly:

    sudo ufw allow [YourAdditionalPort]/tcp
    
  6. Check your UFW status to ensure the rules are applied:

    sudo ufw status
    

Step 6: Running the Server

  1. Start the server using screen for background execution:
    screen -S fivem-server ./run.sh +exec server.cfg
    

cd ~/FXServer/server-data && bash ~/FXServer/server/run.sh +exec server.cfg

Step 6: Managing Your Server

  • To detach from the screen session, press Ctrl+A then Ctrl+D.
  • To reattach to the session, use screen -r fivem-server.

Conclusion

You have now set up a FiveM server on Debian. Remember to manage your server responsibly and adhere to the FiveM terms of service.


For more advanced configurations and troubleshooting, refer to the FiveM Documentation.

3 - Creating a FiveM Server on Windows

A step-by-step guide to setting up a FiveM server on your Windows PC.

Creating a FiveM Server on Windows

This guide will walk you through the steps to set up a FiveM server on your Windows PC.

Prerequisites

  • A PC running Windows.
  • A copy of Grand Theft Auto V installed.
  • Administrative access on your PC.

Step 1: Downloading FiveM Server Files

  1. Visit the FiveM website: FiveM.net
  2. Download the server files.
  3. Extract the downloaded files into a folder where you want your server to be located.

Step 2: Configuring the Server

  1. Navigate to the folder where you extracted the server files.
  2. Create a new text document named server.cfg.
  3. Edit server.cfg to configure your server settings. You can find a sample configuration on the FiveM documentation page.

Step 3: Running the Server

  1. Open the folder where your server files are located.
  2. Run FXServer.exe.
  3. Your server should now start. Ensure that your firewall allows incoming and outgoing connections for FiveM.

Step 4: Connecting to Your Server

  1. Open FiveM.
  2. Go to the server browser.
  3. Search for your server by name.
  4. Connect and start playing.

Additional Configuration

  • Adding Mods: You can add mods by placing their files in the resources folder and configuring them in your server.cfg.
  • Server Administration: Consider using a resource like txAdmin for easier server management.

Remember, running a server can require a significant amount of resources depending on the number of players and mods you plan to use.

Conclusion

Setting up a FiveM server can be a fun way to customize your GTA V experience. Always ensure you respect the game’s and FiveM’s terms of service when operating your server.


This tutorial is a basic guide. For more detailed instructions and advanced configurations, refer to the FiveM Documentation.