GuidesAddons7 min read

Better Databases

Installer
Ainx installation path

Better Databases v-A.1.0.0 adds MySQL/MariaDB, PostgreSQL, MongoDB, and Redis providers to Pterodactyl. Install the addon first, then configure only the engines you plan to offer.

If this panel never had the standalone build, install Ainx if needed:

bash
npm i -g ainx

Then install the addon package from the panel root:

bash
ainx install /path/to/betterdatabases.ainx

Skip ahead to the provider you want to configure.

What the installer changes

The installer adds the addon files, routes, views, configuration, frontend components, Composer dependencies, cache clearing, and database observer patch.

It does not install APT packages, PHP extensions, database clients, or local database daemons. Install only the services required by the providers you plan to offer.

DB Agent provider

DatabasesEverywhere can run on a separate database node and expose it to Better Databases as a DB Agent provider. Install the agent on that node:

bash
sudo curl --fail --location \
  "https://github.com/Tomaxikz/DatabasesEverywhere/releases/latest/download/dbev-x86_64-linux" \
  -o /usr/local/bin/dbev
sudo chmod +x /usr/local/bin/dbev

Create the DB Agent node in Admin → AINX Addons → Better Databases, copy its generated configuration, and save it on the database node as:

text
/etc/databases-everywhere/config.yml

Run the agent setup and enable its service:

bash
sudo dbev --setup
sudo systemctl enable --now databases-everywhere

Use this path instead of installing local database daemons on the panel host when the providers live on another node.

For the complete node, configuration, API, backup, and monitoring instructions, continue with the DatabasesEverywhere overview.

System requirements

Better Databases expects the panel host to have the PHP extensions and client tools needed by the providers you enable. Replace 8.3 with the PHP version used by your panel:

bash
sudo apt update
sudo apt install -y \
  php8.3-bcmath php8.3-curl php8.3-mbstring php8.3-mongodb \
  php8.3-mysql php8.3-pgsql php8.3-xml php8.3-zip \
  postgresql-client mongodb-database-tools

For providers hosted locally, install and enable only the services you need:

bash
sudo apt install -y mariadb-server postgresql redis-server
sudo systemctl enable --now mariadb
sudo systemctl enable --now postgresql
sudo systemctl enable --now redis-server

MongoDB is not available in the default Debian repositories on every release. Add MongoDB's official repository first, then install mongodb-org; the MongoDB section below includes a complete example.

Optional translations

Better Databases works in English by default. Translation integration varies between panel themes and their frontend systems. Ask the theme developer where its translated addon catalogs belong.

The Better Databases installer deliberately does not modify theme translation files.

Security baseline

  • Give each provider its own account. Never use root, a database superuser, or Pterodactyl's application account.
  • Provider credentials can create tenant databases and users. Generate a long, unique password and rotate it if it leaks.
  • Keep database ports on a private network where possible. Use TLS whenever traffic crosses an untrusted network.

MySQL or MariaDB

Install MariaDB, make it reachable from the panel host, and create a dedicated provisioning account.

1. Install MariaDB

bash
sudo apt update
sudo apt install -y mariadb-server

2. Listen on the network

Edit /etc/mysql/mariadb.conf.d/50-server.cnf:

ini
[mysqld]
bind-address = 0.0.0.0

Then restart MariaDB:

bash
sudo systemctl restart mariadb

3. Create the provider user

sql
sudo mariadb -u root -p

CREATE USER 'ptero_provider'@'PANEL_PRIVATE_IP' IDENTIFIED BY 'CHANGE_ME_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'ptero_provider'@'PANEL_PRIVATE_IP' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Better Databases creates a separate MySQL user for every tenant database. The provider account is only for provisioning—never give it to a customer or reuse Pterodactyl's own database account.

PostgreSQL

Install PostgreSQL, allow connections from the panel host, and create a provisioning role.

1. Install PostgreSQL

bash
sudo apt update
sudo apt install -y postgresql

2. Accept network connections

Edit /etc/postgresql/<version>/main/postgresql.conf:

ini
listen_addresses = '*'

Add this to /etc/postgresql/<version>/main/pg_hba.conf:

text
host    all             all             0.0.0.0/0               scram-sha-256

Restart PostgreSQL:

bash
sudo systemctl restart postgresql
0.0.0.0/0 accepts password attempts from every IPv4 address that can reach PostgreSQL. Restrict this CIDR when you know the client networks. If public access is unavoidable, enforce TLS and keep the built-in postgres role local-only.

3. Create the panel user

