---
name: ezyplatform-vps
description: Build and change an EzyPlatform website that runs on the user's own VPS (Ubuntu) directly on the server, for a non-technical "vibe coder", with nothing heavy on their computer (no Docker, no build, no local EzyPlatform) - the AI runs on the user's computer and does everything over SSH. Guides the user to give SSH access with a key (provider panel, web console or ssh-copy-id, never a password in chat), inspects the VPS (OS, RAM, disk, swap, Java, MySQL, Docker, Nginx, Certbot, firewall) and finds the EzyPlatform installation (native, installer or Docker, ports, owner, autostart), installs EzyPlatform when missing, asks for the admin and web addresses, installs EzyLogin and turns on its CLI login itself, signs in with EzyLogin CLI login (through an SSH tunnel when the admin is not public), installs the base plugins (Freestyle, EzyArticle, EzyLogin, EzyMail, EzySupport, E-Commerce, GraphQL for a data API), learns features by decompiling the jars and reading module resources on the VPS, asks what the user wants (pages, posts, landing page, shop, contact form, look of the site...), finds and installs the theme (Freestyle by default) and plugins from the ezyplatform.com market, writes pages, posts and fragments in a workspace on the VPS and saves them through the admin API (draft first, publish after approval), uploads media, sets up domain, Nginx and SSL, autostart after reboot and swap, asks the user to grant missing permissions in the browser, tests every change in a visible Chrome with Playwright and gives the user the links, and backs up the database, settings and content before every change, with restore. Never deletes data without asking. Use when the user has deployed / installed EzyPlatform on a VPS and wants to edit / build / sửa / làm website trực tiếp trên VPS, không chạy local, không deploy lại, "AI tự làm trên VPS", or wants to set up a new VPS for EzyPlatform from scratch.
---
# EzyPlatform website on a VPS, edited directly on the server
The user is a "vibe coder" whose computer is weak or busy. Their website runs on a VPS. You (the AI) run on their computer, but **all work happens on the VPS over SSH**: no local EzyPlatform, no Docker, no Maven build, no deploy step. The local computer keeps only an SSH key and the admin token (`~/.ezyplatform/vps.json`, owner-only).
How it works:
- `scripts/vps.py` (local, Python 3.8+ stdlib) connects with SSH (key + connection sharing), uploads `scripts/ezyvps_remote.py` to `~/.ezyvps/` on the VPS and runs it there. The helper talks to the admin on `127.0.0.1:<admin port>` of the VPS, so the admin does not need to be public.
- The website is changed through **content stored in the database** (pages, posts, page fragments, menus, settings, media) via the admin API, and through **plugins and themes installed from the market**. Files inside installed plugin and theme folders are signed and must never be edited: a changed file counts as tampering and is lost on the next update. The helper refuses to write there.
- Content you write lives in a workspace on the VPS: `~/ezy-site/` (`pages/<slug>/`, `posts/<slug>/`, `fragments/<page>/<name>/`). Edit it with `write`, `replace` and `cat`, never by copying files to the user's computer.
## Rules
- Talk to the user in their language, in simple words, briefly. Say what you are doing and how long it takes ("đang sao lưu dữ liệu, khoảng 1 phút").
- **Never delete data without the user's explicit yes for that exact deletion**: database rows, posts (moving to Trash counts), media, files, backups, plugins, Docker volumes, users. Never run `rm -rf`, `DROP`, `docker volume rm`, `docker compose down -v` or an uninstall on your own.
- **Always have a backup first.** Run `backup --label <what>` before installing or upgrading plugins/themes, switching the theme, restoring, changing Nginx/domain, changing settings files, running SQL, or any command that may lose data. `content-push`, `content-restore`, `write` and `replace` back up the previous version themselves. Restores make a safety backup first. Old backups are never deleted automatically: if the disk gets full, show `backups` and ask which ones may go.
- Every command that changes something important has a dry run: run it without `--yes`, tell the user the plan in plain words, run it again with `--yes` only after they agree. Installing plugins, switching the theme, restarting and publishing all need their OK, because the site is live.
- Never ask for, print or store passwords, tokens or keys in chat or files. The VPS password is typed by the user only in their provider console or their own Terminal. Never `cat` secret files (`setup.properties`, `encryption-keys.txt`, `.env`, `.ezy/*`, private keys): the helper refuses them too.
- Never buy a paid plugin for the user. Explain the price and ask.
- Never edit installed plugin/theme files, the platform jars, or system files outside what this skill manages (`/etc/nginx/sites-available/ezyplatform-*.conf`, `/etc/systemd/system/ezyplatform.service`, `/swapfile`). For anything else on the system, explain and ask first.
- **Find out instead of guessing.** When you need to know how a feature, API, table or setting works, read the real code on the VPS: `find-class`, `decompile` (CFR, output in `/tmp/ezyvps-src` on the VPS), `resources` (templates, SQL scripts, messages), `sql` (read-only), the GraphQL schema, the market docs. Try every reasonable way to do exactly what the user needs before saying it cannot be done.
- **Missing permission → ask the user to grant it**, never work around it: say which permission or setting is missing and why, open the right admin page in the browser for them (`browser.js open ... --message "..."`), wait, check again.
- **Show, do not just tell.** When the user must do something in a browser (approve, sign in, tick a setting, add DNS), open it for them. When a change is done, test it in a visible Chrome with Playwright (`browser.js check`), look at the screenshots, fix what is wrong, and give the user the final links.
- Do not run builds or Docker on the user's computer. If a request really needs custom Java code (a new plugin), say so plainly: that is the job of the ezyplatform-develop skill and needs a build machine. Offer what can be done with content and existing plugins first.
## Tools
`<skill>` is the folder of this file. Run everything as:
```
python3 -I <skill>/scripts/vps.py [--server NAME] <command> [options]
```
Windows: `py -3 -I <skill>\scripts\vps.py ...` (needs the built-in OpenSSH client).
Browser (Playwright driving the user's installed Google Chrome in a visible window, with a caption banner per step; a persistent profile in `~/.ezyplatform/vps-browser/profile` so the user signs in to their admin only once):
```
node <skill>/scripts/browser.js check --url <URL> [--url <URL2>] [--expect "<text>"] [--lang vi --lang en] [--no-mobile]
node <skill>/scripts/browser.js open --url <URL> --message "<what the user should do>" [--until-url <part> | --until-text <text>]
node <skill>/scripts/browser.js run <steps.js> # module.exports = async ({ page, go, banner, check, shot, withViewport }) => { ... }
```
First use: `mkdir -p ~/.ezyplatform/vps-browser && cd ~/.ezyplatform/vps-browser && npm init -y >/dev/null && npm i playwright-core@1.48.2 --silent` (small, no browser download; needs Node.js, install it after telling the user if missing). Pages load with `waitUntil: 'commit'` and wait at most 3 s for `load`, never `networkidle`. `check` prints `PASS`/`FAIL` per page, `RESULT: x/y`, `CONSOLE_ERRORS`, `HTTP_ERRORS` and `SHOT=` files (desktop 1366 px and mobile 390 px, full page): look at every screenshot with the Read tool before reporting. Run it in the background and tell the user a Chrome window opens. URLs: the public site when it is reachable, otherwise the tunnel (`tunnel` prints them). Exit code `0` = done, `3` = `NEED <code>: <what to do>`, `1` = error, `2` = HTTP error from `api`. Lines `KEY=VALUE` are results; `DRY_RUN:` means nothing changed.
| Command | What it does |
|---|---|
| `connect --host IP [--user root] [--port 22] [--name mysite] [--key PATH]` | create a key `~/.ssh/ezyvps_<name>` if needed (or reuse `--key`), test SSH, check sudo, upload the helper, add `Host ezyvps-<name>` to `~/.ssh/config`. Prints `PUBLIC_KEY`, `ONE_LINER`, `SSH_COPY_ID` and `NEED ssh_key` until the VPS accepts the key |
| `servers`, `use NAME`, `set-url --admin URL --web URL` | saved VPSes, switch, remember the public admin/web addresses |
| `probe [--home PATH \| --home docker:NAME]` | OS, RAM, swap, disk, IPs, Java/MySQL/Docker/Nginx/Certbot/firewall, domains in Nginx, certificates, EzyPlatform home (native, installer or Docker), ports, admin/web up, autostart, themes, modules, backups, `warnings` |
| `status` | admin and web up/down, autostart |
| `service start\|stop\|restart all\|admin\|web\|socket` | control the servers (installer control script, `cli.sh`, or the Docker container), cleans stale pid files, waits until they answer |
| `logs admin\|web [--errors] [--lines N]` | last lines, or the distinct error lines |
| `cli "<command>"` | EzyPlatform CLI on the VPS (`list`, `install <module>`, `activate <type> <module>`, `update-modules <module>`, `run-update`...) |
| `sh -- <command>` | any shell command on the VPS (as root/sudo). Read-only by default in your head: anything that changes the system needs a reason and, if risky, the user's OK |
| `cat PATH [--start N --end M]`, `write PATH [--from-file F]` (stdin), `replace PATH --old X --new Y [--all]` (or `--old-file/--new-file`) | read/write files on the VPS; `write`/`replace` keep the previous version in `<backups>/files/` |
| `put LOCAL REMOTE`, `get REMOTE LOCAL` | copy a file the user gave you (logo, photo) to the VPS / fetch one file |
| `backup [--label L] [--full] [--no-db]`, `backups`, `restore NAME --part db\|config\|nginx\|home [--yes]`, `backup-download NAME` | backups in `/var/backups/ezyplatform/<time>-<label>/` (`db.sql.gz`, `config.tar.gz`, `modules.txt`, `nginx.tar.gz`, `home.tar.gz` with `--full`); restore = dry run, then `--yes` (safety backup first); download a copy to `~/EzyPlatformBackups/<server>/` on the user's computer |
| `tunnel [--stop]`, `open [--path /p] [--web] [--tunnel]` | SSH tunnel to the admin/web (`http://127.0.0.1:19090`); open a page in the user's default browser (use `browser.js open` when you need to see the result) |
| `login [--tunnel]`, `logout` | EzyLogin CLI login (the user approves in the browser), token saved locally per server |
| `ezylogin-bootstrap [--yes]` | install + activate EzyLogin with the CLI on the VPS when it is missing (no token needed), restart |
| `market-search [keyword] [--type theme\|admin-plugin\|web-plugin]` | search the ezyplatform.com market: name, module types, version, price, short description |
| `plugins NAME...`, `plugin-install NAME [--no-restart] [--version V] [--paid-ok]` | status (`ACTION=install/upgrade/activate/none`), install/upgrade from the market with dependencies, activate, restart and wait |
| `content-list [--type PAGE]` | pages, posts and fragment groups on the site |
| `content-pull --slug S \| --fragment page/name --dir D [--lang L] [--force]` | download a page/post/fragment into a workspace folder on the VPS |
| `content-push --dir D [--lang L] [--publish] [--yes]` | save a workspace folder (all languages); dry run without `--yes`; backs up the server version first |
| `content-backups [--match X]`, `content-restore NAME [--yes]` | content backups and putting one back |
| `media-upload VPS_PATH... [--replace]` | upload files that are on the VPS to the media library |
| `api METHOD PATH [--json S \| --json-file LOCAL] [--web]` | any admin (or public web) API call through the VPS |
| `web-check [--path /p]... [--expect TEXT]...` | load pages from the web server on the VPS: status, unrendered template markers, missing texts, not-found page |
| `site-url [--web URL] [--admin URL] [--yes]` | show/set the public addresses saved in the admin |
| `domain-check DOMAIN...`, `domain-setup --web D [--admin D] --email E [--install-packages] [--yes]` | DNS check; Nginx reverse proxy + Let's Encrypt SSL (backs up `/etc/nginx` first, `nginx -t` before reload, refuses to overwrite a config it did not make) |
| `autostart status\|enable [--yes]`, `swap status\|enable [--size 2G] [--yes]` | start EzyPlatform after a reboot (systemd unit or Docker restart policy); swap file for small VPSes |
| `enable-cli-login` | turn on EzyLogin "admins may sign in from the command line" directly in `ezy_settings` (previous value saved to `<backups>/settings/`, effective at once) |
| `sql "SELECT ..." [--limit N] [--table]` | read-only query on the site database (one SELECT/SHOW/DESCRIBE/EXPLAIN; sensitive columns refused) |
| `set-setting NAME VALUE [--data-type T] [--yes]` | write one row of `ezy_settings` (previous value backed up); only when no admin API/UI does it and the user agreed |
| `jars [--module M] [--match X]`, `find-class REGEX [--module M] [--all-jars]` | list the jars of the platform and modules, find classes (controllers, services, entities, requests) |
| `decompile <package.or.Class> [--module M] [--jar REL]` | decompile with CFR (downloaded once to `~/.ezyvps/tools/`) into `/tmp/ezyvps-src/<jar>/`; read with `cat`, search with `sh -- grep -rn ... /tmp/ezyvps-src` |
| `resources MODULE [--match REGEX] [--in-jars] [--extract]` | templates, SQL scripts, messages, static files of a module (read with `cat home:<path>`; `--extract` copies files from jars to `/tmp/ezyvps-src`) |
| `install-platform --installer PATH --admin-email E [--dir /opt/ezyplatform] [--admin-user admin] [--lang vi] [--docker]`, `job-status install-platform` | install EzyPlatform on the VPS in the background with `install.sh` of the ezyplatform-install skill |
## Steps
### 1. Connect to the VPS
Ask for the VPS **IP address** (and the login user if it is not `root`). Run `connect --host <IP>`. On `NEED ssh_key`, load `references/ssh-access.md` and guide the user with the easiest method for their provider, then `connect` again until `READY`. Name the server after the site (`--name myshop`) so several VPSes stay apart. After the first success, `connect` appends a `Host ezyvps-<name>` block to `~/.ssh/config` (the old file is backed up next to it, existing blocks are never changed), so later sessions and the user themselves can simply run `ssh ezyvps-<name>` without the password.
### 2. Inspect
Run `probe` and summarize in one short paragraph (VPS size, EzyPlatform found or not, running or not, domains, backups). Then fix in this order:
| Finding | Action |
|---|---|
| `NEED ezyplatform_missing` | Ask: is it installed somewhere unusual (then `probe --home <folder>`), or should you install it? To install: find `install.sh` of the ezyplatform-install skill (look in the skill folders on this computer; if it is not there, find it in the EzyPlatform skill library). Ask for the admin email (and username), generate a strong password, run `EZY_ADMIN_PASSWORD=<pw> vps.py install-platform --installer <path> --admin-email <e>`, follow with `job-status install-platform` until `finished exit=0`. `finished exit=3` with `NEED linux_packages` (a fresh Ubuntu often lacks `xz-utils`, `libaio1t64`, `libnuma1`): tell the user, `sh -- "export DEBIAN_FRONTEND=noninteractive; apt-get update -q && apt-get install -y -q xz-utils libaio1t64 libnuma1 libncurses6"`, then run `install-platform` again (it skips finished steps). Give the password to the user once at the end. Then `probe` again. |
| admin/web `down` | `logs admin --errors` first (tell the user what you see in plain words), then `service start all`. |
| several candidates | Ask which site is the real one, then `probe --home ...`. |
| `low_ram_no_swap` | Offer `swap enable --size 2G` (dry run, then `--yes`). EzyPlatform admin + web + MySQL need about 2 GB. |
| `no_autostart_after_reboot` | Offer `autostart enable`: without it the site stays down after the provider reboots the VPS. |
| `low_disk` | Show `backups`, ask what may be deleted; never delete on your own. |
| firewall inactive / ports | Only report. Never enable `ufw` without allowing SSH first and without the user's OK. |
Before the first change on this VPS, run `backup --label first-contact`.
### 3. Site addresses and admin access
1. **Ask the user for the address of their admin and of their website** (for example `https://admin.example.com` and `https://example.com`, or `http://<IP>:9090` / `http://<IP>:8080`; "I don't know" is fine). Check that they answer from this computer (`browser.js check --url <web> --no-mobile`), then `set-url --admin <admin> --web <web>`. If they do not answer or the user has none yet, use the tunnel (`tunnel`, `http://127.0.0.1:19090`) and offer a domain in step 7.
2. **EzyLogin** (free, lets the AI sign in to the admin without a password): if `probe` does not list `ezylogin` among the modules, or `login` says `ezylogin_missing`, tell the user in one sentence that you install it and the site restarts for 1-3 minutes, `backup --label before-ezylogin`, then `ezylogin-bootstrap --yes`.
3. **CLI login switch**: run `enable-cli-login` (it backs up the old value and turns on "Allow admins to sign in from the command line"). Tell the user you did it and that it can be turned off again in **EzyLogin → Settings**.
4. `login` (run it in the background): the browser opens the approval page; the user signs in to their admin if asked, checks the tool name *AI VPS assistant (ezyplatform-vps)* and clicks **Approve**. `ezylogin_outdated`: `backup`, then `cli "update-modules ezylogin"`, `cli run-update`, `service restart all`, `login`.
5. A later `NEED login` (token expired) means: `login` again. `plugin_permission` / `content_permission` / `settings_permission`: the approved admin account lacks that right. Explain which one, ask the user to approve with a super admin account (`logout`, `login`) or to grant the permission to their account (open `<admin>/admins` or the roles page for them with `browser.js open`), then try again.
### 4. Ask what they want
Load `references/interview.md` and follow it. The user often does not know yet: offer concrete options with examples (home page, about/services pages, blog posts, a landing page, a contact form, an online shop, a members area, the look of the header/footer, translations, own domain), ask one group at a time, and summarize. Keep the brief in `~/ezy-site/brief.md` on the VPS (`write`) so another session can continue.
### 5. Theme and plugins
- **Base set** for every site, so the AI can work through the admin and query data through an API: **Freestyle** (theme, a blank theme for building pages freely), **EzyArticle** (pages, posts, fragments, menus), **EzyLogin**, **EzyMail** (sends every mail of the site: notifications, password reset, contact replies; EzyLogin depends on it), **EzySupport** (contact form, i18n messages, mail/content templates, Nginx/SSL pages), **E-Commerce** and **GraphQL** (a query API over the site's data: products, posts, users... used by pages to show live data). Tell the user what each is for in one line each and that the site restarts once at the end.
- If `probe` shows another active theme the user likes, ask before switching to Freestyle: the theme changes the look of the whole site.
- Add plugins for the user's wishes from the table in `references/interview.md`, confirmed with `market-search <keyword>` (and `--type theme` for themes that fit their business, e.g. a bakery or fashion shop). Show name, purpose and price; never buy a paid one.
- `backup --label before-plugins`, then `plugins freestyle ezyarticle ezylogin ezymail ezysupport ecommerce graphql <others>` → `plugin-install <name> --no-restart` for each `ACTION` not `none`, and `plugin-install <last> ` without `--no-restart`. Check with `plugins ...` until `TODO=none`, then `browser.js check` on the home page and `<admin>/themes`. `ACTION=activate` only because a `socket-plugin` is installed but inactive can be ignored when the site does not run the socket server (most websites); never start the socket server just for that.
- EzyMail sends nothing until a mail service is configured: tell the user, and ask them to type the SMTP or provider credentials themselves in **EzyMail → Settings** (open it for them); never type credentials for them.
- GraphQL publishes its schema only when **GraphQL → Settings → GraphQL docs** is on; turn it on for the user (or with their OK through the admin page) and read `<web>/api/v1/graphql/schema.graphql` (`api GET /api/v1/graphql/schema.graphql --web`) before writing queries.
### 5b. Learn the features before building
Before using a plugin feature you have not used before, learn it from the code on the VPS instead of guessing: `jars --module <name>`, `find-class 'controller/api|Request$' --module <name>`, `decompile <package> --module <name>` and read the controllers (`@DoGet/@DoPost` paths, `@RequestBody` classes), `resources <name> --match 'templates|\.sql$|messages'` for screens, tables and texts, `sql "DESCRIBE <table>"` / `sql "SELECT ... LIMIT 20"` for real data, the market docs (`https://ezyplatform.com/market/items/<name>/docs`). Write what you learn to `~/ezy-site/notes.md` on the VPS so the next session reads it instead of decompiling again. `/tmp/ezyvps-src` is a scratch folder for this only; never touch the real module folders.
### 6. Build and change content
Load `references/content.md` (Freestyle page structure, folder format, page types, gotchas). Workflow for each page, post or fragment:
1. If it exists on the site: `content-pull --slug <slug> --dir ~/ezy-site/pages/<slug>` (fragments: `--fragment common/header --dir ~/ezy-site/fragments/common/header`). New: `write` a `meta.json` and `content.html` into a new folder.
2. Edit with `cat` / `replace` / `write`. For images the user gave you: `put <local file> ~/ezy-site/media/<english-name>.jpg`, then `media-upload ~/ezy-site/media/<name>.jpg`, and use `/api/v1/media/<name>?v=<n>` in the HTML.
3. `content-push --dir <folder>` (dry run) → tell the user → `content-push --dir <folder> --yes` saves a **draft**.
4. Check it yourself first: `browser.js check --url <admin>/ezyarticle/pages/<slug>/preview --lang <each site language> --expect "<a heading>"` and read the screenshots (desktop and mobile, no horizontal scroll, no console errors, texts in the right language). Fix and push again until it is right, then show the user the same preview (`browser.js open --url ... --message "Bản nháp trang <slug>, anh/chị xem và báo lại"`).
5. When they say yes: `content-push --dir <folder> --publish --yes`, then `web-check --path /<slug> --expect "<a heading>"` and `browser.js check --url <web>/<slug>` (every language), and send the user the public link.
6. Something wrong after publishing: `content-backups --match <slug>`, `content-restore <name>` (dry run, then `--yes`).
A **landing page** with a lead form, buy buttons and brand interview: if the ezyplatform-landing-page skill is available, follow its interview and page patterns, but save through this skill's `content-push` (its `postType` is `STANDALONE_PAGE`).
### 7. Own domain and SSL (when wanted)
1. The user adds DNS **A** records at their registrar (never ask for the registrar password): `@` → VPS IP (site), `admin` → VPS IP (admin), optionally `www`. `domain-check example.com admin.example.com` until both are `ok`.
2. `backup --label before-domain`, then `domain-setup --web example.com --admin admin.example.com --email <their email>` (dry run), and with `--yes` (plus `--install-packages` if Nginx/Certbot are missing and the user agreed).
3. `site-url --web https://example.com --admin https://admin.example.com` (dry run, then `--yes`), `set-url --admin https://admin.example.com --web https://example.com`, `web-check`, and open both in the browser.
4. If `domain-setup` reports `nginx_conflict` (for example a config made by EzySupport's Nginx pages), do not touch it: show the user and decide together.
### 8. Backups and restore
- Backups are on the VPS in `/var/backups/ezyplatform/` (root only). Tell the user where they are. If the site matters, offer `backup-download <name>` to keep a copy on their computer too (a dead VPS takes its backups with it).
- Restoring: `backups`, choose with the user, `restore <name> --part db|config|nginx|home` (dry run explains exactly what is lost), `--yes` only after a clear yes, then `service restart all` and `web-check`.
## Finish: test in the browser and give the links
At the end of every task, run `browser.js check` on every page that changed (public URLs, each language, desktop and mobile) and on the admin screens you touched, read the screenshots, fix what is wrong, and repeat until `RESULT` is all passed. Then report to the user in their language, simply:
- the **links** to the results (each new/changed page, the admin page where they manage it), clickable;
- what changed and what was installed, what is still a draft;
- what they must still do themselves (DNS, mail service, payment keys, real content for placeholders) and where;
- where the backups are and that every change can be undone;
- the screenshot folder (`~/.ezyplatform/vps-browser/shots`) if they want to look.
No code, logs or tokens unless asked.