Install ox_doorlock: create and lock doors in the game

Install ox_doorlock on ESX or Qbox, create doors in the game with /doorlock, give jobs, items or codes access, and fix the most common problems.

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

ox_doorlock by Overextended locks doors on your FiveM server: the police station, a garage, the doors of your own MLO. You create doors in the game with /doorlock, without editing a config file, and decide who may open them: a job, a player, an item or a code. The doors are saved in your database. In December 2026, ox_doorlock 1.23.0 is the newest version, with documentation.

Using the Qbox recipe? Then ox_doorlock is already installed in resources/[ox]. Skip to "Who may use /doorlock".

Before you start

  • Framework: ox_doorlock works with Qbox, ESX Legacy, ox_core and ND Core. Without a framework you only have codes and ACE permissions. QBCore isn't supported: its recipe has qb-doorlock. See ESX, QBCore or Qbox.
  • Needed: ox_lib and oxmysql with a connected database.
  • Optional: ox_target, for picking locks.

Installing ox_doorlock

  1. Make a backup and export your database with Export Database.
  2. Download ox_doorlock.zip from the newest release on GitHub. Not Source code: that has no built interface.
  3. In the game panel, open Files and go to resources/[ox] (create it with Create Directory if it isn't there).
  4. Upload the zip with Upload, click the three dots ..., choose Unarchive and delete the .zip file.
  5. Go to server.cfg editor, click Manual Edit and put ensure ox_doorlock below your framework and ox_target. Click Save and restart your server.
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure ox_target
ensure ox_doorlock

Replace es_extended with your own framework. Don't forget the four add_ace lines for ox_lib from the ox_lib guide. On the first start ox_doorlock creates the table ox_doorlock in your database by itself: you don't need to import anything.

Who may use /doorlock

/doorlock is for the ACE group group.admin. You change that in ox_doorlock/config.lua at Config.CommandPrincipal.

  • The txAdmin recipes put the txAdmin master account in group.admin.
  • With ESX, players with the ESX group admin are added to group.admin automatically. With Qbox you add staff with add_principal lines in permissions.cfg.
  • Anyone else: add a line like add_principal identifier.fivem:123456 group.admin to your server.cfg. How you find that ID is in Admins and permissions.

Not sure? Type test_ace player.1 command.doorlock in the Live Console of txAdmin, with your server ID instead of 1.

Creating a door

  1. Walk up to the door and type /doorlock in the chat. The window opens at Create a new door.
  2. Under General, give the door a clear name, such as mrpd armoury. Tick Locked if it should be locked by default, Double for a double door and Automatic for a sliding or garage door. Here you also set a Passcode, the Autolock interval (in seconds) and the Interact distance.
  3. Decide who may open the door. Under Groups you add a job (or a gang with Qbox), such as police, with the minimum grade: 0 means every grade. Under Characters you add specific characters by the ID of your framework (the identifier with ESX, the citizenid with Qbox). Under Items you add an item that opens the door, such as a key card.
  4. Click Confirm door. Now aim at the door: it gets an outline. Click with the left mouse button. For a double door, click both halves. The right mouse button cancels.
  5. Done. Walk up to the door and press E to lock or unlock it.

To change a door later, type /doorlock and open Doors. There you search by name, change the settings, use Teleport to door or Delete door. Type a word after the command, such as /doorlock closest, and the window opens straight at the nearest door.

Permission per door with ACE

Besides groups, you can open a door for an ACE group with the name of the door. Use quotes when the name has spaces:

add_ace group.police "doorlock.mrpd armoury" allow

Set Config.PlayerAceAuthorised = true in config.lua and everyone who may use /doorlock can also open every door.

Useful settings in config.lua

  • Config.DrawTextUI = true: shows a text like "[E] Unlock door" near a door. Off by default; then you only see a lock icon.
  • Config.Notify = true: a notification after locking or unlocking.
  • Config.LockpickItems: the items that work as a lockpick, lockpick by default.

Picking locks works with ox_target: tick Lockpick for the door, and players with a lockpick get the option Pick lock. They then play a skill check, and on a failure the lockpick can break.

Ready-made doors for Mission Row

In ox_doorlock/sql you find default.sql with doors for the standard Mission Row police station and community_mrpd.sql for the Community Mission Row PD MLO. Import one of them after the first start, when the table exists, for example with HeidiSQL. They use fixed IDs, so only import them into an empty table. Then restart.

Coming from nui_doorlock? Put its .lua config files in ox_doorlock/convert (create the folder if it isn't there): ox_doorlock reads them on start and adds the doors to your database. That isn't guaranteed to work for forks, such as the QBCore version.

Common problems

  • Your cursor appears, but no window: you uploaded the source code. Use ox_doorlock.zip.
  • Nothing happens with /doorlock: you're not in group.admin. Check with test_ace and check the add_ace lines for ox_lib.
  • The police can't open a door: the job name under Groups must be exactly the name of the job (police, not Police), and the grade is a minimum.
  • No Pick lock option: ox_target has to start before ox_doorlock, the door needs Lockpick and the player needs a lockpick item.
  • Doors gone after a restart: the database isn't connected. Look for oxmysql errors in the console.
  • **ox_lib must be started before this resource.**: see the ox_lib guide.

Building a police station or your own interior? See also Install an MLO and ox_inventory and ox_target. No server yet? Try FiveM server hosting with us, from €5 a month, or free for 24 hours.

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

Online within minutes, DDoS protection included, no contract.