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.
ensure tLib
ensure tDBStart 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:
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
- Remove
oxmysqlfromserver.cfg. tDB answers theoxmysql,mysql-asyncandghmattimysqlexport names too, soexports.oxmysql:...resolves to tDB with no script edits. - Change any file reference:
server_script '@oxmysql/lib/MySQL.lua'becomesserver_script '@tDB/lib/MySQL.lua'. Scripts that only callexports.oxmysqlneed no change. - If a script ships a
.sqldump, drop it intDB/sql/rather than loading it by hand — see Importing.sqlfiles.
Working from a git clone
A release download contains the PocketBase binary; a source checkout does not, so fetch it once:
bun scripts/fetch-runtime.ts # this platform
bun scripts/fetch-runtime.ts --all # both, for building a releaseChange 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:
set tlib_telemetry 1That 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.
tDB
Still stuck? Support can answer it directly.
Was this page helpful?
TIMMYG Studios