Sites
Databases
MariaDB and PostgreSQL, databases and owners, connecting a database to a site, export and import, object cache.
Open a server and choose Databases.
Database servers
Database servers installs the engines: MariaDB (from your distribution) and PostgreSQL (15–18, from the official PostgreSQL repository). Both listen on the server only (127.0.0.1); the firewall keeps their ports closed. One-click apps that need MariaDB install it for you.
The same card installs the object cache (Valkey) that PHP sites can use — see Access, caching and protection.
Remove next to an installed database server removes it (after your passkey approval). Delete its databases in the panel first. Its data stays on the disk — installing the same server again picks it up — unless you tick Also delete its data. Then the data moves to the server's trash for seven days (see Sites), and the databases the panel does not list are named first: the removal goes ahead only when you also tick Also delete databases the panel does not list.
Databases and owners
Create database with a Server (engine), a Database name and an Owner (the same as the name unless you choose one). Each database has its own owner with a generated password.
- Show password asks for your password and is written to the audit log.
- New password rotates the owner's password. Once the database has it, the sites connected to it get the new credentials in their
.envand restart; WordPress keeps its password inwp-config.php, so update it there (or leave WordPress databases as they are). The panel changes its own value only when the database has accepted the new password: if the change fails, the old password stays, the database shows the change as failed, and you can rotate again. - I changed the password is for a password you changed on the server yourself, with SQL for example. The panel checks the password you enter on the server first and stores it only when the server accepts it, then writes it into the linked sites'
.env. When the server refuses it, nothing changes. If you change the password on the server without this, the panel still writes its own value to the sites, so enter the new one here or use New password. - Delete database removes it and needs your passkey. Before the drop, the database is dumped into the server's trash, where it stays for seven days (see Sites). A dump that fails keeps the database.
Connection details
Connection details on a database shows everything to connect to it: host 127.0.0.1, the port (3306 for MariaDB, 5432 for PostgreSQL), the database and user name, a connection URL, the .env lines for Laravel and most frameworks, and the command to open it on the server. The password stays hidden: reveal it with the eye (or rotate it) and put it in place of <password>.
The database port is closed to the internet. To connect from your computer (TablePlus, DBeaver, a local app), open an SSH tunnel with a server user that has your SSH key — the details show the command, for example ssh -N -L 3306:127.0.0.1:3306 [email protected] — and connect to 127.0.0.1 on your machine with the same details.
Remote access over TLS
When a tool or an app elsewhere must connect directly (a BI dashboard, a second server, an office network), open the database to those networks under Connection details → Remote access: one address or network per line, for example 203.0.113.7 or 10.0.0.0/24 (at most 20; nothing wider than IPv4 /8 or IPv6 /32; MariaDB takes single IPv6 addresses only).
- The database server starts listening on the server's addresses, and the firewall opens its port (3306 or 5432) only to those networks — the rule is managed for you and shared by all open databases of that engine.
- Connections must use TLS: MariaDB accounts for those networks are created with
REQUIRE SSL, PostgreSQL getshostssllines only. A self-signed certificate is made once; the panel shows its SHA-256 fingerprint so your client can pin it. Example:psql "postgresql://[email protected]:5432/shop?sslmode=require". Recent MariaDB clients check the certificate by default; add--ssl --skip-ssl-verify-server-cert(and compare the fingerprint) or pin it in your client. - Apps on the server keep using
127.0.0.1without TLS, as before. - New password also updates the remote accounts; Delete database closes remote access first. Close remote access returns to localhost only; when no database of that engine is open, the server listens on localhost again and the firewall rule goes away.
An SSH tunnel needs nothing opened and stays the safest way for occasional access.
Adminer in the browser
Adminer on the Databases page gives the server a database manager in the browser. Set up Adminer with a domain — a free address on Zefily's domain is suggested when available; your own (sub)domain works too once it points to this server. It runs as a site of its own, with its own Linux user, PHP pool and HTTPS certificate, and does not count against your plan's sites.
Then use Open in Adminer next to a database: after you confirm your password, the panel makes a one-time link for that database and Go to Adminer opens it, already logged in as the database's owner.
- The link works once and only within 5 minutes; the session lasts 30 minutes and only for the address that opened it.
- Only that database is reachable: other databases, servers and Adminer's other drivers are refused, and Adminer's own login page is not reachable at all.
- Adminer (version 6.3.1) ships inside the signed agent, so a compromised download cannot change it. Every link is in the audit log.
Copy to another server
Copy to a server under a database's Connection details makes a new database with a copy of it — on another server of your organization or on the same one (a staging copy). Choose the Target server and the New database name; the target needs the same database server (MariaDB or PostgreSQL) installed.
- The source dumps the database and encrypts it with a key that only the two servers have; the panel passes the encrypted stream on in parts and never holds the key. The target checks it was not cut or changed, then restores it into the new, empty database, which gets its own owner and password. A copy never overwrites an existing database.
- The badge shows Sending, Restoring, Copied or Failed with the reason.
- Nothing stays behind: the servers stream the copy without files, and the encrypted copy is deleted from the panel within ten minutes after the target has finished (or failed), or after a day at the latest.
Connect a database to a site
On a PHP, Node.js, Python or container site, open Database and choose Create and connect a database with an engine. Zefily creates a database and owner for the site and writes the connection into the app's .env:
DATABASE_URL=mysql://user:[email protected]:3306/name
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=name
DB_USERNAME=user
DB_PASSWORD=password
The app restarts to load it. Container sites reach the server's database through the host address the container sees. WordPress and one-click apps get their database during installation.
The database keys stay in the .env for as long as the database is linked. When you edit the .env (in the site's Deploy tab, through the API or with zefily sites env --file), the panel keeps these lines at the database's values even if the file you save leaves them out. The editor shows them apart, read only. A different value you type for one of them is replaced by the panel's value, and the panel tells you which keys it kept. To change the database's own settings, change the database (for example its password), not the .env.
If the job that writes the .env fails (a container's data check refused the change, say), or the newest write that went through left the keys out, the link stays and the database shows its credentials as pending. The site shows applied only when the server's .env holds the current values. Apply again writes the same values into the .env and restarts the app. No second database is created, and nothing is dropped. The CLI does the same with zefily sites db-apply <site>; the API has POST /servers/{server}/sites/{site}/database/apply.
SQL console
Open a database's details and use the SQL console. Statements run as the database's own user, never as an administrator:
- Run takes one reading statement —
SELECT,SHOW,EXPLAIN,DESCRIBEorWITH— inside a read-only transaction, stops it after 30 seconds and shows up to 500 rows. Ctrl+Enter runs it. - Run as a change takes any SQL that changes data or structure. It waits for your passkey in the job list, then shows the database client's output.
The rows you read are not stored by Zefily; every run is recorded in the activity log with the beginning of the statement.
Slow queries
Under Slow queries on the Databases tab, Show lists the statements running right now on the server's MariaDB or PostgreSQL. Turn on records every statement slower than the threshold you choose (100 ms to 60 s) — MariaDB's slow query log or PostgreSQL's log_min_duration_statement — and the list then shows the slowest recent ones with their database, user and time. Turn it off when you are done.
Export and import
Export / import works with files in a server user's home directory:
- Export to ~/backups writes a compressed dump into the chosen user's
~/backupsfolder (Last export shows the file). - Import loads a dump from a file in that user's home; it replaces data and needs your passkey.
To move a database to another server, export it, copy the file over SFTP and import it there. For a graphical tool, install Adminer as a one-click app on a protected domain.
Backups
Database dumps are part of backup plans: they are streamed straight into your backup storage, encrypted on the server.
The site's database
A site with a database shows it on its Database tab: the engine, the name and the user, with the database actions of the Databases tab (reveal the password, rotate it, backup and restore, copy to another server, SQL console, Adminer, remote access). WordPress sites have their database there too. A database found by its name only, not linked to the site yet, is shown read-only and changes nothing. Redis-compatible object caches are not databases and are noted as such.
Updated November 27, 2026 View as Markdown llms.txt