Tutorial

How to Install Scripts on Your FiveM Server (Step-by-Step Guide)

ThaC

Installing a script on a FiveM server sounds straightforward until something breaks and you have no idea why. A missing dependency, a typo in server.cfg, a database table that never got imported — any one of these silently kills a script and leaves you staring at a blank console.

This guide walks you through the complete installation process from start to finish, including the parts most tutorials skip.


How FiveM Scripts Actually Work

Before installing anything, it helps to understand what you're actually doing. FiveM runs on a resource system. Every script — whether it's a HUD, a job system, or a billing interface — is a resource. A resource is a folder containing Lua files, NUI files (HTML, CSS, JavaScript), and a manifest file called fxmanifest.lua that tells the server what to load and in what order.

When you add ensure scriptname to your server.cfg, you're telling the server to start that resource when it boots. The server reads the manifest, loads the files, and makes the script available to connected clients.

This is why installation order matters. If Script B depends on Script A being loaded first, Script B needs to come after Script A in your server.cfg. Getting this wrong is one of the most common causes of scripts that "don't work" right after install.


What You Need Before Installing Any Script

Before you touch a new script, make sure you have the following in place.

FTP or direct file access to your server. You need to be able to upload files to your resources folder. Most VPS setups use SFTP via a tool like FileZilla or WinSCP. Panel-based hosting usually has a built-in file manager.

Access to your server.cfg. This is typically in your main server folder, one level above your resources directory.

A running database if the script requires one. Scripts that store persistent data — player stats, billing records, MDT entries — need MySQL. If you don't have oxmysql set up already, do that first.

The script files. Download from CFX Portal. Make sure you're downloading the correct script.


Step 1: Read the Documentation First

This sounds obvious but most installation errors are preventable by reading the README or documentation before doing anything else. Look for:

  • Required dependencies (other scripts this one needs to run)

  • Framework version compatibility (ESX Legacy, QBCore, etc.)

  • SQL files that need to be imported

  • Config options that must be set before first launch

  • Any known conflicts with other popular scripts

If the script has no documentation at all, that's a warning sign. At minimum there should be a README with installation steps and a list of dependencies.

Step 2: Upload the Resource Folder

Take the downloaded script folder and upload it to your server's resources directory. The exact path varies by hosting setup but is typically:

/server-data/resources/[scripts]/yourscriptname

Or on some setups:

/resources/[local]/yourscriptname

The folder name matters — whatever you name the folder is what you'll reference in server.cfg. Keep it lowercase with no spaces. Use hyphens instead of underscores if you want, but be consistent.

Inside the folder you should see an fxmanifest.lua file. If it's not there, the resource won't load. Some scripts ship as a zip with a nested folder inside — make sure you're uploading the correct inner folder, not a wrapper directory.

Step 3: Import the SQL File (If Required)

If the script includes a .sql file, you need to import it into your MySQL database before starting the server. This creates the tables the script needs to store data.

Open your database management tool — phpMyAdmin, HeidiSQL, TablePlus, or whatever you use — select your FiveM database, and run the SQL file. Most tools have an import button that lets you upload the file directly.

If you skip this step and the script requires database tables, it will either crash on startup or silently fail when it tries to write data. Always import SQL files before the first launch.

Some scripts add columns to existing tables rather than creating new ones. Read the SQL file before running it so you know what it's modifying — especially on an existing server with player data you don't want to accidentally overwrite.

Step 4: Configure the Script

Open the config file — usually named config.lua or shared/config.lua inside the resource folder. This is where you set your framework, adjust features, and connect the script to your server's specific setup.

Common things to set in a config file:

Framework — most scripts ask you to set this to 'esx' or 'qbcore'. Set it to match your server exactly.

Database table names — if your server uses non-standard table names for players or items, update these to match.

Job names — scripts that check player jobs need to know the exact job names you've configured in your framework. 'police' and 'leo' are not the same thing.

Permissions — admin-level features usually have a permission group setting. Make sure it matches your server's permission system.

Read every option in the config before saving. A misconfigured option is harder to debug than a missing one because the script loads fine but behaves incorrectly.

Step 5: Add to server.cfg

Open your server.cfg and add an ensure line for the new script:

ensure yourscriptname

Order matters here. Dependencies must be ensured before the scripts that depend on them. A typical order looks like this:

ensure oxmysql

ensure es_extended

ensure ox_inventory

ensure codem-chat

ensure codem-billing

ensure yourscriptname

If you're not sure where in the order a script belongs, put it after your framework and core dependencies, and before any scripts that might depend on it.

Never add a script to server.cfg before its SQL file is imported and its config is set. Starting the server with an unconfigured script is a common cause of hard-to-trace errors.

