Skip to content

Databases ​

SpawnLoft can create a database for a Minecraft server or connect it to a database you already run. It provides connection details; you configure your plugins yourself.

Windows, Mac and Linux

New managed services use MySQL or Redis on Windows, macOS and Linux. Redis is provided by Microsoft Garnet. Plugin configuration stays manual.

Create a database ​

Open your server's Settings and choose Create a database. SpawnLoft downloads the engine when needed, creates a private database folder, starts the database, and assigns the server its own database and user credentials.

PlatformManaged engine
WindowsMySQL 8.4 LTS; Redis-compatible Garnet
macOS 15+MySQL 8.4 LTS and Redis-compatible Garnet, on Apple Silicon and Intel
macOS 13–14Redis-compatible Garnet, or an external SQL database; managed MySQL requires macOS 15+
Linux x64MySQL 8.4 LTS and Redis-compatible Garnet; the libraries MySQL needs are fetched from your distribution without sudo
Linux arm64Redis-compatible Garnet, or an external SQL database; Oracle publishes no small arm64 MySQL build

Engine downloads are checksum-verified and stored in SpawnLoft's engine store. You do not need Homebrew, a system service, or a separate MySQL installation. Existing databases are not silently moved to another engine or version. Garnet includes a private .NET runtime on both platforms; no separate runtime installation is needed.

Configure each plugin manually ​

Copy the host, port, database name, username, and password from the connection details into the plugin's own config using that plugin's documentation. Restart or reload the plugin as its author instructs, then check the server console for connection errors.

SpawnLoft does not detect plugins and inject database credentials into their configs. db apply and the panel's config-writing controls have been removed. Existing plugin files are left unchanged. A created database is not proof that a plugin is using it; verify the plugin's behavior after configuring it.

Databases in the panel ​

Databases sit beside servers in the panel with a lamp, a console, start, stop, restart and crash recovery. Each listens on 127.0.0.1 only and is stopped through mysqladmin over TCP, since a database takes no console input. The user a server receives can reach its own database and nothing else.

Add a server → A database creates one with choices: a version, an engine, or one shared by several servers. Settings → Databases on a server shows credentials with one click and Create a database builds one on the port after the game port, started and attached.

Use the command line ​

After setting up the launcher:

sh
# Create, start, and attach a database for this server.
spawnloft db create survival

# Or create a standalone database and attach it explicitly.
spawnloft db add testdb
spawnloft start testdb
spawnloft db attach testdb survival

# Show the connection details again for this attachment.
spawnloft db creds testdb survival
CommandEffect
db versions [--engine <e>]Verified releases (mysql, garnet)
db add <name> [--version <v>] [--engine <e>]Download the engine once and set up a database on a free port
db create <server>db add, start and db attach in one step, on the port after the game port
db attach <db> <server>Create a database and scoped user for the server; prints credentials
db detach <db> <server> [--drop]Remove the user; --drop deletes the data
db creds <db> <server>Show credentials again
db connect <name> --host <h> --port <n> --user <u> --password <p>Register a database you already run
db remove <db> [--purge]Forget a stopped database; --purge deletes its files

Choose one creation route. db create defaults to MySQL on Windows, Mac and Linux x64. Use --engine garnet for a Redis-compatible service. Credential output contains passwords: keep it private and out of shared logs.

Connect to an existing database ​

You can attach an external MySQL or Redis service. MariaDB is no longer offered for new connections. External services keep their own installation and lifecycle; SpawnLoft does not start or stop them.

For SQL operations, Mac tool discovery checks the managed engine store, Homebrew install locations, /usr/local/mysql, and PATH. If the required MySQL tools are not found, supply the tools directory with spawnloft db connect ... --tools <folder>. See spawnloft help for the connection commands.

Back up and verify ​

A server snapshot of standard or full scope carries a dump of its attached database as a databases/ member. verify checks for it, and restore imports it back into the database it came from, which has to be running.

Added in 1.4

A MySQL database has its own Backups tool, separate from the servers' snapshots. Back up now writes a plain SQL dump of the databases your servers use; each dump can be downloaded, put back (saving a dump of the current state first, so a restore can itself be undone) or deleted. Redis keeps its own checkpoints and has no dump; stop saves a checkpoint, and a failed save leaves it running with an error.

Managed SQL backup/restore uses the engine's tools. Review backup results for skipped database dumps or warnings, especially in automation: a completed server archive does not guarantee every optional database dump succeeded. Verify both the server files and the plugin's data when testing a restore.

Still working it out?

Find a fix in troubleshooting, or ask the community.

Troubleshooting Ask a question