Skip to content
FIVECRATE
Frameworks beginner

How to Give Yourself Admin on QBCore, Qbox and ESX

How to give yourself admin on QBCore, Qbox and ESX Legacy: the add_principal lines, setgroup, /addpermission and /optin, plus fixes for Access denied errors.

Gold access card with a shield emblem on a desk in a server room at night
Author: FiveCrate
Published:
Updated:
Read time: 19 min
Applies to
FiveM Legacy and FiveM for GTAV Enhanced; qbx_core v1.24.1 (2026-10-30), ESX Legacy release 1.16.4 (2026-10-18), qb-core repository as of 2026-08-24; txAdmin recipes as read on 2026-11-20
Last verified

Direct Answer

To give yourself admin on QBCore, Qbox or ESX, add yourself to the framework’s top staff group. On Qbox, add add_principal identifier.fivem:1234567 group.admin to permissions.cfg, restart the server and type /optin in the chat. On QBCore, add add_principal identifier.license:xxxxxx qbcore.god to server.cfg and restart. On ESX Legacy, join the server, then type setgroup 1 admin in the txAdmin Live Console, where 1 is your server ID. The identifiers shown are the placeholders from each framework’s docs, so use your own. If you deployed the server from a txAdmin recipe, the identifiers of your txAdmin account are already in group.admin.

How admin rights work on Qbox, QBCore and ESX

All three frameworks build on the access control list (ACL) inside FXServer. One console command does most of the work. The Cfx.re command reference writes it as add_principal [child_principal] [parent_principal], and its example, add_principal identifier.steam:110000112345678 group.admin, makes one player’s identifier inherit from group.admin.

A line in a config file runs again at every server start. The same command typed into the server console while the server is running is not saved anywhere: the Cfx.re cookbook note on the ACL says it can be configured at runtime and that there is “no persistence layer at all”. Permanent staff therefore belong in the file.

Each framework decides which group counts as staff:

QboxQBCoreESX Legacy
Top staff groupgroup.adminqbcore.godadmin
Where your rank is keptpermissions.cfgserver.cfgThe group column of the users database table
How you get itAn add_principal lineAn add_principal lineThe setgroup command
Extra step/optin in the chatNoneNone
Lower ranksgroup.mod, group.supportqbcore.admin, qbcore.modGroups you list in Config.CommandPermissions

The versions read for this guide are qbx_core v1.24.1 (October 30, 2026), ESX release 1.16.4 (October 18, 2026) and the qb-core repository as of August 24, 2026.

Two kinds of command appear below. The Qbox docs separate them in two sentences: “Server commands don’t start with a /. Commands with a / are chat commands that you type in game.” Server commands go into the server console, which in txAdmin is the Live Console page in the left menu.

For principals, objects and deny rules in general, read the FiveM ACE permissions guide. This page stays with the framework steps.

Find your identifier and your server ID

You need one of two values: your identifier (Qbox and QBCore) or your current server ID (ESX).

Identifier. The Qbox docs give the route through txAdmin: ask the player to join the server once, “then in txAdmin open Players, click their name and open the IDs tab”. The QBCore docs add that a player who is currently connected shows all available identifiers there.

  • Principal form. Write identifier. in front of the identifier, as in the docs examples identifier.fivem:1234567 and identifier.license:xxxxxx.
  • Which one to use. The Qbox docs prefer the fivem: identifier when the player has one, because “it belongs to their Cfx.re account, so it stays the same on every PC”. The QBCore docs list FiveM ID, Rockstar license and Discord ID, and mark the Rockstar license as “what qbcore uses”.
  • Steam. The Cfx.re docs state that steam_webApiKey has had no effect since November 4, 2026, and that players who have linked a Steam account to their Cfx account have the steam: identifier. Before you build admin lines on identifier.steam:, read the Steam identifier guide.

Server ID. This is the number a player holds for the current session.

  • Qbox: the chat command /id is listed as “Check your server ID”.
  • ESX: the players command “prints the ID, RP Name, Group and Identifier of all players”, and the es_extended source allows it from the console.
  • Any server that runs the rconlog resource: per the Cfx.re docs, status “Shows a list of players with their primary identifier, server ID, name, endpoint, and ping.”

