Install ox_lib on FiveM: start order and errors (2026)

Install ox_lib with cfxlua-require: the right start order, the add_ace lines, language convars, updating and the 'ox_lib must be started' error.

EliteStarHosting Team4 December 20265 min read
FiveM server hosting from €5 a month: view the plans

ox_lib is the shared library by Overextended that a large part of the FiveM scripts build on: ox_inventory, ox_target, ox_doorlock, Qbox (qbx_core) and many paid scripts. It provides menus, notifications, progress bars and the lib functions for Lua. Without ox_lib those scripts don't start. In December 2026, ox_lib 3.43.0 is the newest version, with documentation by Overextended.

Did you set up your server with the ESX Legacy or Qbox recipe in txAdmin? Then ox_lib is already installed. Read on for the settings, updates and error messages.

Before you start

  • OneSync: ox_lib only starts with OneSync on. txAdmin turns it on by default.
  • The release, not the source code: download ox_lib.zip from the newest release on GitHub. The green Code button and Source code give you files without the built interface.
  • Two folders: since version 3.41 (October 2026) the zip contains ox_lib and cfxlua-require. ox_lib needs both.

Installing ox_lib

  1. Make a backup of your server.
  2. Download ox_lib.zip from the newest release.
  3. In the game panel, open Files, go to resources and create a folder [ox] with Create Directory (or use the folder where your other ox scripts are).
  4. Upload ox_lib.zip in that folder with Upload. Click the three dots ..., choose Unarchive and delete the .zip file. You now have [ox]/ox_lib and [ox]/cfxlua-require, each with an fxmanifest.lua directly inside.
  5. Go to server.cfg editor, click Manual Edit and add the lines below. Click Save and restart your server.
add_ace resource.ox_lib command.add_ace allow
add_ace resource.ox_lib command.remove_ace allow
add_ace resource.ox_lib command.add_principal allow
add_ace resource.ox_lib command.remove_principal allow

ensure oxmysql
ensure ox_lib
# below this: your framework and every script that uses ox_lib

You don't need an ensure line for cfxlua-require. ox_lib asks for it under the name require, and FXServer starts it by itself. See Install scripts and edit your server.cfg for the basics of ensure.

The server.cfg editor with the Manual Edit and Save buttons

Why the add_ace lines?

ox_lib hands out permissions for other scripts. /doorlock from ox_doorlock, for example, is given to group.admin that way, and Renewed-Weathersync does the same for its weather and time commands. Without the four add_ace lines your console shows Access denied for command add_ace and admin commands may not work. With Qbox they are already in permissions.cfg.

No server yet? With our FiveM server hosting you install ESX Legacy or Qbox with ox_lib in a few clicks through txAdmin, from €5 a month. You can also try one free for 24 hours.

Settings (convars)

You configure ox_lib with setr lines in your server.cfg (with Qbox in ox.cfg, next to your server.cfg), not in its files:

setr ox:locale "nl"
setr ox:userLocales 0
setr ox:primaryColor blue
setr ox:primaryShade 8
  • ox:locale: the language of ox_lib's own texts, such as nl, en or de. The language files are in ox_lib/locales. Scripts that use ox_lib's language system, such as ox_doorlock, follow this setting too, if they have a file for that language.
  • ox:userLocales: with 1 (the default) players choose their own language in the game with /ox_lib. With 0 everyone gets the language from ox:locale. /ox_lib also has the position and sound of notifications.
  • ox:primaryColor and ox:primaryShade: the accent colour of menus and buttons, a colour name like blue, red or green with a shade from 0 to 9.

Updating ox_lib

  1. Stop your server and make a backup.
  2. Delete the folders ox_lib and cfxlua-require (if you have it) and upload the contents of the new ox_lib.zip in the same place.
  3. Start your server.

Updating from 3.40 or older? Then cfxlua-require is new for you: forget that folder and ox_lib won't start. Since 3.42 ox_lib also checks that cfxlua-require is at least version 1.0.2, so always upload both folders from the same zip.

Restart your whole server after an update, not only ox_lib. When ox_lib stops, FXServer also stops every script that depends on it, and they don't start again by themselves.

ox_lib in your own script

Add ox_lib to the fxmanifest.lua of your script:

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

shared_script '@ox_lib/init.lua'
client_script 'client.lua'

Then you can use lib in client.lua, for example for a notification:

RegisterCommand('testlib', function()
    lib.notify({ title = 'Test', description = 'ox_lib works', type = 'success' })
end)

New to scripting? Start with your first FiveM script in Lua.

Error messages

  • ox_lib must be started before this resource.: a script loads ox_lib before ox_lib runs. Put ensure ox_lib above that script. Do you start a whole folder with something like ensure [standalone] and is ox_lib in it? Give ox_lib its own ensure ox_lib line above it. Also check that ox_lib itself started: the reason is higher up in the console.
  • Could not find dependency require for resource ox_lib.: the folder cfxlua-require is missing. Upload it from the same ox_lib.zip.
  • Could not find dependency ox_lib for resource ...: ox_lib isn't installed under exactly the name ox_lib. Often the folder is called ox_lib-main (source code) or there is an extra folder level (ox_lib/ox_lib).
  • Could not find dependency /onesync for resource ox_lib.: OneSync is off. Turn it back on in txAdmin's settings and restart.
  • Access denied for command add_ace: the four add_ace lines for resource.ox_lib are missing.
  • Menus and notifications don't show: you uploaded the source code. Use ox_lib.zip.
  • Found 2 unsafe convars values. (the number varies): since 3.43.0 ox_lib warns about server settings it finds unsafe, with the value it recommends. It is a warning, your server keeps running. Read what a setting does in the FiveM documentation before you change it: sv_stateBagStrictMode true, for example, blocks scripts that change state bags from the client. More in Advanced server.cfg settings.

After a fix, type refresh and ensure ox_lib in the Live Console of txAdmin, or simply restart your server. More common install steps are in ox_inventory and ox_target and Admins and permissions.

Your own server for this? FiveM server hosting from €5 a month.

Online within minutes, DDoS protection included, no contract.