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.

#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
- Install ox_doorlock with its dependencies (ox_lib, oxmysql) and start it after them.
- Give staff the permission for its command (the command is restricted by ACE).
- In game, stand at the door and run
/doorlockto open the creation interface. - Select the door (or both leaves of a double door), set a name, and choose access: groups with minimum grades, items, a passcode.
- Set options such as auto-lock time, lockpicking and whether the door starts locked, then save.
| Option | Use |
|---|---|
| Groups | Job or gang names with a minimum grade, e.g. police grade 0 |
| Items | Keycards or keys that open it |
| Passcode | A keypad code |
| Lockpick | Whether it can be picked, and how hard |
| Auto lock | Seconds until it relocks by itself |
| Double / sliding | Pairs 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.
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
| Problem | Cause and fix |
|---|---|
| Door does not lock at all | Wrong model or coordinates; recreate it with the in-game tool |
| Door locks but swings open | Only one leaf of a double door is registered |
| Everyone can open it | No access configured, or the job/grade does not match your framework’s job names |
| Doors reset after restart | Doors were not saved (database or config not written) |
| MLO door not recognised | The MLO uses a custom door model; select it in game rather than typing a model |
Questions
How do I add doors with ox_doorlock?
/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?
police with the minimum grade you want (0 for all officers).Can doors be opened with a keycard?
Why can everyone open my locked door?
Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.