What a txAdmin recipe already set up for you

The Qbox, ESX Legacy and QBCore recipe files all contain the placeholder {{addPrincipalsMaster}}. When the txAdmin deployer runs, it replaces the placeholder with one line for each identifier saved on the txAdmin account that runs the deployment. Each line has the form add_principal identifier.<identifier> group.admin #<account name>.

Open server.cfg and look for those lines. They also show you your own identifiers. If the account had none, the deployer writes a comment instead, beginning # Deployer Note: this admin master has no identifiers to be automatically added.

What that membership gives you depends on the framework:

FrameworkWhat the recipe grants group.adminResult for the deploying account
QboxEvery command and the admin objectAdmin after /optin. The Qbox docs: “The txAdmin account you used to deploy the recipe is already in group.admin.”
ESX LegacyEvery command except quitESX registers its commands as restricted commands, so they work for you at once. A character you create from then on is stored with the admin group
QBCoreEvery commandThe framework ranks sit on qbcore.god, covered below

If you ran the deployer yourself, test an admin command before you edit anything. The txAdmin recipe guide covers the deployer itself.

Qbox: make yourself admin with group.admin

The Qbox recipe’s server.cfg loads a second file with exec permissions.cfg. The Qbox docs describe the three groups defined in it:

Qbox groupGetsUse it for
group.adminEverythingOwners and head admins
group.modModerator and support permissionsModerators
group.supportSupport permissionsSupport staff
  1. Open permissions.cfg. It sits next to server.cfg in the server data folder. To find that folder, the Qbox docs say to open txAdmin, go to Settings, then FXServer, and look at Server Data Folder.
  2. Add your identifier at the bottom. This is the line from the Qbox docs. Replace fivem:1234567 with your own identifier:
add_principal identifier.fivem:1234567 group.admin
  1. Restart the server.
  2. Join and type /optin in the chat. Per the Qbox docs, qbx_core’s admin commands, “such as /setjob and /givemoney, only work after an admin types /optin in the chat once”. Until then the core answers “You are not opted in for admin duty. (/optin to toggle)”. The command is a toggle: its reply is “You have successfully opted in for admin duty.” or the same sentence with “out”.
  3. Try an admin command. /tpm is a quick one: the Qbox command reference lists it as “TP To Marker (Admin Only)”.

To switch the opt-in step off, the docs say to open qbx_core/config/server.lua, find requireOptIn and set it to false.

/addpermission on Qbox: what it really does

The Qbox command reference lists /addpermission with the example /addpermission 23 god. Four details from the docs and the qbx_core source matter before you rely on it:

  • It is the old route. The docs mark the function behind it “Deprecated as of v1.8.0. Use ox_lib ACE permissions instead”, and the source comment reads “use cfg ACEs instead”. Version v1.8.0 was published on March 11, 2024.
  • It is tied to the server ID. The function adds the principal player.<server ID> to group.<permission> and writes nothing to permissions.cfg. A player who reconnects under a different server ID no longer has the rank, and a server restart clears it in any case.
  • The help text says God Only. It reads “Give Player Permissions (God Only)”, while the docs and the source restrict the command to group.admin.
  • god needs a group you create. The Qbox docs say QBCore scripts with god-only commands need a group.god, “which permissions.cfg doesn’t have yet”.

The docs give these three lines for permissions.cfg. The last one puts a player into the new group:

add_ace group.god god allow
add_principal group.god group.admin
add_principal identifier.fivem:1234567 group.god

QBCore: give yourself admin with add_principal and qbcore.god

QBCore’s docs now state that “QBCore has withdrawn from other platforms” and that the existing pages “remain here as a reference”. On October 29, 2026 the QBCore recipe was removed from txAdmin’s recipe lists. The steps below are for servers that already run QBCore. If you are choosing a framework today, read QBCore vs ESX vs Qbox first.

