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

Already working, with nothing to configure. The panel is served on the FiveM server port — the one your players connect through:

txt
http://<your server>:<server port>/tDB/

Your server port is whatever endpoint_add_tcp declares — 30120 on a default install. tDB prints the address in its startup box. The path is case-insensitive, so /tdb/ works too, and tLib's hub at /tLib/ links it. PocketBase's own port is internal and is never the one to forward.

Config.ExposeAdmin = false keeps the database headless instead. The database itself works either way — queries, migrations and every export run over the server, with no port involved.

One thing this door cannot do

PocketBase realtime subscriptions do not work over it. They are server-sent events, which the FiveM server port cannot carry. The admin UI and the REST API are unaffected.

If you need realtime, or a custom domain, use tLib's own listener instead: an optional second door on port 7777 that has to be opened by hand, serving the panel at the same path, :7777/tDB/. The whole procedure — the port, tlib_http_public_url and the reverse-proxy notes — is tLib's advanced listener guide. Its older /db address still answers there, with a permanent redirect.

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.

Optional: help us fix tDB

tDB does not report its own faults to us. When it throws on your server the error sits in your console, and unless someone opens a ticket we never learn it happened — which means the bugs nobody reports are the ones that stay.

One line opts in, in server.cfg above ensure tLib:

txt
set tlib_telemetry 1

That sends errors, warnings, renderer crashes and slow-operation outliers from our own code. No IP, no licence key, no server name, no player names or identifiers, and <resource>_diag output is never included. tlib_telemetry_status in the console shows what is on and what decided it.

It is off unless you set it, nothing is gated behind it, and Diagnostics is the full account of what is and is not sent.

Still stuck? Support can answer it directly.

Was this page helpful?