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
- Databases → Create database.
- Name it with a lowercase prefix, for example
acme_app. - Create a dedicated user instead of reusing an administrator.
- 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
| Grant | Use |
|---|---|
SELECT, INSERT, UPDATE, DELETE | Application runtime |
+ CREATE, ALTER, INDEX, DROP | Migrations |
ALL PRIVILEGES | Local 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.
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
# Logical dump as the site user
mysqldump --single-transaction --routines --triggers \
-u acme_app -p acme_app | gzip > acme_app-20261201.sql.gzUse --single-transaction for InnoDB tables to avoid locking writes during the dump. Restores run the reverse:
gunzip -c acme_app-20261201.sql.gz | mysql -u acme_app -p acme_appScheduled 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.
| Action | Notes |
|---|---|
| Upload | Multi-file, resumable for large archives |
| Extract | .zip, .tar.gz, .tgz |
| Permissions | Files 644, directories 755; never 777 |
| Edit | UTF-8 text up to 2 MB |
| Search | Name 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
| Protocol | Port | Recommendation |
|---|---|---|
| SFTP | 22 | Preferred; uses SSH keys |
| FTPS | 21 | Legacy clients only |
| FTP | 21 | Avoid; 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.
sftp -i ~/.ssh/wasfor_deploy acme@203.0.113.10SSH 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,
.envfiles or database dumps inside the document root. Use a directory outsidepublic/and restrict it to the site user.