doorlockox_doorlockqbcore11 min read · updated 9/11/2026

Setting up door locks on a FiveM server

Locked doors are what make a police station, a bank vault or a gang’s clubhouse feel like a place with rules. Door lock resources sync each door’s state across all players and decide who may open it — by job, grade, item or passcode. ox_doorlock and qb-doorlock are the two most common; the concepts carry over to any other.

Short answer: ox_doorlock lets staff create doors in game with the /doorlock command and stores them in the database, with access by groups (job and minimum grade), items, a passcode or lockpicking, plus auto-lock, double doors and gates. qb-doorlock defines doors in config files. In both, the door’s state is synced by the server, so everyone sees the same lock.

FiveM Door Locks: ox_doorlock and qb-doorlock Setup Guide

#How door locks work

A door in GTA V is an object with a model and a position. A door lock resource registers that door with the game’s door system, keeps its locked state on the server and tells every client whether it is locked. Opening it checks the player’s access on the server, then updates everyone.

#ox_doorlock

  1. Install ox_doorlock with its dependencies (ox_lib, oxmysql) and start it after them.
  2. Give staff the permission for its command (the command is restricted by ACE).
  3. In game, stand at the door and run /doorlock to open the creation interface.
  4. Select the door (or both leaves of a double door), set a name, and choose access: groups with minimum grades, items, a passcode.
  5. Set options such as auto-lock time, lockpicking and whether the door starts locked, then save.
OptionUse
GroupsJob or gang names with a minimum grade, e.g. police grade 0
ItemsKeycards or keys that open it
PasscodeA keypad code
LockpickWhether it can be picked, and how hard
Auto lockSeconds until it relocks by itself
Double / slidingPairs of doors and gates

#qb-doorlock

qb-doorlock stores doors in config files — one per location — listing the door model and coordinates, the authorised jobs, whether it is locked by default and its distance. Newer versions also include an in-game creation tool that writes those entries for you.

qb-doorlock config entry (shape)
Config.DoorList['mrpd-front'] = {
    doorType = 'double',
    locked = true,
    authorizedJobs = { ['police'] = 0 },
    distance = 2.5,
    doors = {
        { objName = `v_ilev_ph_door01`, objYaw = -90.0, objCoords = vec3(434.7, -980.6, 30.8) },
        { objName = `v_ilev_ph_door002`, objYaw = -90.0, objCoords = vec3(434.7, -983.2, 30.8) },
    },
}

Field names differ between qb-doorlock versions; copy an entry from your own config rather than from a random example.

#Common problems

ProblemCause and fix
Door does not lock at allWrong model or coordinates; recreate it with the in-game tool
Door locks but swings openOnly one leaf of a double door is registered
Everyone can open itNo access configured, or the job/grade does not match your framework’s job names
Doors reset after restartDoors were not saved (database or config not written)
MLO door not recognisedThe MLO uses a custom door model; select it in game rather than typing a model

Questions

How do I add doors with ox_doorlock?
Stand at the door in game and run the /doorlock command (with permission), select the door, set access and save. Doors are stored in the database.
How do I make a door only open for police?
Add a group access of police with the minimum grade you want (0 for all officers).
Can doors be opened with a keycard?
Yes, both ox_doorlock and qb-doorlock support item-based access.
Why can everyone open my locked door?
Either no access rule is set, or the job name in the door does not match the job name your framework uses.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.