Skip to content

Installation

Install tDB, replace oxmysql, and confirm the database is up.

Prerequisites: a FiveM server on Windows or Linux x86-64, tLib v1.0 or later ensured before tDB, and no other database resource running — see Replace oxmysql.

Install tLib

Extract the tLib release zip into resources/. tDB fails to start without it.

Extract tDB

Put the folder in resources/ and keep the name tDB. A rename breaks the @tDB/... paths other resources use.

Add it to server.cfg

tDB must start before anything that queries the database.

txt
ensure tLib
ensure tDB

Start the server

On first start tDB creates a superuser and writes the credentials into config.local.lua.

Copy the superuser password out of that first startup box. It is shown once, on the run that generates it, and redacted afterwards. It is also in config.local.lua, which is gitignored and must stay that way. To pin your own login instead, set tdb_superuser_email and tdb_superuser_password in server.cfg — see Configuration.

You are done when the startup box reports the database ready and prints an admin URL. If it says Waiting for tLib's HTTP listener, that is not an error — see the admin UI.

The admin panel in a browser, if you want it

Optional. tDB is fully working without it — queries, migrations and every export run over the server, and no port is involved.

What a port buys is reaching the admin panel from a browser, at http://<your server>:7777/db/_/, on tLib's tlib_http_port (default 7777). Open and forward that port if you want that; see opening tLib's port. Leave it closed and the database is unaffected. PocketBase's own port is internal and is never the one to forward.

Replace oxmysql

  1. Remove oxmysql from server.cfg. tDB answers the oxmysql, mysql-async and ghmattimysql export names too, so exports.oxmysql:... resolves to tDB with no script edits.
  2. Change any file reference: server_script '@oxmysql/lib/MySQL.lua' becomes server_script '@tDB/lib/MySQL.lua'. Scripts that only call exports.oxmysql need no change.
  3. If a script ships a .sql dump, drop it in tDB/sql/ rather than loading it by hand — see Importing .sql files.

Working from a git clone

A release download contains the PocketBase binary; a source checkout does not, so fetch it once:

bash
bun scripts/fetch-runtime.ts          # this platform
bun scripts/fetch-runtime.ts --all    # both, for building a release

Change PB_VERSION at the top of that script to move to a different release.

Still stuck? Support can answer it directly.

Was this page helpful?