# Databases

Some game servers or mods (like Minecraft plugins) can benefit from having a dedicated database. This can result in increased performance, and you can also connect multiple servers to the 1 database. A good use-case for this is the McMMO plugin. This allows your players levels to follow them between all of your Minecraft servers.

<img src="/files/4lBv3MKoAf99kxk3dB0K" alt="" class="gitbook-drawing">

## Database solutions

There are a few ways to do this, each with their own advantages and disadvantages

<table><thead><tr><th width="147"></th><th width="145" data-type="rating" data-max="5">Difficulty to configure</th><th width="132" data-type="rating" data-max="5">Difficulty to manage</th><th width="136" data-type="rating" data-max="5">Impact of cyber breach</th><th data-type="rating" data-max="5">Impact of database corruption</th></tr></thead><tbody><tr><td><strong>Shared Database</strong></td><td>2</td><td>1</td><td>3</td><td>3</td></tr><tr><td><strong>Per Node</strong></td><td>4</td><td>3</td><td>1</td><td>1</td></tr><tr><td><strong>Panel Database</strong></td><td>2</td><td>1</td><td>5</td><td>5</td></tr></tbody></table>

{% hint style="info" %}
Higher is worse (eg harder or less secure)
{% endhint %}

### Shared database

<img src="/files/dZNsgOPKZrJtWeGz0kMM" alt="" class="gitbook-drawing">

The database is hosted on a dedicated node, and the other nodes connect to this one. The other nodes need to be able to communicate with the host.&#x20;

**If you migrate a server from node  A to B everything will continue to function.**

**If your database corrupts you may lose all data for all nodes.**

If one of your game servers is breached and the bad actor got your database credentials they may be able to alter the other server DBs. This is unlikely though, as Pelican creates a dedicated user per database.

### Database per node

<img src="/files/5gb0t1jc1JFU5R3ueJ5x" alt="" class="gitbook-drawing">

This is the most secure method, as each node has its own database - there is no communication outbound. **Migrating a game server from node A to B will break the database connection**

**If your database corrupts you may lose all data on a single node**

If one of your game servers is breached and the bad actor got your database credentials they may be able to alter DBs on the node. This is unlikely though, as Pelican creates a dedicated user per database. **The bad actor will not be able to touch databases on other nodes.**

### Use the Panel database

<img src="/files/0TRxQCX6CfZeZCY4aZWz" alt="" class="gitbook-drawing">

***This is the most dangerous option.***&#x20;

If one of your game servers is breached and the bad actor gained database credentials, they may be able to alter your Pelican database. **This would allow them to create an administrator user and take over your Pelican install.**

**If your database corrupts you may lose all data for all nodes and the Panel data.** This would require a Pelican reinstall or restore from backup.

## Create your Database

This guide will step you through how to create a shared database from a Ptero / Pelican egg.

{% hint style="info" %}
This requires all nodes to be able to access the machine hosting the database. If your notes are not located all at the same site, you could use a VPN client or go down the per node route.
{% endhint %}

{% hint style="danger" %}
***Do not port forward your DB***
{% endhint %}

### Create your Database

If you haven't already, import the relevant database egg per [First server](/guides/installation-guides/pelican/first-server.md#import-eggs)

{% hint style="info" %}
**I am going to assume MariaDB for this guide - your commands may be different if using something else**

You may need to do some reading on your servers / mod / plugins database requirements to select the correct DB type
{% endhint %}

1. Create your database using one of your intenal ports

   <div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p><strong>Do not use one of your play / join ports</strong>. Doing so will expose your DB to the internet, which increases the risk of the db being breached or taken offline.</p></div>
2. Start the database container and ensure it is marked as running. You should see something similar to

   ```bash
   2026-01-25  9:42:34 0 [Note] Server socket created on IP: '0.0.0.0'.
   2026-01-25  9:42:34 0 [Warning] 'user' entry '@installer' ignored in --skip-name-resolve mode.
   2026-01-25  9:42:34 0 [Warning] 'proxies_priv' entry '@% container@installer' ignored in --skip-name-resolve mode.
   2026-01-25  9:42:34 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
   2026-01-25  9:42:34 0 [Note] /usr/sbin/mariadbd: ready for connections.
   Version: '11.5.2-MariaDB-ubu2404'  socket: '/home/container/run/mariadbd/mariadbd.sock'  port: 7501  mariadb.org binary distribution
   Welcome to the MariaDB monitor.  Commands end with ; or \g.
   Your MariaDB connection id is 3
   Server version: 11.5.2-MariaDB-ubu2404 mariadb.org binary distribution

   Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
   ```

#### Add database to Pelican Panel

Now we need to add the database to the panel, assign a host and create the Database user

1. Log into your panel and navigate to the Admin UI
2. On the left, click on Database hosts
3. Click on the + symbol
4. Preperations tab:
   1. Save the provided credentails to your password manager
   2. Click next / OK
5. Database setup tab:
   1. Copy paste the commands from the Panel into the MariaDB console
   2. Run the following commands to allow for login outside of local host (127.0.0.1)

      ```bash
      RENAME USER 'pelicanuser'@'127.0.0.1' TO 'pelicanuser'@'%';
      FLUSH PRIVILEGES;
      ```
   3. Click on next / OK
6. Panel setup tab:

   <table><thead><tr><th width="242"></th><th></th></tr></thead><tbody><tr><td>Host</td><td>DNS name or IP of the wings node running the database container</td></tr><tr><td>Port</td><td>The port selected during creation</td></tr><tr><td>Display name</td><td>Whatever you want - I would suggest the hostname / DNS name of the server</td></tr><tr><td>Linked nodes</td><td>Set this to any Wings nodes you want to talk to this DB.<br>These nodes need to be able to reach the hostname / IP in the host field</td></tr></tbody></table>

   1. Click on create

#### Configure backup schedules

Backups are good, use backups.

Feel free to import one of my existing schedules from <https://github.com/trentnbauer/PelicanEggs/tree/main/schedules>

### Per node

Follow the above guide, but you will need to do it for each node. In step 6, set the linked node as the machine running the database - do not set any other linked nodes.

### Panel database

I will not show you how to configure this. The risk to bricking your install of Pelican is too high. **Follow the shared guide**

***

## Troubleshooting

#### "Unable to resolve host" or similar message.

Try your servers IP address - some containers are unable to resolve internal network names.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.trentbauer.com/guides/installation-guides/pelican/databases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
