create-cavecms
v0.3.5
Published
One-command installer for CaveCMS. Downloads the latest signed release, generates secrets, prompts for the minimum (DB + URL), writes a sealed env.production, runs migrations, and starts the service. Customers never touch env files by hand.
Maintainers
Readme
create-cavecms
The official one-command installer for CaveCMS.
Install
npx create-cavecms my-siteThat's it. The CLI:
- Detects whether you're on VPS / laptop / cPanel and picks the right adapter
- Downloads and SHA-256 + Ed25519 verifies the latest release from
updates.cavecms.com - Unpacks the runtime to the canonical install path for the surface
- Prompts for the minimum it cannot auto-supply: DB connection, public URL, port
- Generates every bootstrap secret (JWT / CSRF / preview / brochure / internal-revalidate / secrets-encryption + a random
LOGIN_PATH) - Writes ONE sealed
env.production(mode600) that you never open or edit - Runs database migrations against your MariaDB
- Starts the service (systemd on VPS, foreground on laptop, Passenger shim on cPanel)
After the CLI finishes, open <site-url>/install and walk the in-app wizard.
Prerequisites
- Node 20+ on the target machine
- MariaDB 10.11+ reachable from the install target
- For VPS installs only: sudo access during the CLI run (for systemd + nginx)
Non-interactive install
CAVECMS_DB_USER=cavecms \
CAVECMS_DB_PASSWORD='secret' \
CAVECMS_SITE_URL='https://mysite.com' \
npx create-cavecms my-site --yes --surface=vps| Env var | Default |
|-------------------------|-------------|
| CAVECMS_DB_HOST | 127.0.0.1 |
| CAVECMS_DB_PORT | 3306 |
| CAVECMS_DB_USER | required |
| CAVECMS_DB_PASSWORD | required |
| CAVECMS_DB_NAME | cavecms |
| CAVECMS_SITE_URL | required for VPS / cPanel |
| CAVECMS_PORT | 3040 |
CLI flags
| Flag | Meaning |
|-----------------------|---------|
| --surface=auto | Force a surface (vps / laptop / cpanel). Default: auto-detect. |
| --port=NUMBER | App listen port. Default: 3040. |
| --version=X.Y.Z | Pin to a specific release. Default: latest. |
| --dir=PATH | Override the install directory. |
| --skip-signature | Skip Ed25519 verify (SHA-256 still checked). |
| --skip-migrate | Don't run migrations. |
| --skip-start | Don't start the service. |
| -y, --yes | Non-interactive: accept defaults + env-supplied answers. |
Why a sealed env file?
Customer installs must NEVER require editing .env.local, .env.production,
or any config file by hand. The CLI writes env.production ONE TIME at
install — random secrets, the DB URL you provided, and the LOGIN_PATH the
wizard will reveal. From then on, every operator-configurable knob lives
in the settings table you edit from the admin dashboard.
If a secret is ever compromised, re-run the installer with --rotate
(future flag) to regenerate the affected secret in place.
License
This installer is part of CaveCMS. See the project's LICENSE.md — Prosperity Public License 3.0.0 (free for personal/educational/non-profit; 30-day commercial trial; paid license for ongoing commercial use).