Step 6: Start the Server and Check the Console

Restart your server and watch the console output carefully during startup. A working script loads silently or prints a success message. A broken script prints an error.

Common console errors and what they mean:

"Could not find resource [name]" — the folder name in server.cfg doesn't match the actual folder name on disk. Check both for typos and case sensitivity.

"Failed to load script" — there's a Lua syntax error in the script. This usually means a misconfigured config file or a corrupted download. Re-download and try again.

"Database connection error" or missing table errors — the SQL file wasn't imported, or your database connection string in server.cfg is wrong.

"Dependency [name] not started" — a required resource isn't running. Check that its ensure line is in server.cfg and that it's loading without errors itself.

If the console is clean and the script doesn't appear in your resmon, double-check the ensure line and the folder structure.

Step 7: Test In-Game

Join your server and test the script's core functionality before declaring it working. Don't just check that it loads — verify it actually does what it's supposed to do.

Open your resource monitor with resmon in the F8 console and find your new script. Note its client ms reading at idle. A well-written script should sit at 0.00 to 0.02ms under normal conditions. Anything consistently above 0.05ms at idle is worth investigating.

Test edge cases too: what happens when a player disconnects mid-interaction, when two players use the script simultaneously, or when the server restarts with active sessions. These are the scenarios where poorly written scripts expose bugs.

Troubleshooting: When Nothing Works

If a script installs cleanly but doesn't function correctly in-game, work through this list before posting in a support channel.

Check the client console. Press F8 in-game and look for red errors. Client-side errors are separate from server console errors and are often the actual source of the problem.

Check framework compatibility again. If you're on QBCore and the script has an ESX config option set, that's your problem. Read the config line by line.

Check job and permission names. If a feature isn't accessible, the most common reason is a job name mismatch between the script config and your framework's job table.

Disable other scripts temporarily. If you added multiple scripts at once, isolate the issue by disabling everything new except the one you're testing.

Re-download the script. Corrupted or incomplete downloads cause strange, hard-to-diagnose errors. If everything looks correct and nothing works, try a fresh download before going deeper.

Installing Commercial Scripts from Tebex

Scripts purchased through Tebex — including most professional FiveM scripts — may use Cfx.re's escrow system. Escrow scripts are encrypted and tied to your server's license key. They will not run on a server with a different license key, and they cannot be moved to a new server without the developer's involvement.

When you download an escrow script from Tebex, you'll get an encrypted resource folder. The installation process is identical to a regular script — upload, SQL import if needed, configure, ensure in server.cfg — but you cannot read or modify the Lua files directly. All customization happens through the config file.

Make sure your server's license key in server.cfg matches the key registered on keymaster.fivem.net. If the keys don't match, escrow scripts will refuse to load.

If you're installing scripts from CodeM, each product page links to its GitBook documentation with full installation instructions, config references, and framework-specific setup notes. Read those before starting — they cover the specific quirks of each script.

Keeping Scripts Updated

Scripts need updating when FiveM updates its game build, when your framework releases a new version, or when the developer patches a bug. Most commercial script developers announce updates in their Discord server.

When updating a script, don't just overwrite the entire folder — you'll lose your config file. Instead, download the new version, copy your existing config into the new folder, and then replace the old resource with the new one. Some scripts include a migration SQL file for database changes — run those before restarting.

Keep a local backup of every script's config file. Losing a carefully tuned config to a bad update is avoidable and annoying.

FAQ

Do I need to restart the whole server to install a new script? Yes, for the initial installation. Once a script is running, you can use the refresh and restart commands in the server console to reload it without a full restart — but the first time it needs to be in server.cfg before the server boots.

Can I install scripts while players are online? You can use ensure scriptname in the live console to start a resource without a full restart. This works for simple scripts. Scripts with SQL dependencies or complex initialization should be installed during downtime.

Why does my script work in single player but not on the server? Single player testing doesn't load your framework or other dependencies. A script that runs fine alone may fail when it tries to call framework functions that aren't available. Always test on your actual server environment.

What's the difference between client-side and server-side scripts? Server-side scripts run on the server and handle data, permissions, and logic. Client-side scripts run on each player's machine and handle UI and visual elements. Most FiveM scripts have both components. Errors in one won't always show up in the other's console — check both when troubleshooting.

How do I know if a script is causing performance issues? Open resmon in the F8 console and look for any resource consistently above 0.05ms client-side or 0.1ms server-side at idle. Those are your performance bottlenecks.

Video Demonstration

If you want to follow the advanced guide for installing a script on your server check out CodeM's Installation Guide Video for beginners.