On November 20, 2026 the QBCore recipe’s server.cfg ended with this block:

## Permissions
add_ace group.admin command allow # allow all commands
{{addPrincipalsMaster}}

add_ace resource.qb-core command allow # Allow qb-core to execute commands
add_ace qbcore.god command allow # Allow all commands
add_principal qbcore.god group.admin # Allow gods access to the main admin group used to get all default permissions
add_principal qbcore.god qbcore.admin # Allow gods access to admin commands
add_principal qbcore.admin qbcore.mod # Allow admins access to mod commands
  1. Open server.cfg and find the block. In txAdmin, use CFG Editor in the server menu.
  2. Add a player line below it. The QBCore docs show one line per rank. Keep the line for the rank you want and replace license:xxxxxx with the real identifier:
# Players
add_principal identifier.license:xxxxxx qbcore.god # Player Name
add_principal identifier.license:xxxxxx qbcore.admin # Player Name
add_principal identifier.license:xxxxxx qbcore.mod # Player Name
  1. Restart the server.
  2. Test it in game. Type /admin in the chat. That is the command the QBCore docs use to open the admin menu, and qb-adminmenu registers it for the admin rank.
PrincipalWhat it holds
qbcore.godEvery command, plus everything group.admin, qbcore.admin and qbcore.mod hold
qbcore.adminThe commands registered for admin, plus everything qbcore.mod holds
qbcore.modThe commands registered for mod

For a rank of your own, the QBCore docs add its name to the permissions list in qb-core/config.lua, with leo as their example, and then put players into qbcore.leo. The docs call that setting QBConfig.Server.Permissions. In the current source it is named QBCore.Config.Server.Permissions.

qbcore.god or group.admin?

The QBCore docs say “qbcore.god and group.admin share the same permissions you can use either one.” The qb-core source shows a difference:

  • The inheritance runs one way. In add_principal qbcore.god group.admin, the child is qbcore.god. It inherits from group.admin, not the reverse.
  • The ranks are separate objects. On start, qb-core gives each qbcore. principal an object named after its rank: god, admin or mod.
  • Scripts test those objects. QBCore.Functions.HasPermission passes the rank name to IsPlayerAceAllowed.

A player who is only in group.admin passes every command check, but not a script check for admin or god. QBCore’s own qb-adminmenu accepts both, because its checks read HasPermission or IsPlayerAceAllowed(src, 'command'). A script that tests the rank alone does not. For your own account, qbcore.god covers both cases.

/addpermission and the admin menu on QBCore

The QBCore docs give two in-game routes for use “While you have permissions”. The command itself is registered for the god rank.

  • Command: /addpermission [id] [addpermissions], for example /addpermission 1 god.
  • Admin menu: type /admin, open the “Player Management” tab, select the player, find “Permissions”, set the user group and press “submit”.

Both end in the same qb-core function, which runs add_principal player.<server ID> qbcore.<rank>. As on Qbox, the rank is attached to the server ID and is not written to any file. Use the server.cfg line for permanent staff.

ESX Legacy: make yourself admin with setgroup

ESX keeps each character’s permission group in the database: the users table has a group column whose default is user. When the character loads, es_extended itself runs add_principal identifier.<license> group.<group>, so you never write that line by hand.

The ESX command reference gives /setgroup two arguments, PlayerId and Group, and the example /setgroup 1 admin.

  1. Join the server and load your character. The target must be online. Otherwise the command answers “Specified Player is not online”.
  2. Find your server ID. Type players in the txAdmin Live Console. Each line of the answer shows a player’s ID, name, group and identifier.
  3. Run the command in the Live Console, with your ID in place of 1:
setgroup 1 admin
  1. Check the result. In game, /group “Shows the permissions group you are in.” The source answers with a server-side print, so on FiveM for GTAV Enhanced the reply may not reach your screen. The players console command shows the group as well.

The es_extended source registers setgroup as a command the console may run, which is why this works before any admin exists. After that you can use /setgroup in game, where the source accepts me in place of your own ID. The group is saved to the users table with the rest of the character, so it survives restarts.