sql
sudo -u postgres psql

CREATE USER ptero_provider WITH PASSWORD 'CHANGE_ME_STRONG_PASSWORD' CREATEDB CREATEROLE;
Every tenant receives a restricted role that owns only its generated database. The provisioning role is not a tenant credential.

MongoDB

Install MongoDB from its repository. On a fresh server, create the provisioning user before turning authorization on so you do not lock yourself out.

1. Install MongoDB

bash
sudo apt update
sudo apt install -y gnupg curl ca-certificates
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc \
  | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" \
  | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl enable --now mongod

2. Create the provider user before enabling auth

javascript
mongosh
use admin
db.createUser({
  user: "ptero_provider",
  pwd: "CHANGE_ME_STRONG_PASSWORD",
  roles: [
    { role: "userAdminAnyDatabase", db: "admin" },
    { role: "dbAdminAnyDatabase", db: "admin" },
    { role: "readWriteAnyDatabase", db: "admin" }
  ]
})
exit

This account can provision databases. Tenant accounts created by the addon receive readWrite only on their own database.

3. Enable auth and remote access

Edit /etc/mongod.conf:

yaml
net:
  bindIp: 0.0.0.0
  port: 27017
security:
  authorization: enabled

Restart MongoDB:

bash
sudo systemctl restart mongod

4. Test auth from the panel host

bash
mongosh "mongodb://ptero_provider:CHANGE_ME_STRONG_PASSWORD@MONGO_PRIVATE_IP:27017/admin"
Never expose the provider credentials to tenants. If MongoDB traffic leaves your private network, configure TLS before allowing remote clients.

Admin page fields

Open Admin → AINX Addons → Better Databases and select Add Provider. The native Admin → Databases page is for Pterodactyl's built-in database hosts, not these providers.

MySQL / MariaDB provider fields

text
Name: Any label, for example MySQL Provider
Engine: MySQL / MariaDB
Linked Node: Global, or a specific node if only that node should use it
Host: MySQL private IP or hostname, for example 127.0.0.1 or 10.0.0.20
Port: 3306
Username: ptero_provider
Password: CHANGE_ME_STRONG_PASSWORD
Use TLS: Enable only if your MySQL server is configured for TLS
Enabled: Checked

The addon creates databases on this host when users request them, with names such as s1_example.

PostgreSQL provider fields

text
Name: Any label, for example PostgreSQL Provider
Engine: PostgreSQL
Linked Node: Global, or a specific node if only that node should use it
Host: PostgreSQL private IP or hostname, for example 127.0.0.1 or 10.0.0.30
Port: 5432
Username: ptero_provider
Password: CHANGE_ME_STRONG_PASSWORD
Use TLS: Enable only if your PostgreSQL server requires TLS
Revoke Public Connect: Optional, leave unchecked for normal PostgreSQL compatibility
Revoke Public Temporary Tables: Optional, leave unchecked for normal PostgreSQL compatibility
Enabled: Checked

You do not need to create a database first. Provider tasks use PostgreSQL's default postgres database, and tenant databases are created on demand.

The revoke options affect newly created tenant databases only. Leave them off unless you deliberately want to block other roles from connecting or creating temporary tables.

MongoDB provider fields

text
Name: Any label, for example MongoDB Provider
Engine: MongoDB
Linked Node: Global, or a specific node if only that node should use it
Host: MongoDB private IP or hostname, for example 127.0.0.1 or 10.0.0.40
Port: 27017
Username: ptero_provider
Password: CHANGE_ME_STRONG_PASSWORD
Use TLS: Enable only if MongoDB TLS is configured
Auth Database: admin
Replica Set: Leave blank unless your MongoDB runs as a replica set
Enabled: Checked

Use admin as the auth database when you created the provider user with the commands above. Tenant users still authenticate against and access only their generated database.

Redis provider fields

text
Name: Any label, for example Redis Provider
Engine: Redis
Linked Node: Usually the node/panel host that will run the Redis processes
Host: 127.0.0.1 or another local interface on the panel queue-worker host
Port: 6379 for provider connection tests
Username: Leave blank unless your Redis setup requires ACL username
Password: Main Redis/provider password if required
Redis DB Index: Usually 0
Port Range: Dedicated tenant instance port range, for example 6380-6480
Max Instances: Must fit inside the port range
Memory MB: Required per tenant instance
Enable Redis allocation creation: Only after accepting the operational risk
Enabled: Checked

Redis allocations start dedicated Redis processes on the host running the panel queue worker. They do not provision a remote Redis cluster.