EN · $ USD
FiveM and Roleplay Servers

How to Install FiveM Scripts: ensure and Folder Structure

7 min read Updated: OyunBulut technical team

In short

To install a FiveM script, copy its folder into the resources directory (ideally inside a [category] folder), check that fxmanifest.lua sits at its root, import its SQL file into the database if it has one, and add an ensure folder_name line to server.cfg after its dependencies. Then start it from the console with the refresh and ensure commands.

In this guide
  1. Key concepts: resource, fxmanifest and ensure
  2. Step 1: Check the fxmanifest.lua file
  3. Step 2: Organize the resources folder
  4. Step 3: Add ensure lines in dependency order
  5. Step 4: Import the SQL file
  6. Step 5: Start the script without stopping the server
  7. Editing the config file and translations
  8. Safe installation habits
  9. Script not working? Quick checklist
  10. Next step: a server that can handle your scripts

Installing a FiveM script takes four steps: copy the script folder into the resources directory, check its fxmanifest.lua file, import the SQL file into the database if there is one, and add an ensure line to server.cfg in the right order. Most scripts that fail to work do so because one of these steps was skipped. This guide walks through each step along with the most common mistakes.

Key concepts: resource, fxmanifest and ensure

  • Resource: in FiveM, every script, map or vehicle pack is a "resource." A resource's name is the name of the folder that contains its manifest file.
  • fxmanifest.lua: the resource's ID card. It defines which files run on the client, which run on the server, and which other resources it depends on. In very old scripts you may see __resource.lua instead; that format is deprecated and not used in new scripts.
  • ensure: the command used in server.cfg and the console. It starts a resource if it is stopped and restarts it if it is running. You can safely use it instead of the start command.

Step 1: Check the fxmanifest.lua file

Before installing a script you downloaded, open it and look at the manifest file. A typical modern manifest looks like this:

fx_version 'cerulean'
game 'gta5'
lua54 'yes'

description 'Ornek meslek scripti'
version '1.0.0'

shared_scripts {
    '@ox_lib/init.lua',
    'config.lua'
}

client_scripts {
    'client/*.lua'
}

server_scripts {
    '@oxmysql/lib/MySQL.lua',
    'server/*.lua'
}

dependencies {
    'oxmysql',
    'ox_lib'
}

This file tells you three important things:

  • Lines starting with @ pull files from another resource. The example script will not work without ox_lib and oxmysql.
  • The dependencies block lists required dependencies. If these resources are missing from the server, the script will not start.
  • Framework clues: lines mentioning @es_extended or qb-core tell you which framework the script was written for. An ESX script will not run as-is on a QBCore server.

Is the folder nested?

The most common mistake with scripts extracted from an archive is a doubled folder: resources/bizim_script/bizim_script/fxmanifest.lua. The manifest file must sit directly inside the folder you ensure. Archives downloaded from GitHub may come with a folder name like ox_lib-main; that name will not match dependency declarations, so rename the folder to ox_lib.

Step 2: Organize the resources folder

Folders in square brackets (such as [esx] or [jobs]) are category folders to FiveM; they are not resources and only keep things organized. FXServer finds the resources inside them automatically. Our recommended layout:

server-data/
├── server.cfg
└── resources/
    ├── [standalone]/
    │   ├── oxmysql/
    │   └── ox_lib/
    ├── [framework]/
    │   └── es_extended/
    ├── [core]/
    │   ├── ox_inventory/
    │   └── ox_target/
    ├── [jobs]/
    │   └── bizim_script/
    └── [maps]/
        └── ornek_mlo/

Rules to follow:

  • Resource names must be unique across the server; folders with the same name in two different categories cause a conflict.
  • Do not use spaces or non-ASCII characters (such as Turkish letters) in folder names; lowercase letters and underscores are the safest choice.
  • In server.cfg you write the resource's own folder name, not the category name.

Uploading files to the server

You can move the script folder to the server in two ways: your server's file manager or an FTP/SFTP client. Whichever you use, follow this order:

  1. Extract the archive on your own computer first and check the folder structure; extracting on the server hides the nested-folder mistake.
  2. Upload the folder into the right category folder (such as [jobs] or [core]).
  3. When the upload finishes, compare file count and size; an incomplete transfer comes back as a missing-file error.
  4. For packs that include a stream folder (stream/), make sure file names were not changed.

Remember that file names are case-sensitive on Linux servers: if the manifest says Client/main.lua and you upload the folder as client, a script that works on Windows will not load on Linux.

Step 3: Add ensure lines in dependency order

FXServer starts resources in the order they appear in server.cfg. If a script tries to use an export from a resource that has not started yet, you get errors like "No such export." Build the order with this logic:

  1. Database connector (oxmysql)
  2. Shared libraries (ox_lib)
  3. Framework (es_extended, qb-core or qbx_core)
  4. The framework's core modules (inventory, targeting, phone)
  5. Job and feature scripts
  6. Stream packs such as maps, vehicles and clothing
# 1-2: Infrastructure
ensure oxmysql
ensure ox_lib

# 3: Framework
ensure es_extended

# 4: Core modules
ensure ox_target
ensure ox_inventory

# 5: Scripts
ensure bizim_script

# 6: Stream packs
ensure ornek_mlo