superadmin is not a valid ESX group

The ESX docs put it in one note: “superadmin is NOT a valid group. admin is the highest group by default.” The source enforces it. Both /setgroup and the character loader replace superadmin with admin and print a console warning that reads “Superadmin detected, setting group to admin” once its colour codes are removed.

Config.CommandPermissions, admin and owner

Config.CommandPermissions, in shared/config/main.lua of es_extended, lists the groups that may run each command. For every group on a command’s list, ESX runs add_ace group.<group> command.<name> allow. A command with no entry is restricted to admin, and the console prints a warning about it.

In release 1.16.4 the admin commands list two groups, for example ["setgroup"] = { "owner", "admin" }. The docs page calls admin the highest group by default, and the recipe’s server.cfg has no line for group.owner. Use admin unless you have set up owner yourself.

Three ESX details that catch owners out

  • Recipe owners are admin from the first character. When a character is created by a player who is already allowed the command object, ESX stores it with the admin group. The console prints an info line saying the player “Has been granted admin permissions via Ace Perms” (colour codes removed).
  • sv_lan true makes ESX treat everyone as admin. The same check returns true while the sv_lan convar is true. Characters created on a LAN test server are therefore stored as admin. Look through the group column before you open that database to the public.
  • Every character has its own group. With esx_multicharacter, identifiers are saved as char#:identifier, one row per character, and group belongs to the row. The ACL principal is still the license, which all of a player’s characters share.

Make yourself admin with HeidiSQL: the database method

Only ESX reads the rank from the database.

  • ESX Legacy. While your character is not loaded, open the users table in HeidiSQL or phpMyAdmin, find your row by identifier and change group from user to admin. The identifier value is your identifier without its type in front. By default that is the Rockstar license, so license: is cut off. With esx_multicharacter, edit the row of the character you play, saved as char#:identifier. On your next join ESX reads the column and adds you to group.admin. A value changed while the character is loaded is overwritten: the save query writes group back with the rest of the row.
  • QBCore. In a 2021 thread on the Cfx.re forum, an owner tries to become admin through a permissions table in the database, and a later reply says QBCore no longer supports the database method. The current qbcore.sql creates three tables, players, bans and player_contacts, and the rank functions work on ACL principals. Use the server.cfg line.
  • Qbox. Staff groups are defined in permissions.cfg. The player_groups table in the Qbox database holds jobs and gangs, not staff ranks.

To connect HeidiSQL to your server’s database, see the database setup guide.

Remove an admin again

FrameworkPermanent rankRank given in game
QboxDelete the player’s line in permissions.cfg and restart/removepermission, docs example /removepermission 23 god
QBCoreDelete the player’s line in server.cfg and restart/removepermission with the ID and the rank
ESX Legacysetgroup with the player’s ID and the group user, while the player is onlineThe same command

To drop a config-file rank without a restart, also type the removal in the Live Console. The Cfx.re docs example is remove_principal identifier.steam:110000112345678 group.admin.

A rank given with /addpermission also disappears at the next server restart, because nothing stores it.

On ESX, demote with setgroup, not with a database edit alone. In es_extended release 1.16.4 the only remove_principal call sits in the function behind setgroup. If you change group back to user in the users table instead, the group.admin membership that ESX added when the admin character loaded stays in the ACL. Restart the server after such an edit.

FiveM Legacy and FiveM for GTAV Enhanced

