Skip to content
WasFor
Back to home
Documentation/User panel

Databases & files

WasFor separates structured data from files: databases live in MariaDB and are managed with dedicated users and grants, while the file manager and SFTP cover the filesystem.

Databases

Create a database

  1. Databases → Create database.
  2. Name it with a lowercase prefix, for example acme_app.
  3. Create a dedicated user instead of reusing an administrator.
  4. Grant only the privileges the application needs.

Generated credentials follow a strict policy and are shown once. Store them in your secret manager or the application's .env.

Users and grants

GrantUse
SELECT, INSERT, UPDATE, DELETEApplication runtime
+ CREATE, ALTER, INDEX, DROPMigrations
ALL PRIVILEGESLocal development only

Create two users for production when your workflow supports it: a runtime user with DML rights and a migration user with DDL rights used only during deployment.

sql
CREATE DATABASE `acme_app` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE USER 'acme_app'@'127.0.0.1' IDENTIFIED BY '<generated>';
GRANT SELECT, INSERT, UPDATE, DELETE ON `acme_app`.* TO 'acme_app'@'127.0.0.1';

CREATE USER 'acme_migrate'@'127.0.0.1' IDENTIFIED BY '<generated>';
GRANT ALL PRIVILEGES ON `acme_app`.* TO 'acme_migrate'@'127.0.0.1';

FLUSH PRIVILEGES;

The panel performs the same steps and reloads grants. Connections from outside the server are refused by default; enable remote access per database only when a managed service requires it, and restrict it by IP.

phpMyAdmin

One click opens phpMyAdmin authenticated as the database owner. Sessions are short-lived and scoped to the selected database. For bulk imports, upload a .sql or .sql.gz file rather than pasting large statements.

Backups and dumps

bash
# Logical dump as the site user
mysqldump --single-transaction --routines --triggers \
  -u acme_app -p acme_app | gzip > acme_app-20261201.sql.gz

Use --single-transaction for InnoDB tables to avoid locking writes during the dump. Restores run the reverse:

bash
gunzip -c acme_app-20261201.sql.gz | mysql -u acme_app -p acme_app

Scheduled database backups are configured under Backups.

Files

File manager

The file manager operates inside the account home directory. It supports upload, download, rename, move, copy, chmod, archive and extract, plus a built-in editor with syntax highlighting for common text files.

ActionNotes
UploadMulti-file, resumable for large archives
Extract.zip, .tar.gz, .tgz
PermissionsFiles 644, directories 755; never 777
EditUTF-8 text up to 2 MB
SearchName search inside the current directory tree

Ownership

Files are owned by the site user. Uploading through the panel or SFTP preserves the correct owner; uploading through a PHP script can create root-owned files and break future deployments. If permissions drift, use Files → Fix ownership rather than chmod 777.

FTP and SFTP

ProtocolPortRecommendation
SFTP22Preferred; uses SSH keys
FTPS21Legacy clients only
FTP21Avoid; plaintext credentials

Create FTP accounts under FTP, binding each to a directory. Prefer SFTP with an SSH key from SSH keys; disable password authentication for automation accounts.

bash
sftp -i ~/.ssh/wasfor_deploy acme@203.0.113.10

SSH keys

Paste a public key under SSH keys. Keys are attached to the account, not to a single site, and grant SFTP plus shell access according to the account role. Rotate keys on a schedule and remove them immediately when a team member leaves.

Never store private keys, .env files or database dumps inside the document root. Use a directory outside public/ and restrict it to the site user.

Last updated: 2026-12-01