For what every line means, see the FiveM server.cfg settings explained line by line guide.

Step 4: Import the SQL file

Most scripts that store data come with a .sql setup file. This file creates the tables the script needs. Always take a backup before importing:

# Take a backup
mysqldump -u fivem -p fivem_db > yedek_$(date +%F).sql

# Import the SQL file (put the path with square brackets in quotes)
mysql -u fivem -p fivem_db < "/home/fivem/server-data/resources/[jobs]/bizim_script/install.sql"

If you use HeidiSQL or phpMyAdmin instead of the command line: select the database, open the file with the "Run SQL file" or "Import" option, and run it. Things to watch during import:

  • Pick the right database. Import into whichever database the mysql_connection_string in server.cfg points to.
  • Check framework compatibility. ESX scripts usually use the users table, QBCore scripts the players table. SQL written for the wrong framework will throw errors.
  • A "Table already exists" error means the table is already there; do not blindly run the file a second time. If a column is missing, add only that column.

If you have not set up the database connection yet, follow the oxmysql and MariaDB setup guide first.

Step 5: Start the script without stopping the server

After uploading the files and importing the SQL, you do not need to restart the server. In the txAdmin console or the server console, run:

refresh
ensure bizim_script

The refresh command makes FXServer rescan the resources folder; a newly added folder is only recognized after that. Once the script starts, check the console for red error lines. It is always safer to try a new script on a test server first, not on your live server.

Editing the config file and translations

Most scripts ship with a config.lua file that lets you change their behavior: prices, locations, job names, and which inventory or targeting system they use. The settings you will change most often:

  • Framework choice: scripts that support more than one framework have a setting like Config.Framework; it must match your server.
  • Language: if there is a setting like Config.Locale and the script does not include your language, copy the English file in the locales folder and translate it under a new name (for example, tr.lua for Turkish).
  • Integrations: inventory, targeting and notification settings must match the resource names installed on your server exactly.

After changing the config file, just restart the script with ensure bizim_script.

Safe installation habits

  • Test server first: try a new script in a separate test environment before adding it to your live server. A broken script can stop the whole server from starting.
  • Take backups: do not add a major script without a backup of both the database and the resources folder.
  • Escrow scripts: encrypted scripts protected with Cfx.re Asset Escrow only run with the license key tied to the Cfx.re account they were purchased on. If the key belongs to another account, the script will not start.
  • Trusted sources: leaked scripts from unknown sources may contain backdoors; download only from the developer or official stores.

Script not working? Quick checklist

Console messageLikely causeFix
Couldn't find resourceFolder name does not match the ensure line, or the folder is nestedFix the folder name and manifest location, then run refresh
Could not find dependencyThe required resource is missing or has a different nameInstall the dependency and remove -main suffixes
No such exportThe dependency starts after the scriptFix the ensure order
Table doesn't existSQL not imported, or imported into the wrong databaseImport the SQL file into the correct database

For more detailed error scenarios, see the FiveM "Couldn't Start Resource" errors guide.

Next step: a server that can handle your scripts

Every new script costs RAM and CPU time; on a roleplay server running more than 100 resources, small plans run out of room quickly. The OB-FIVEM-3 FiveM server, with 4 CPUs, 6 GB DDR5 RAM and a 60 GB NVMe disk, gives you a starting point that can carry a framework, an inventory and dozens of job scripts at once. If you are planning a bigger script list, compare all FiveM server plans. OyunBulut's FiveM servers are hosted in Istanbul, come with DDoS protection, and are delivered as an auto-installed FiveM plan; after setup, you can start adding your scripts right away using the steps in this guide.

Frequently asked questions

What is the difference between ensure and start in FiveM?

start only starts a stopped resource. ensure starts a resource if it is stopped and restarts it if it is running, which is why ensure is more practical in server.cfg and the console.

Do I need to add the square-bracket folder to server.cfg?

No. Square-bracket folders like [jobs] are category folders used only for organization. In server.cfg you add an ensure line with the folder name of each resource inside them.

I installed a script but nothing happens in game. Why?

First check the console to see whether the script started and whether there are red errors. The most common causes are a wrong folder name, a missing dependency, an SQL file that was not imported, and a script written for a different framework.

Will a script with __resource.lua instead of fxmanifest.lua work?

__resource.lua is the old manifest format and is not used in new scripts. Scripts like this are usually very old; if possible, find an updated version or convert the manifest to the fxmanifest.lua format.

Do I need to restart the server to add a script?

No. After uploading the files, run refresh and then ensure script_name in the console. To make it permanent, remember to add the ensure line to server.cfg as well.

For this guide

Recommended plans

The OB-FIVEM-3 plan's 4 CPUs and 6 GB DDR5 RAM give you room to apply the layout in this guide comfortably while running a framework and dozens of scripts at once.

OB-FIVEM-3

Recommended

6 GB DDR5 RAM

$15.73/mo

+VAT

  • Processor4 CPU
  • Disk60 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

2 GB DDR5 RAM

$7.86/mo

+VAT

  • Processor2 CPU
  • Disk40 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

4 GB DDR5 RAM

$11.01/mo

+VAT

  • Processor2 CPU
  • Disk50 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

FiveM — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.