The recipe files are the same on both platforms. txAdmin’s recipe list for Enhanced offers ESX Legacy and Qbox from the same recipe addresses as the Legacy list, and QBCore is on neither list. The deployer code that fills in {{addPrincipalsMaster}} reads the same on txAdmin’s Legacy and Enhanced branches. Two documented platform differences matter for admins:

  • The refusal message. In the FiveM Legacy server source, the text a command prints is sent back to the player who ran it, and the chat resource shows it. That is how “Access denied for command” reaches the chat. For Enhanced, the docs list a breaking change: “Remote commands no longer return the full log to the client”. A player whose command is refused there may see nothing, so check from the server console. The wording of the message comes from the public citizenfx/fivem repository, whose README describes that code as FiveM for Grand Theft Auto V Legacy, RedM and FXServer, so read it as the FiveM Legacy behaviour.
  • Server IDs. On Legacy, IDs “are only ever incremented and never reused for the next player”. On Enhanced, “an ID is released when a player disconnects and can be reused by the next player who connects”. A rank given with /addpermission sits on player.<server ID>. In both cores it is taken away only by the RemovePermission function, and the cores themselves call that only from /removepermission. On Enhanced, remove such a rank before the player leaves, or it can pass to the next player who receives that ID. Keep permanent staff in the config file.

Troubleshooting

“Access denied for command” after you made yourself admin

The FXServer source prints Access denied for command <name>. when the check of the object command.<name> fails, which means none of your principals passed it. On FiveM for GTAV Enhanced the player may not see the message at all, as the platform section above explains. Check these in order:

  1. The identifier. It must match the IDs tab exactly, with its type in front (fivem:, license:) and identifier. before that.
  2. The file. The line must be in a file the server runs: server.cfg, or on Qbox the permissions.cfg it loads with exec permissions.cfg. Restart afterwards.
  3. The group. group.admin on Qbox, qbcore.god on QBCore. On ESX, check your group with /group.
  4. The ACL itself. In the Live Console, run test_ace with your principal and the object. The Cfx.re docs example is test_ace group.admin command.adminstuff. Put your own principal, such as identifier.fivem:1234567, in place of group.admin, and command. plus the name of the refused command in place of the object. The answer has the form <principal> -> <object> = true or = false.

The ACE permissions guide explains the deeper checks with se_debug.

Qbox says “You are not opted in for admin duty. (/optin to toggle)”

You are in group.admin, but you have not opted in on this character. Type /optin in the chat, or set requireOptIn to false in qbx_core/config/server.lua.

If /optin answers “You have successfully opted out for admin duty.” every time, check that permissions.cfg still contains add_ace group.admin admin allow. The opt-in functions in qbx_core test the admin object, and without it the toggle changes nothing.

QBCore: you are in group.admin but a script says you are not an admin

The script tests the QBCore rank, and group.admin does not inherit it. Add your identifier to qbcore.god and restart.

ESX: /setgroup with superadmin does not give superadmin

The ESX docs say superadmin is not a valid group. The command stores admin instead and warns in the console.

/setgroup or /addpermission runs, but the rank does not apply

The framework’s resources need their own permission to run ACL commands. The Cfx.re cookbook marks such lines as “required for access to ExecuteCommand”. Each recipe ships them, so copy them back if your server.cfg lost them:

FrameworkLines in the recipe
ESX Legacyadd_ace resource.es_extended command.add_principal allow, with matching lines for command.add_ace and command.remove_principal
QBCoreadd_ace resource.qb-core command allow
Qboxadd_ace resource.qbx_core command allow, plus four resource.ox_lib lines for command.add_ace, command.remove_ace, command.add_principal and command.remove_principal

Your admin rank is gone after a restart or a reconnect

It was given with /addpermission, or typed into the console. Both live in memory only, and /addpermission is bound to one server ID. Put the add_principal line in the config file.

You are an admin in txAdmin but not in the game

txAdmin has a permission system of its own. Its docs say those permissions “are saved in the txData/admins.json file and can be edited through the Admin Manager page”. The deployer writes group.admin lines once, for the account that runs it. Every admin added later needs a line or a setgroup as shown above. For panel sign-in problems, see the txAdmin login guide.

An identifier.steam admin line stopped working

The line only matches a player who has a steam: identifier. For servers that rely on Steam identifiers in ACE permissions, the Cfx.re docs say to set sv_enforceSteamAuth to true, which requires server version 38004 or later. The other route is to move the line to the fivem: or license: identifier.

ESX: the group you set in the database went back to user

The row was edited while the character was loaded, and the next save wrote the old group back. Disconnect first, or use setgroup.

Next Steps

Official documentation and repository references