# VaultPanel Documentation (full text) --- --- > Install VaultPanel, connect your Linux servers and run websites, apps, databases, DNS, email, backups and security from one panel. Guides, API, CLI and SDK reference. --- --- # VaultPanel Documentation URL: https://docs.vaultpanel.net/ > Install VaultPanel, connect Linux servers and run websites, apps, databases, DNS, email and backups from one panel, with guides and API, CLI and SDK reference. VaultPanel is a web control panel for Linux servers. Connect a server, then deploy and run production websites and applications with their domains, databases, SSL certificates, process management, monitoring, backups and security, without hand-editing server configuration. It also covers website firewalls, malware scans, caching, SFTP, statistics, spam filtering, webmail, passkeys and moving sites from cPanel. These docs cover version 0.3.0. ## Install On a fresh Ubuntu 22.04, 24.04 or 26.04, or Debian 12 or 13 server, as root. ### Update the system and install the required packages Before running the installer, bring the system up to date and make sure `curl`, `wget` and `sudo` are installed. The install command needs them. ```bash apt update && apt -y upgrade && apt -y install curl wget sudo ``` ### Download, check and run the installer Choose your system and the database server for your websites and apps, then run the command. | System | `DB_ENGINE` (the first is the default) | | --- | --- | | Ubuntu 26.04 LTS | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.8` (MariaDB 11.8) | | Ubuntu 24.04 LTS | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11) | | Ubuntu 22.04 LTS | `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11), `MARIADB_10.6` (MariaDB 10.6) | | Debian 13 | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.8` (MariaDB 11.8) | | Debian 12 | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11) | `DB_ENGINE=NONE` installs no database server. Copy the current checksum from https://github.com/VaultPanel/packages: ```bash curl -sS https://installer.vaultpanel.net/v2/install.sh -o install.sh; \ echo " install.sh" | \ sha256sum -c && sudo DB_ENGINE=MARIADB_12.3 bash install.sh ``` The panel then runs on port 8090 over HTTPS. [Read the installation guide](https://docs.vaultpanel.net/getting-started/installation) for options, the database choice and what the installer changes on the server. ## Get started - [Introduction](https://docs.vaultpanel.net/getting-started/introduction) - [Installation](https://docs.vaultpanel.net/getting-started/installation) - [Quick start](https://docs.vaultpanel.net/getting-started/quick-start) ## Guides - [Servers](https://docs.vaultpanel.net/guides/servers) - [Websites](https://docs.vaultpanel.net/guides/websites) - [Applications](https://docs.vaultpanel.net/guides/applications) - [Databases](https://docs.vaultpanel.net/guides/databases) - [DNS & Email](https://docs.vaultpanel.net/guides/dns-and-email) - [Backups & Automation](https://docs.vaultpanel.net/guides/backups-and-automation) - [Security](https://docs.vaultpanel.net/guides/security) - [Hosting & Billing](https://docs.vaultpanel.net/guides/hosting-and-billing) - [AI Assistant](https://docs.vaultpanel.net/guides/ai-assistant) ## Build on VaultPanel - [API Reference](https://docs.vaultpanel.net/api-reference) - [CLI Reference](https://docs.vaultpanel.net/cli) - [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk) - [Plugins](https://docs.vaultpanel.net/developers/plugins) ## Resources - [Best practices](https://docs.vaultpanel.net/best-practices) - [Troubleshooting](https://docs.vaultpanel.net/troubleshooting) - [Changelog](https://docs.vaultpanel.net/changelog) --- # Introduction URL: https://docs.vaultpanel.net/getting-started/introduction > What VaultPanel is, what it manages on your Linux servers, and where to start reading the documentation. VaultPanel is a web control panel for Linux servers. You connect a server, then deploy and run production websites and applications with their domains, databases, SSL certificates, process management, monitoring, backups and security, without doing the Linux administration by hand. Every change the panel makes on a server is a job from a fixed catalog of operations: its log is kept, and every change is recorded in the audit log. ![The VaultPanel dashboard greeting Super: a Needs attention card with 17 failed jobs, counts of servers online, websites up, backups and alerts, quick actions, the Get started checklist at 2 of 5 done, and the server vmi3756066 under Your servers](https://docs.vaultpanel.net/screenshots/dashboard-light.png) *The dashboard: the state of every server, the operations queue and recent activity.* ## What you can do with it ### Servers - Connect servers through a small agent. The server the panel runs on connects itself. - Watch live and historical metrics, services and processes, with alerts by email and webhook. A [self-check](https://docs.vaultpanel.net/guides/servers/self-check) on each server confirms every few minutes that the panel's features will work there. - Open a root terminal in the browser (owners only), with recordings you can replay or download. - Manage the firewall (UFW), SSH settings and keys, Fail2ban and security updates. - Group servers and run one action across a group: restart a service, install updates, reboot one server at a time, update agents. ### Websites, DNS and email - Static websites (with a single-page app setting), PHP sites on PHP-FPM with a PHP version per site (7.4 and 8.0 to 8.5), and reverse proxies to an app. NGINX is configured for you, with custom NGINX rules for staff and `.htaccess` support through Apache behind NGINX. - Free Let's Encrypt certificates, uploaded certificates, and wildcard certificates through the panel's DNS zones, Cloudflare or Namecheap. - One-step installs of WordPress, Joomla, Drupal or Laravel, with their database. - A file manager, NGINX logs, DNS checks and uptime monitoring with a **Website down** alert. - [SFTP](https://docs.vaultpanel.net/guides/websites/sftp) for each website, locked into the website's own folder. - A [web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) (ModSecurity with the OWASP Core Rule Set) per website, and a limit on WordPress sign-in attempts. - [Malware scans](https://docs.vaultpanel.net/guides/websites/malware-scanning) with ClamAV, with quarantine, and [caching](https://docs.vaultpanel.net/guides/websites/caching): a page cache for PHP sites and a Redis object cache for WordPress. - [Website statistics](https://docs.vaultpanel.net/guides/websites/statistics) from the access logs: visitors, page views, traffic and errors, with no addresses kept. - [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel): websites, databases and email from a cPanel full backup. - DNS zones served by your own servers (BIND) and email hosting (Postfix, Dovecot, OpenDKIM) with mailboxes, forwarders and DKIM-signed mail, [spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering) (Rspamd) and [webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail) (Roundcube). ### Apps, databases and containers - Node.js, Python, Go and Ruby apps deploy from Git into release folders and run under PM2 as their own Linux user. They can be rolled back, deployed on every push, reloaded without downtime (Node.js), run as several copies and capped on CPU and memory. - MariaDB databases and users with generated passwords, a SQL client in the panel and one-click phpMyAdmin. - Docker containers from public images, with ports, volumes, environment variables and limits. ### Backups and automation - Back up websites, apps and databases on demand or on a schedule, to the server, an S3-compatible bucket or another server over SFTP, and restore them in place. - Cron jobs that run as each site's own user, with their output kept. - Webhooks (JSON, Slack or Discord) for backups, cron failures, deployments, alerts and servers going offline. ### Hosting, access and extending - Hosting plans with quotas, customer accounts that see only their own resources, a billing API and a WHMCS module. - Two-factor sign-in, [passkeys](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor#passkeys), users and roles, panel access limited by IP address, and an audit log. - An [AI assistant](https://docs.vaultpanel.net/guides/ai-assistant), on every page, that reads your servers' status and logs and proposes fixes that run only when someone approves them. - A REST API with scoped API tokens, the [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk), the [`vaultpanel` CLI](https://docs.vaultpanel.net/cli) and [plugins](https://docs.vaultpanel.net/developers/plugins). ## What is not built yet Some features are planned but not available. MySQL 8.4 and 8.0 for websites and apps come in a later version (MariaDB is available now). Private container registries, Docker Compose stacks and running one app across several servers behind a load balancer are also still to come. The panel shows planned pages as unavailable, and the [roadmap](https://docs.vaultpanel.net/roadmap) lists everything that is left. ## Where to go next - [How it works](https://docs.vaultpanel.net/getting-started/how-it-works) - [System requirements](https://docs.vaultpanel.net/getting-started/system-requirements) - [Installation](https://docs.vaultpanel.net/getting-started/installation) - [Quick start](https://docs.vaultpanel.net/getting-started/quick-start) --- # How it works URL: https://docs.vaultpanel.net/getting-started/how-it-works > The VaultPanel control plane, the agent on each server, and the signed jobs that carry every change between them. VaultPanel is split into a control plane (the panel) and a small agent on each server it manages. The panel decides what should happen; the agent does it, using only fixed commands from a catalog both sides agree on. ## The parts ```text Browser ── React UI │ HTTPS, session cookie + CSRF token ▼ Express API (as the vaultpanel user) ─── MariaDB (users, servers, jobs, audit log…) │ └── Redis (agent nonces, background queues) │ HTTPS, Ed25519-signed requests ▲ ▼ │ Agent on each server Worker │ fixed commands, no shell maintenance every 15 s ▼ systemd, ps, /proc … ``` | Part | What it does | | --- | --- | | Web interface | The React app you use in the browser. | | API | The Express API behind the web interface, the [CLI](https://docs.vaultpanel.net/cli), the [SDK](https://docs.vaultpanel.net/developers/sdk) and [plugins](https://docs.vaultpanel.net/developers/plugins). It runs as the unprivileged `vaultpanel` user. | | Worker | Background work: scheduled backups, webhook deliveries, alert rules, marking silent servers offline, timing out stuck jobs and pruning old data. | | MariaDB and Redis | The panel's own database and queue. On an installed panel they run in Docker on `127.0.0.1`, separate from any database your websites use. | | Agent | One program written in Rust on each server (`/usr/local/bin/vaultpanel-agent`, for x86-64 or arm64), running as the `vaultpanel-agent` service. It needs nothing else installed, Node.js included. | ## The agent connects out Agents open every connection themselves, so a managed server needs no inbound port for the panel. Every 15 seconds an agent sends a heartbeat with system information, metrics and the state of its services, and it long-polls the panel for work. Each agent has its own Ed25519 key pair. It signs every request (method, path, timestamp, nonce and a hash of the body), and the panel checks the signature, a five-minute clock window and that the nonce was never used before. From agent 0.36.0, the agent runs as its own unprivileged user. A separate root helper, `vaultpanel-agent-helper`, runs the jobs; it has no connection to the panel and checks every job's signature itself. ## Every change is a signed job When you create a website, deploy an app or restart a service, the panel turns it into a job: 1. The panel checks the operation is in the catalog, that you have the permission for it and that the parameters are valid. It refuses a duplicate of a job that is still running. 2. When the agent claims the job, the panel sends it in an envelope signed with the panel's key, which the agent pinned when it registered. 3. The agent verifies the signature, that the job is addressed to its server and has not expired, and validates the parameters again against its own allow-list. 4. It runs fixed commands without a shell, streams the log back and reports the result. There is no endpoint that runs arbitrary commands, on the panel or on the agent. The one exception by design is the browser [terminal](https://docs.vaultpanel.net/guides/servers/terminal), which only owners can open. Jobs are stored in the panel's database, so you can follow each one live and read its log afterwards under **Monitoring > Jobs**. Passwords, environment values and file contents in a job's parameters are redacted once the job ends. ## The panel's own server The server the panel is installed on connects itself. Before the API starts, a short step running as root adds the server to the panel (marked **This server**), writes the agent's identity and installs or updates the agent. You never run an install command for it, and its agent is updated automatically when the panel is. ## Learn more - [Architecture](https://docs.vaultpanel.net/developers/architecture) - [The agent](https://docs.vaultpanel.net/developers/agent) - [Security](https://docs.vaultpanel.net/guides/security) - [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers) --- # System requirements URL: https://docs.vaultpanel.net/getting-started/system-requirements > Supported operating systems, memory, ports and network access for the VaultPanel server and the servers it manages. VaultPanel runs on one server (the panel's own server) and manages any number of servers through an agent. A fresh server is the best place to install it. ## The panel's server | Requirement | Details | | --- | --- | | Operating system | Ubuntu 22.04, 24.04 or 26.04 LTS, or Debian 12 or 13. | | Init system | systemd. Containers without systemd are not supported. | | Package manager | apt. The installer refuses systems without it. | | Access | Run the installer as root. | | Packages | An up-to-date system with `curl`, `wget` and `sudo` installed. Run `apt update && apt -y upgrade && apt -y install curl wget sudo` before the installer (see [Installation](https://docs.vaultpanel.net/getting-started/installation)). | | Memory | 2 GB or more is recommended. The installer warns below roughly 900 MB. | Other Ubuntu and Debian releases are not tested: the installer warns and continues. Any other Linux distribution is refused. ## Ports The installer refuses to start when one of these ports is already taken by something other than VaultPanel. | Port | Used by | Listens on | | --- | --- | --- | | `8090` | The panel (web interface and API, HTTPS). Change it with `--port`. | All interfaces | | `8091` | Plain HTTP for this server's own use: the local agent, the panel domain's NGINX and the `vaultpanel` command. By default, the panel port + 1. | `127.0.0.1` only | | `3307` | The panel's own MariaDB, in Docker. | `127.0.0.1` only | | `6379` | The panel's own Redis, in Docker, with a password. | `127.0.0.1` only | | `3306` | The MariaDB for your websites and apps, when the installer sets one up. Checked only when it installs MariaDB. | MariaDB's own setting | Your websites also need ports `80` and `443` once NGINX is installed, and Let's Encrypt must be able to reach port 80 to issue certificates. When UFW is active, the installer opens the panel's port in it. ## What the installer sets up | Software | Source | | --- | --- | | Node.js 22 | NodeSource, installed system-wide at `/usr/bin/node`. A Node.js installed with nvm under `/root` is never used. | | Docker with Docker Compose | Docker's install script from `get.docker.com`. An existing Docker, including the snap, is reused. | | MariaDB for websites and apps | The system's packages when they carry the chosen version, otherwise MariaDB's repository (`deb.mariadb.org`). See [the database for websites and apps](https://docs.vaultpanel.net/getting-started/installation#choose-the-database-for-websites-and-apps). | | The `vaultpanel` package | VaultPanel's signed package repository at `installer.vaultpanel.net/apt`. Nothing is downloaded from GitHub or built on the server. | The installer also looks up the server's public IPv4 address (from `api.ipify.org`, falling back to the server's own address) to build the panel's first address. ## Database for websites and apps The panel keeps its own database in Docker on port `3307`. Separately, the installer can set up a MariaDB server on port `3306` for your websites and apps. Choose its version with `DB_ENGINE`: | System | `DB_ENGINE` values (newest first) | | --- | --- | | Ubuntu 26.04 LTS | `MARIADB_12.3`, `MARIADB_11.8` | | Ubuntu 24.04 LTS | `MARIADB_12.3`, `MARIADB_11.4`, `MARIADB_10.11` | | Ubuntu 22.04 LTS | `MARIADB_11.4`, `MARIADB_10.11`, `MARIADB_10.6` | | Debian 13 | `MARIADB_12.3`, `MARIADB_11.8` | | Debian 12 | `MARIADB_12.3`, `MARIADB_11.4`, `MARIADB_10.11` | `DB_ENGINE=NONE` installs no database server. MySQL 8.4 and 8.0 come in a later version; the installer refuses `MYSQL_` values until then. ## Other servers you connect Servers you add to the panel run only the agent. They need: - 64-bit Linux with systemd, on x86-64 or arm64, run as root for the install, - `curl`, - outbound HTTPS to the panel's address. The agent connects out, so the server needs no inbound port for the panel. One-click software installs (NGINX, PHP, Certbot, MariaDB and the rest) use apt, so they work on Ubuntu and Debian. On other systems, install the packages yourself and the agent picks them up within a few minutes. ## Browsers The panel serves HTTPS from its first start with a self-signed certificate, so your browser warns once. Check the certificate's SHA-256 fingerprint against the one the installer printed, then continue. For a certificate browsers trust, [give the panel a domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain#put-the-panel-on-a-domain). --- # Installation URL: https://docs.vaultpanel.net/getting-started/installation > Install VaultPanel on a fresh Ubuntu or Debian server with the checked one-command installer, and choose its options. The installer sets VaultPanel up on a fresh server and runs it as a service that starts at boot. It takes a few minutes and ends by printing the panel's address and a setup token. Check the [system requirements](https://docs.vaultpanel.net/getting-started/system-requirements) first: Ubuntu 22.04, 24.04 or 26.04, or Debian 12 or 13, with systemd, run as root. ## Install ### Update the system and install the required packages Before running the installer, update the system and install the packages the install command needs: `curl` downloads the installer, and `sudo` runs it. As root: ```bash apt update && apt -y upgrade && apt -y install curl wget sudo ``` ### Download, check and run the installer Choose your system and the database server for your websites and apps. The command carries the current release's checksum, which changes with each release; each release publishes it at [github.com/VaultPanel/packages](https://github.com/VaultPanel/packages) and [installer.vaultpanel.net](https://installer.vaultpanel.net). | System | `DB_ENGINE` (the first is the default) | | --- | --- | | Ubuntu 26.04 LTS | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.8` (MariaDB 11.8) | | Ubuntu 24.04 LTS | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11) | | Ubuntu 22.04 LTS | `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11), `MARIADB_10.6` (MariaDB 10.6) | | Debian 13 | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.8` (MariaDB 11.8) | | Debian 12 | `MARIADB_12.3` (MariaDB 12.3), `MARIADB_11.4` (MariaDB 11.4), `MARIADB_10.11` (MariaDB 10.11) | `DB_ENGINE=NONE` installs no database server. Copy the current checksum from https://github.com/VaultPanel/packages: ```bash curl -sS https://installer.vaultpanel.net/v2/install.sh -o install.sh; \ echo " install.sh" | \ sha256sum -c && sudo DB_ENGINE=MARIADB_12.3 bash install.sh ``` `DB_ENGINE` chooses the [database server for your websites and apps](https://docs.vaultpanel.net/getting-started/installation#choose-the-database-for-websites-and-apps); without it, the installer takes the newest MariaDB for your system. MySQL 8.4 and 8.0 come in a later version. ### Note the address and setup token When it finishes, the installer prints the panel's address, a setup token and the certificate's fingerprint: ```text VaultPanel is installed. Open: https://203.0.113.10:8090/setup Setup token: 15d59a807f148df64628dd4ca0abd16c (creates the owner account; it stops working once you have) Database: MariaDB 12.3 for websites and apps The panel uses a self-signed certificate, so your browser warns once: check that it shows this SHA-256 fingerprint, then continue. For a trusted certificate, give the panel a domain: System > Panel Domain. On this server: vaultpanel shows the address and status; vaultpanel help lists the rest. ``` Lost it? `sudo vaultpanel` shows the address, and `sudo vaultpanel setup-token` shows the token until the owner account exists. ### Open the panel Open the address in your browser. It warns about the certificate once: check that the SHA-256 fingerprint it shows matches the one the installer printed, then continue. `sudo vaultpanel https` shows the fingerprint again. Paste the setup token and create the owner account. The server the panel runs on is already connected and shows as **This server**. Continue with the [quick start](https://docs.vaultpanel.net/getting-started/quick-start). ## Choose the database for websites and apps `DB_ENGINE` chooses the database server the installer sets up for your websites, apps and the app installer (WordPress, Joomla, Drupal, Laravel), on port `3306`. The panel's own database is separate: a MariaDB in Docker on port `3307`. | System | `DB_ENGINE` | | --- | --- | | Ubuntu 26.04 LTS | `MARIADB_12.3`, `MARIADB_11.8` | | Ubuntu 24.04 LTS | `MARIADB_12.3`, `MARIADB_11.4`, `MARIADB_10.11` | | Ubuntu 22.04 LTS | `MARIADB_11.4`, `MARIADB_10.11`, `MARIADB_10.6` | | Debian 13 | `MARIADB_12.3`, `MARIADB_11.8` | | Debian 12 | `MARIADB_12.3`, `MARIADB_11.4`, `MARIADB_10.11` | - Without `DB_ENGINE`, a new install gets the newest MariaDB for its system (the first in its row). An update installs nothing unless `DB_ENGINE` asks. - `DB_ENGINE=NONE` installs no database server. You can install MariaDB later from the server's **Database server** card in the panel. - When the system's own packages have the chosen version, they are used. Otherwise the installer adds MariaDB's repository (`/etc/apt/sources.list.d/vaultpanel-mariadb.list`, from `deb.mariadb.org`) after checking that its signing key has MariaDB's fingerprint. Security updates then come with `apt upgrade`. - A server that already has MariaDB or MySQL keeps it, and updating VaultPanel never changes the database server. - MySQL 8.4 and 8.0 come in a later version; the installer refuses `MYSQL_8.4` and `MYSQL_8.0` until then. ## Installer options Pass options after `bash install.sh`, or after `bash -s --` when the installer is piped from curl: ```bash sudo DB_ENGINE=MARIADB_12.3 bash install.sh --port 9000 ``` | Option | Environment variable | Default | What it does | | --- | --- | --- | --- | | `--db-engine ` | `DB_ENGINE` | the newest MariaDB | Database server for websites and apps, or `NONE`. | | `--port ` | `VAULTPANEL_PORT` | `8090` | Port the panel listens on (1 to 65535). | | `--url
` | `VAULTPANEL_URL` | `https://:` | Address people open the panel at, such as `https://panel.example.com`. | | `--version ` | `VAULTPANEL_VERSION` | the newest | Version of the `vaultpanel` package to install, or `latest`. | | `--http` | `VAULTPANEL_HTTPS=off` | | Serve plain HTTP instead of HTTPS. Not recommended. | | `--https` | `VAULTPANEL_HTTPS=on` | | Turn on HTTPS for a panel installed before it was the default. | `--port`, `--url` and `--http` choose how a **new** panel is set up. Afterwards, change the address with [`vaultpanel url`](https://docs.vaultpanel.net/cli/server-command) and HTTPS with [`vaultpanel https`](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). Because every option is also an environment variable, a downloaded copy can run as: ```bash sudo VAULTPANEL_PORT=9000 bash install.sh ``` ## Checking what you install - **The installer.** Each release publishes `install.sh` at `installer.vaultpanel.net`, with its SHA-256 in the [VaultPanel/packages](https://github.com/VaultPanel/packages) README and at `https://installer.vaultpanel.net/v2/install.sh.sha256`. The install command above checks it before running anything. - **The package repository.** The installer adds VaultPanel's repository only after checking that its signing key has VaultPanel's fingerprint, and apt then checks every package against that key: ```text 79B3 4D79 D2A7 D0DE 54A3 D906 B62A 47C2 ED27 75A6 ``` The repository is in `/etc/apt/sources.list.d/vaultpanel.list` and the key in `/etc/apt/keyrings/vaultpanel.asc`. - **MariaDB's repository**, when it is needed, is trusted only with MariaDB's signing key fingerprint, `177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8`. ## What the installer does 1. Installs `curl`, `openssl`, Node.js 22 from NodeSource (system-wide, at `/usr/bin/node`) and Docker with Docker Compose. An existing Docker, the snap included, is reused. 2. Installs the MariaDB chosen with `DB_ENGINE` for websites and apps, unless the server already has a database server. 3. Adds VaultPanel's package repository and installs the `vaultpanel` package: the panel, ready to run, in `/opt/vaultpanel`. The package then sets the panel up (steps 4 to 10), on a new install and after every upgrade. 4. Creates the `vaultpanel` system user the panel runs as, and writes `/opt/vaultpanel/.env` with new random secrets: the encryption key, the setup token, and the passwords of the panel's database and Redis. Root writes the file; the `vaultpanel` group may only read it. 5. Makes a self-signed certificate for the panel's port in `/etc/vaultpanel/tls/`, valid for 10 years. The panel can read the key but not change it. 6. Starts the panel's own MariaDB (`127.0.0.1:3307`) and Redis (`127.0.0.1:6379`, with a password) in Docker. They come back after a reboot and stay separate from the MariaDB for websites and apps. 7. Updates the panel's database to the installed version. 8. Installs two systemd services that start at boot: `vaultpanel` (the web interface and API) and `vaultpanel-worker` (background jobs). Both run as the unprivileged `vaultpanel` user in a systemd sandbox: no capabilities, a read-only system, and write access only to the panel's folder, `/var/lib/vaultpanel/panel`. Only one step runs as root: before the panel starts, it connects this server to the panel by installing or updating the agent. 9. Schedules a [daily backup of the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) (`vaultpanel-backup.timer`). 10. Adds the [`vaultpanel` command](https://docs.vaultpanel.net/cli/server-command) and a login banner, and opens the panel's port in UFW when the firewall is on. Running the installer again is safe: it keeps `.env` and all data, and installs a newer package when there is one. ## Install from a copy of the repository To try code that is not released yet on a test server, clone the VaultPanel repository with a GitHub account that has access, and run the installer from the copy. It installs that copy's code into `/opt/vaultpanel` and builds it on the server; later updates come from the same repository. ```bash git clone https://github.com/VaultPanel/VaultPanel.git sudo bash VaultPanel/install.sh ``` These options only apply to an install from a copy: | Option | Environment variable | Default | What it does | | --- | --- | --- | --- | | `--dir ` | `VAULTPANEL_DIR` | `/opt/vaultpanel` | Where VaultPanel is installed. | | `--repo ` | | the VaultPanel repository | Git repository to install from. | | `--branch ` | `VAULTPANEL_BRANCH` | | Install a branch, such as `main`, instead of a release tag. Not together with `--version`. | ## If the install fails The installer stops at the first problem and says what to fix, starting with `VaultPanel was not installed:`. Common cases: | Message | What to do | | --- | --- | | `port 8090 is already in use` | Stop what uses it, or pick another port with `--port`. | | `port 3306 is already in use, so MariaDB cannot start there` | Stop what uses it, or install with `DB_ENGINE=NONE`. | | `the vaultpanel package did not install` | Fix what the lines above it say, then finish with `sudo dpkg --configure -a`. | | `the panel did not start` | The log above the message says why; `vaultpanel logs` shows more. | More cases are in [Troubleshooting](https://docs.vaultpanel.net/troubleshooting). --- # Quick start URL: https://docs.vaultpanel.net/getting-started/quick-start > From the setup token to your first website with a Let's Encrypt certificate, then a second server connected to the panel. This walkthrough takes a freshly installed panel to a live website with HTTPS. It assumes you have run the [installer](https://docs.vaultpanel.net/getting-started/installation) and have its setup token, and that you own a domain whose DNS you can change. ### Create the owner account Open the address the installer printed, ending in `/setup`. Under **Set up VaultPanel**, fill in: - **Setup token**: the token the installer printed (`sudo vaultpanel setup-token` shows it again), - **Your name** and **Email**, - **Password** (at least 12 characters) and **Confirm password**. Click **Create owner account**. The owner has full control of the panel, and the setup token stops working. ![The Set up VaultPanel page with the setup token, name, email, password and confirm password fields filled in above the Create owner account button](https://docs.vaultpanel.net/screenshots/setup-light.png) ### Turn on two-factor sign-in Recommended for the owner. Open the account menu in the top-right corner, choose **Account & security**, then **Set up two-factor sign-in**. Add the **Setup key** to your authenticator app (or use **Open in authenticator app** on a phone), enter the **Code from the app** and click **Turn on**. Save the recovery codes the panel shows next: they are the way back in if you lose your phone. See [sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor) for policies that require it for everyone. ### Find the panel's own server Open **Infrastructure > Servers**. The server the panel runs on is already connected, marked **This server**, with its metrics updating. Click it to see its overview, services, processes and the rest. ### Install the web stack Websites need NGINX, and HTTPS needs Certbot. On the server's page, open the **Websites** tab. The **Web stack** card lists NGINX, PHP-FPM and Certbot with their state. Click **Install all missing** (or **Install** next to one of them) and confirm. The agent installs the packages with apt, which takes a few minutes; you can follow the job as it runs. NGINX starts serving a default page on port 80 once installed. ### Point your domain at the server At your DNS provider, add an `A` record for your domain (for example `example.com`, and `www.example.com` if you want it) pointing at the server's public IP address. Make sure ports 80 and 443 are open in any firewall in front of the server. DNS changes can take a while to reach everyone. You can create the website now and issue the certificate once the domain resolves. ### Create the website Open **Web > Websites** and click **New website**: | Field | What to enter | | --- | --- | | **Server** | **This server**, or another connected server. | | **Type** | **Static site** (files served as they are), **PHP site** (PHP-FPM, running as the site user) or **Reverse proxy** (forwards requests to an app on a local port). | | **Domain** | `example.com` | | **Site name** | Filled in from the domain. It is also the Linux user and folder name, and cannot be changed later. | | **More domains** | Optional, one per line, such as `www.example.com`. | | **PHP version** | PHP sites only. | | **App port** | Reverse proxies only: requests go to `127.0.0.1` on this port. | | **Document root** | Static and PHP sites: the folder inside the site that is served. | Click **Create website**. VaultPanel creates a Linux user and folder for the site, configures NGINX (and PHP-FPM for PHP sites), then checks that the site answers. ### Turn on HTTPS Open the website and its **SSL** tab. With **Let’s Encrypt** selected: 1. Check **Email for Let’s Encrypt**: Let's Encrypt writes there if a renewal ever fails. 2. Keep **Redirect HTTP to HTTPS** and **Check domains first** ticked. The check confirms each domain reaches this server before asking Let's Encrypt, so a DNS mistake does not count against its rate limits. 3. Optionally tick **Use the Let’s Encrypt staging service** to try the setup with a test certificate first. 4. Click **Issue certificate**. Certbot renews the certificate automatically. [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates) covers wildcard and uploaded certificates. ### Upload your site Use the website's **Files** tab or **Data & Files > File Manager** to upload files, or [deploy from Git](https://docs.vaultpanel.net/guides/websites/git-deploy). To run an app behind the site instead, see [Applications](https://docs.vaultpanel.net/guides/applications). ### Connect another server On **Infrastructure > Servers**, click **Add server**, give it a **Name** and click **Add server**. The panel shows an **Install command**: ```bash curl -fsSL --pinnedpubkey 'sha256//…' -k https://203.0.113.10:8090/api/v1/agent/install.sh \ | sudo bash -s -- --panel https://203.0.113.10:8090 --token vpe_… --panel-pin 'sha256//…' ``` Run it on the other server as root. That server needs systemd on x86-64 or arm64; the agent is one program and needs no Node.js. The token works once and expires after 60 minutes by default; create a new one from the server's **Settings** tab if it runs out. With a self-signed panel certificate the command carries its public key pin, so the agent trusts exactly your panel's certificate. [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers) has the details. ## Next steps ![The command menu open over the dashboard, with a Jump to a page, server or action search box and a Go to list of Dashboard, AI Assistant, Servers, Server Groups, Services, Terminal, Bulk Actions, Websites, DNS Zones, SSL Certificates, Email and Applications](https://docs.vaultpanel.net/screenshots/command-palette-light.png) *Press Ctrl K (Cmd K on a Mac) anywhere in the panel to jump to a server, a page or an action.* - [Give the panel a domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain) - [Back up the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) - [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles) - [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts) --- # Panel HTTPS and domain URL: https://docs.vaultpanel.net/getting-started/panel-https-and-domain > How the panel serves HTTPS on its own port with a pinned self-signed certificate, and how to move it to a domain with a trusted certificate. A new panel serves HTTPS on its own port from the first start, with a self-signed certificate the installer made for the server. Passwords, the setup token and session cookies never cross the network in clear. For a certificate browsers trust, add a domain on top. ## HTTPS on the panel's port The self-signed certificate is the same approach Cockpit, Webmin and Proxmox use. Browsers warn about it once; the installer prints its SHA-256 fingerprint so you can check the certificate is yours, and `sudo vaultpanel https` shows it again. - **Adding servers works without a domain.** The **Add server** command carries the certificate's public key pin (`curl --pinnedpubkey … -k` and `--panel-pin`). The agent installer checks it, saves the certificate as `/etc/vaultpanel-agent/panel-ca.pem`, and the agent trusts exactly that certificate. A different certificate, such as one from someone in the middle, is refused. - **Plain HTTP stays on loopback.** Port `8091` (`VAULTPANEL_LOOPBACK_PORT`) answers plain HTTP on `127.0.0.1` only, for the agent on this server, the panel domain's NGINX and the `vaultpanel` command. It never leaves the machine. - **No HSTS on an IP address**, so people can always accept the self-signed certificate. A panel domain with a trusted certificate gets HSTS. The certificate lives in `/etc/vaultpanel/tls/` and is valid for 10 years. It names `localhost`, the server's host name and addresses, and the host of the panel's address. ### Manage it with `vaultpanel https` | Command | What it does | | --- | --- | | `vaultpanel https` | Whether HTTPS is on, the certificate's names, expiry, SHA-256 fingerprint and agent pin. Run it with `sudo` to read the certificate. | | `sudo vaultpanel https on` | Turns HTTPS on for a panel installed with plain HTTP (before it was the default). It prints the command to run on each other server, so their agents move to HTTPS. | | `sudo vaultpanel https renew` | A new certificate with this server's current names and addresses (for example after its IP address changed), made with the same key so the pin stays the same. Run the printed command on each other server so its agent gets the new certificate. | | `sudo vaultpanel https off` | Back to plain HTTP. Not recommended. | Turning HTTPS on also moves a panel domain added earlier to the loopback port, so it keeps working. ## Put the panel on a domain Give the panel a domain such as `cp.example.com` with a Let's Encrypt certificate. NGINX on the panel's own server answers for the domain and passes requests to the panel's loopback port. ### Point the domain at the server Add a DNS `A` record for the domain pointing at the server's public IP address, and make sure ports 80 and 443 are open. If NGINX or Certbot is missing, install the web stack from **This server**'s **Websites** tab first. ### Add the domain Open **System > Panel Domain**. Under **Domain**, type the domain and click **Add domain**. **Panel port** is already filled in: the panel's loopback port (`8091`), or `8090` on a plain-HTTP panel. ### Get a certificate Under **SSL certificate**, enter the **Email for Let’s Encrypt**. Keep **Redirect HTTP to HTTPS** and **Check the domain first** ticked. Tick **Start with a test certificate** and click **Get a test certificate** to try the setup first: failed real requests count against Let's Encrypt's limits. When it works, click **Get the trusted certificate**. Or leave it unticked and click **Get certificate** straight away. **Renew now** renews a trusted certificate by hand; Certbot renews it automatically. ### Use the domain as the panel's address Under **Panel address**, click **Use https://cp.example.com**. Agent install commands, password reset links and deploy webhooks then use the domain. Sign in at `https://cp.example.com`. The `https://SERVER_IP:8090` address keeps working, so a DNS or certificate mistake never locks you out. The domain and the server address each keep their own sign-in. Once the domain works, you can close port 8090 to the outside in the firewall. Agents already connected keep the address they were installed with; new install commands use the domain. ### From the command line instead `vaultpanel url` sets the panel's address from the server: ```bash sudo vaultpanel url https://cp.example.com ``` With an `https://` address it also makes sign-in cookies HTTPS-only for every address, so the plain HTTP address stops letting you sign in, and agents on other servers must reach the panel over HTTPS from then on. When the address uses the panel's own port and the certificate does not name its host yet, the command tells you to run `sudo vaultpanel https renew`. > **Note:** The domain set up under **System > Panel Domain** is managed only there. It does not appear among your websites, domains and certificates. --- # Updating URL: https://docs.vaultpanel.net/getting-started/updating > Update VaultPanel to a new release with a backup taken first, roll back a bad update, and keep agents on other servers current. VaultPanel is installed as the `vaultpanel` package from VaultPanel's APT repository, so updates are package upgrades. Each one backs the panel up first, so you can roll back. ## Update the panel ```bash sudo vaultpanel update # the newest version sudo vaultpanel update --version v0.3.0 # a given version ``` `vaultpanel update` installs the newer `vaultpanel` package with apt: 1. Before the package changes version, it backs the panel up (database, settings and certificate, labelled `pre-update`; the last 3 are kept) and notes the version it had. 2. After installing, it updates the panel's database and restarts the panel and worker. When there is nothing newer, it says so and stops. `--force` sets the same version up again. It refuses to install a version older than the one installed; use `vaultpanel rollback` for that. `sudo apt upgrade` updates VaultPanel the same way, along with the system's other packages. The panel's own agent is updated together with the panel. See the [changelog](https://docs.vaultpanel.net/changelog) for what each release changes. ## Roll back an update If an update goes wrong: ```bash sudo vaultpanel rollback ``` It puts back the database from the backup taken just before the last update, then installs the version from before it again. Changes made in the panel since that update are lost, so it asks you to type `rollback` first (`--yes` skips the question). The package repository keeps the newest 5 versions, so a rollback works only while the earlier version is still there. > **Warning:** If no backup from before the update is found, the database stays as it is. When the newer version changed the database, the older one may not start: restore a [panel backup](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) from before the update instead. ## Agents on other servers The agent on the panel's own server is updated with the panel. When a release brings a newer agent, each other server's **Overview** tab shows **Agent update available**: - Agents from v0.7.0 on can be updated from the panel: click **Update agent**. The agent downloads the new version from the panel, checks it and restarts itself. To update several servers at once, use **Infrastructure > Bulk Actions** (see [server groups](https://docs.vaultpanel.net/guides/servers/server-groups)). - Older agents show an **Upgrade command** to run once on the server. It updates the agent in place and keeps its registration. ## A panel installed from a copy of the repository A panel [installed from a copy of the repository](https://docs.vaultpanel.net/getting-started/installation#install-from-a-copy-of-the-repository) has no package. It updates from that copy instead: ```bash sudo vaultpanel update # the newest release tag sudo vaultpanel update --branch main # the newest commit of a branch ``` `vaultpanel update` fetches the newest release tag (or the branch it follows), backs up, and builds it on the server; `vaultpanel rollback` goes back to the commit it had. Or update the copy and run its installer again: ```bash git -C VaultPanel pull sudo bash VaultPanel/install.sh ``` --- # Backing up the panel URL: https://docs.vaultpanel.net/getting-started/backing-up-the-panel > Daily backups of VaultPanel itself, with its database, secret key and certificate, and how to restore one on the same or a new server. Websites, apps and databases have their own [backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups). This page is about the backup of **VaultPanel itself**: without it, losing the server means losing every account and setting, and the key that decrypts them. ## What a backup holds Each backup is one file in `/var/backups/vaultpanel-panel` (root only, mode `600`) with a `.sha256` checksum next to it. It holds: - the panel's database, as a `mariadb-dump`, - `.env`, including `VAULTPANEL_SECRET_KEY`, which decrypts two-factor secrets, the agent signing key and every stored password, - the HTTPS certificate and key, so agents on other servers keep trusting a restored panel, - terminal recordings and the panel domain list, - a `VERSION` file with when, where and from which version it was made. ## When backups are made | Trigger | Label | Kept | | --- | --- | --- | | Every day, by `vaultpanel-backup.timer` | `scheduled` | `VAULTPANEL_BACKUP_KEEP` (14 by default) | | `sudo vaultpanel backup` | `manual` | all, unless you pass `--keep` | | Before every update | `pre-update` | the last 3 | | Before every restore | `before-restore` | the last 3 | Files are named after the time and label, such as `vaultpanel-20261020-031500-scheduled.tar.gz`. ## Make a backup now ```bash sudo vaultpanel backup ``` | Option | What it does | | --- | --- | | `--dir ` | Write the backup to another folder. | | `--keep ` | Keep only the newest `n` backups with this label. | | `--label ` | Label the backup (`a-z`, `0-9` and `-`, at most 32 characters). | The backup needs the panel's MariaDB container that the installer set up. If you run the panel on your own database, back that database up yourself. ## Settings Set these in `/opt/vaultpanel/.env`. The next backup uses them; no restart is needed. | Setting | Default | What it does | | --- | --- | --- | | `VAULTPANEL_BACKUP_DIR` | `/var/backups/vaultpanel-panel` | Where backups go. | | `VAULTPANEL_BACKUP_KEEP` | `14` | Daily backups kept. | | `VAULTPANEL_BACKUP_PASSPHRASE_FILE` | | A file holding a passphrase. Backups are then encrypted (AES-256, PBKDF2) as `.tar.gz.enc`. | | `VAULTPANEL_BACKUP_UPLOAD` | | A command run after each backup with the file as `$1`, to copy it off the server. | For example, to copy every backup to another machine: ```ini VAULTPANEL_BACKUP_UPLOAD=rclone copy "$1" remote:vaultpanel ``` If the upload command fails, the backup is still made and the command prints a warning. > **Keep a copy off the server:** A backup on the same disk does not help when the server is gone. Copy backups somewhere only you can read, and encrypt them when they go to someone else's storage: they hold the panel's secret key. ## Restore a backup On the same server, or on a new one installed with the [installer](https://docs.vaultpanel.net/getting-started/installation): ```bash sudo vaultpanel restore /var/backups/vaultpanel-panel/vaultpanel-20261020-031500-scheduled.tar.gz ``` The restore: 1. checks the file against its `.sha256` checksum, when there is one, 2. decrypts an `.enc` backup with `VAULTPANEL_BACKUP_PASSPHRASE_FILE`, or asks for the passphrase, 3. asks you to type `restore` (`--yes` skips the question), 4. takes a safety backup of the current panel, 5. puts back the database, the settings and secret key, the certificate and the panel's files, 6. updates the database to the installed version and restarts the panel. The server keeps its own database and Redis passwords, ports and folders, so a backup from an old server restores onto a new one. After restoring on a new server: - If the new server has another address, run `sudo vaultpanel url
`, and `sudo vaultpanel https renew` so the certificate names it. - A backup from a newer VaultPanel needs that version first: `sudo vaultpanel update --version `, then restore again. --- # Uninstalling URL: https://docs.vaultpanel.net/getting-started/uninstalling > Remove VaultPanel and its agent from a server, keep or delete the panel's data, and decide what happens to the websites it created. Removing VaultPanel stops the panel and its services. By default the panel's data is kept, and websites, apps and databases it created on the server are left as they are. > **Warning:** Take a [panel backup](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) and copy it off the server first if you might want the panel back. ## Before you start If you installed the free AI model on this server, remove it first under **System > Assistant Settings** with **Remove Ollama and all models**. ## Remove the panel ```bash sudo docker compose -p vaultpanel --env-file /opt/vaultpanel/.env -f /opt/vaultpanel/docker/compose.prod.yml down sudo apt remove vaultpanel sudo systemctl disable --now vaultpanel-agent vaultpanel-agent-helper sudo rm -f /etc/systemd/system/vaultpanel-agent.service /etc/systemd/system/vaultpanel-agent.service.root \ /etc/systemd/system/vaultpanel-agent-helper.service \ /etc/apt/sources.list.d/vaultpanel.list /etc/apt/keyrings/vaultpanel.asc sudo systemctl daemon-reload sudo rm -f /usr/local/bin/vaultpanel-agent /usr/local/bin/vaultpanel-agent.previous \ /etc/cron.d/vaultpanel /usr/local/lib/vaultpanel/acme-dns-hook ``` | Line | What it does | | --- | --- | | `docker compose … down` | Stops the panel's own MariaDB and Redis containers. | | `apt remove vaultpanel` | Stops the panel and worker, and removes their services, the backup timer, the `vaultpanel` command and the login banner. | | `systemctl disable --now …` and the first `rm -f …` | Stops this server's agent and its root helper, and removes their services and VaultPanel's package repository. `vaultpanel-agent.service.root` is the agent's original root service, kept while the agent runs as its own user. | | The last `rm -f …` | Removes the agent's program and the copy kept from its last update, the cron jobs the panel set up, and Certbot's hook for wildcard certificates. | A panel installed from a copy of the repository has no package. Stop and remove `vaultpanel`, `vaultpanel-worker` and `vaultpanel-backup.timer` the same way as the agent. ## Delete the panel's data too The steps above keep the panel's data. To delete it as well (the database volume, settings and secrets): 1. Add `-v` to the first line: `docker compose … down -v`. 2. Remove VaultPanel's folders, the website, app and database backups, the panel's own backups, and the panel's user: ```bash sudo rm -rf /opt/vaultpanel /etc/vaultpanel /etc/vaultpanel-agent \ /var/lib/vaultpanel /var/cache/vaultpanel /var/backups/vaultpanel /var/backups/vaultpanel-panel sudo userdel vaultpanel sudo userdel vaultpanel-agent ``` `/etc/vaultpanel-agent` holds the agent's registration, key and settings, and `vaultpanel-agent` is the user the agent runs as. A server that still ran the old Node.js agent also has `/opt/vaultpanel-agent`; remove it too. ## What stays on the server Websites, apps and databases the panel created are left as they are, and so is the MariaDB for websites and apps. To remove that MariaDB as well, which deletes its databases: ```bash sudo apt purge mariadb-server mariadb-client sudo rm -f /etc/apt/sources.list.d/vaultpanel-mariadb.list /etc/apt/keyrings/vaultpanel-mariadb.asc ``` ## Disconnect another server To stop managing a server without uninstalling the panel, remove it from the panel: on its page, open **Settings** and click **Remove server**. Removing a server revokes its agent, which then stops. To also take the agent off that server, run there: ```bash sudo systemctl disable --now vaultpanel-agent vaultpanel-agent-helper sudo rm -f /etc/systemd/system/vaultpanel-agent.service /etc/systemd/system/vaultpanel-agent.service.root \ /etc/systemd/system/vaultpanel-agent-helper.service sudo systemctl daemon-reload sudo rm -f /usr/local/bin/vaultpanel-agent /usr/local/bin/vaultpanel-agent.previous \ /etc/cron.d/vaultpanel /usr/local/lib/vaultpanel/acme-dns-hook sudo rm -rf /etc/vaultpanel-agent /var/lib/vaultpanel /var/cache/vaultpanel sudo userdel vaultpanel-agent ``` This removes the agent's program and services, its registration and settings (`/etc/vaultpanel-agent`), the cron jobs the panel set up, and the agent's state and cache. Websites, apps and databases stay, and so do their backups in `/var/backups/vaultpanel`: delete that folder too if you no longer need them. If the server still ran the old Node.js agent, also remove `/opt/vaultpanel-agent`. --- # Guides overview URL: https://docs.vaultpanel.net/guides > Task-based guides for everything VaultPanel manages, from servers and websites to apps, databases, DNS, email, backups, security and hosting customers. Each guide explains one part of the panel: what it does on your servers, the settings it offers and the steps to use it. If you have not installed VaultPanel yet, start with the [installation guide](https://docs.vaultpanel.net/getting-started/installation). ## Infrastructure - [Servers](https://docs.vaultpanel.net/guides/servers) - [Security](https://docs.vaultpanel.net/guides/security) ## Hosting - [Websites](https://docs.vaultpanel.net/guides/websites) - [Applications](https://docs.vaultpanel.net/guides/applications) - [Databases](https://docs.vaultpanel.net/guides/databases) - [DNS & Email](https://docs.vaultpanel.net/guides/dns-and-email) ## Operations - [Backups & Automation](https://docs.vaultpanel.net/guides/backups-and-automation) - [AI Assistant](https://docs.vaultpanel.net/guides/ai-assistant) ## Business - [Hosting & Billing](https://docs.vaultpanel.net/guides/hosting-and-billing) --- # Servers URL: https://docs.vaultpanel.net/guides/servers > Manage connected Linux servers from one place, including services, processes, installed software, reboots and the jobs that run on them. A server is any Linux machine connected to the panel through the VaultPanel agent. The server the panel runs on connects itself and is marked **This server**; every other server is added with a one-line install command. Everything the panel does on a server, from restarting a service to issuing a certificate, runs as a signed job through that agent. ## The server list **Infrastructure > Servers** lists every connected machine. Search by name, hostname or IP address, and filter by status or [server group](https://docs.vaultpanel.net/guides/servers/server-groups). With the `servers.bulk` permission you can tick several servers and choose **Run on selected** to start a [bulk action](https://docs.vaultpanel.net/guides/servers/server-groups#bulk-actions). | Status | Meaning | | --- | --- | | **Online** | The agent reports in with its heartbeat every 15 seconds. | | **Offline** | The agent has not reported for 90 seconds (`VAULTPANEL_AGENT_OFFLINE_SECONDS`). | | **Waiting for agent** | The server was added, but no agent has registered yet. | ![The Servers list with one server, vmi3756066 (This server), online on Ubuntu 24.04 at 5% CPU, 18% memory and 17% disk, running agent v0.50.1-rs.1 and last seen just now](https://docs.vaultpanel.net/screenshots/servers-light.png) ## The server page Open a server to see its tabs. Some tabs appear only when your role has the matching permission. | Tab | What it shows | Shown with | | --- | --- | --- | | **Overview** | Firing alerts, resources, usage charts, filesystems, the [self-check](https://docs.vaultpanel.net/guides/servers/self-check) and system details | Always | | **Services** | The systemd services the agent watches, with logs and start, stop and restart | Always | | **Processes** | A snapshot of running processes, with stop and kill | Always | | **Websites** | Websites on this server, the **Web stack** card and **PHP versions** | `websites.read` | | **Applications** | Apps on this server and the **App runtime** card | `applications.read` | | **Databases** | Databases on this server and the **Database server** card | `databases.read` | | **Automation** | Cron jobs, recent backups and the **Scheduler** card | `cron.read` or `backups.read` | | **Security** | Firewall, SSH, Fail2ban, security updates and the login message | `security.read` | | **Terminal** | A root shell in the browser | `servers.terminal` (owners) | | **Jobs** | Operations run on this server, with their logs | Always | | **Settings** | Name, groups, agent details, enrollment tokens and removal | Always | ### Overview - **Resources**: CPU with load averages, memory, disk usage of `/`, swap, network in and out, process count, uptime and how many watched services are running. - **Usage over time**: charts for CPU and memory, load average, disk and swap, and network. Pick a range of 1h, 6h, 24h, 7d, 30d or 90d. See [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts#metrics-and-history). - **Filesystems**: every mounted disk the agent found, with its usage. - **Self-check**: whether the panel's features will work on this server. See [Self-check](https://docs.vaultpanel.net/guides/servers/self-check). - **System**: hostname, public IP, operating system, kernel, architecture, memory, disk and agent version. When the panel carries a newer agent than the server runs, the Overview shows **Agent update available** with an **Update agent** button. See [Updating the agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#updating-the-agent). ## Services The **Services** tab lists the systemd units in the agent's `watchServices` list, with their state and whether they start at boot. For each service you can: - **Logs**: read the last 100, 200, 500 or 1000 lines from the systemd journal. - **Check**: read the unit's current state. - **Start** or **Stop**, and **Restart**. Each asks for confirmation and runs as a job. Managing services needs `servers.services`. The agent only manages units in its `allowedServices` list (by default common web, database, mail, DNS and security services such as `nginx`, `php*-fpm`, `mariadb`, `redis-server`, `docker`, `cron`, `ssh`, `ufw`, `fail2ban` and `pm2-*`). SSH can be restarted but never stopped, and the agent's own units, `vaultpanel-agent` and `vaultpanel-agent-helper`, can never be stopped or restarted through a job. **Infrastructure > Services** shows the watched services of every server in one list. Start, stop, restart and logs stay on each server's **Services** tab. ## Processes The **Processes** tab asks the agent for a snapshot of the top 50 processes, sorted by CPU or by memory. Listing processes needs `servers.processes`. With `servers.signal` (owners and admins by default) each process also has **Stop** (`SIGTERM`, the process may clean up) and **Kill** (`SIGKILL`, immediate). Before signalling, the agent checks that the process ID still belongs to the same command; if it changed, the job fails with `PROCESS_CHANGED`. The agent refuses kernel threads, itself and its parent, and core system processes: `systemd`, `init`, `sshd`, `systemd-journald`, `systemd-logind`, `systemd-udevd` and `dbus-daemon`. ## Server software Software the panel relies on is installed from fixed package lists with one click, from cards on the server's tabs. Installing needs `websites.manage`, an online server, and apt (Debian or Ubuntu); on other systems install the packages yourself and the agent picks them up within a few minutes. | Card | Tab | Components | | --- | --- | --- | | **Web stack** | Websites | NGINX, PHP-FPM, Certbot, and optionally Apache for `.htaccess` files | | **PHP versions** | Websites | PHP 7.4 and 8.0 to 8.5, side by side. See [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions). | | **App runtime** | Applications | Git, PM2, Python, and optionally Go, Ruby and Composer | | **Database server** | Databases | MariaDB, listening on `127.0.0.1` only | | **Scheduler** | Automation | Cron, which runs [cron jobs](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs) on their schedule | **Install all missing** installs every required component of a card at once. Optional components are installed only on their own. > **Note:** Apps and PM2 use a system-wide Node.js, in `/usr/local/bin` or `/usr/bin`; the agent itself does not need Node.js. If Node.js on the server lives only in a home folder (for example from nvm), the **App runtime** card asks you to install a system-wide Node.js first. ## Rebooting **Reboot**, at the top of the server page, restarts the whole machine. Every website and app on it is unavailable until it boots again. You type the server's name to confirm, and it needs `servers.reboot`. The agent reports success first, then reboots a few seconds later. A server owner can refuse reboots in the agent's policy (`allowReboot: false`). To restart several servers one at a time, use a [bulk action](https://docs.vaultpanel.net/guides/servers/server-groups#bulk-actions). ## Jobs Every operation is a job: a row you can follow live and read later with its full log. The **Jobs** tab shows the latest jobs on the server, and **Monitoring > Jobs** lists them across all servers. The panel refuses to queue an operation while the same one is already queued or running on that server. ## Settings The **Settings** tab holds: - **General**: rename the server (letters, numbers, spaces and `. _ - ( )`, up to 100 characters). - **Groups**: the [server groups](https://docs.vaultpanel.net/guides/servers/server-groups) it belongs to. - **Agent**: version, registration time and address, last contact and key fingerprint, and **New enrollment token**. - **Danger zone**: **Remove server**. See [Removing a server](https://docs.vaultpanel.net/guides/servers/connecting-servers#removing-a-server). ## Next steps - [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers) - [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts) - [Self-check](https://docs.vaultpanel.net/guides/servers/self-check) - [Terminal](https://docs.vaultpanel.net/guides/servers/terminal) - [Logs](https://docs.vaultpanel.net/guides/servers/logs) - [Server groups](https://docs.vaultpanel.net/guides/servers/server-groups) --- # Connecting servers URL: https://docs.vaultpanel.net/guides/servers/connecting-servers > Install the VaultPanel agent on a Linux server, understand how it runs and talks to the panel, keep it updated and remove it again. The panel manages a server through a small agent that runs on it as a systemd service. The agent connects out to the panel over HTTPS, so the server needs no open inbound port. It reports its state every 15 seconds and runs only operations the panel has signed, from a fixed allow-list, without a shell. ## Requirements - 64-bit Linux with systemd, on x86-64 or arm64, run as root to install. - `curl`. - Website, app, database and security operations target Debian and Ubuntu (apt, UFW, `www-data`, `/etc/php//fpm`). - The server must reach the panel's address over HTTPS. The agent is one program with nothing else to install: the server does not need Node.js for it. Node.js is only needed to run Node.js apps and PM2; install it system-wide for that (for example from NodeSource), not under a home folder. ## The panel's own server The server the panel runs on connects itself before the API starts. It appears in the list as **This server**, with no install command needed, and its agent is updated automatically whenever the panel is updated. - If you had already added this machine by hand, that server is marked as the panel's own instead of being added twice. - If you remove it from the panel, it is not added again on the next start. To connect it again, run `npm run connect-local -- --force` as root in the panel's folder. - `VAULTPANEL_LOCAL_AGENT=false` in the panel's `.env` turns the automatic connection off. ## Add a server ### Add it in the panel Open **Infrastructure > Servers** and click **Add server**. Give it a name such as `web-production-1` (letters, numbers, spaces and `. _ - ( )`). The rest of its details fill in once the agent connects. Adding servers needs `servers.manage`. ![The Add a server dialog with a Name field showing web-production-1 and the Cancel and Add server buttons](https://docs.vaultpanel.net/screenshots/add-server-light.png) ### Copy the install command The panel shows an install command with a one-time enrollment token (`vpe_…`). The command is shown only once. The token works once and expires after 60 minutes by default (`VAULTPANEL_ENROLLMENT_TTL_MINUTES`, from 5 minutes to 7 days). ### Run it on the server as root When the panel has a domain with a trusted certificate, the command looks like this: ```bash curl -fsSL https://panel.example.com/api/v1/agent/install.sh \ | sudo bash -s -- --panel https://panel.example.com --token vpe_… ``` A panel that still uses its own self-signed certificate (the default after installation) gives a pinned command instead: ```bash curl -fsSL --pinnedpubkey 'sha256//…' -k https://203.0.113.10:8090/api/v1/agent/install.sh \ | sudo bash -s -- --panel https://203.0.113.10:8090 --token vpe_… --panel-pin 'sha256//…' ``` `curl` accepts only the panel's public key, and the installer checks that the certificate the panel sends carries the pinned key before installing anything. It saves that certificate as `/etc/vaultpanel-agent/panel-ca.pem`, and the agent trusts exactly that certificate, with normal TLS checks. Someone in the middle with a different certificate is refused, so servers can be added safely before the panel has a domain. ### Wait for it to come online The installer downloads the agent for the server's CPU type to `/usr/local/bin/vaultpanel-agent`, checks that it runs, registers it and starts the service. The server's status changes from **Waiting for agent** to **Online** within seconds. ## What registration does When the agent registers, it generates an Ed25519 key pair and sends the public key with the enrollment token. The panel returns the agent's ID and the panel's own job-signing public key, which the agent pins. The agent writes `/etc/vaultpanel-agent/config.json` and `agent.key`, both mode 600. Once the agent runs as its own user, `config.json` becomes `root:vaultpanel-agent` mode 640, so the agent can read it but not change it. From then on: - Every request the agent makes is signed (method, path, timestamp, nonce and body hash). The panel checks the signature, a clock window of plus or minus 5 minutes, and that the nonce was never used before. - Every job the panel sends is signed with the panel's key. The agent refuses envelopes that are unsigned, changed, addressed to another server, expired or already run. - The agent re-validates each operation's parameters against its own allow-list and runs fixed commands without a shell. There is no endpoint that runs arbitrary commands, on the panel or on the agent. ## How the agent runs From agent 0.36.0, an agent installed by the install script moves itself to two services on its first start: | Service | Runs as | Does | | --- | --- | --- | | `vaultpanel-agent` | `vaultpanel-agent`, a system user without a shell or home | Talks to the panel: heartbeat, jobs and the terminal link. No capabilities, a read-only system, no access to `/home` or `/root`. | | `vaultpanel-agent-helper` | root | Runs jobs and opens terminal shells after checking each one against the panel's signature itself. Has no connection to the panel. | The two talk over a local socket. A flaw in the agent's network-facing side therefore does not give root: the helper trusts only what the panel signed. If the agent cannot reach the panel as its own user within 10 minutes, the helper puts the single root service back (the original unit is kept as `vaultpanel-agent.service.root`), and the server's [security checks](https://docs.vaultpanel.net/guides/security) show **Agent privileges** with the reason. To keep one root service on purpose, set `"runAsRoot": true` in `/etc/vaultpanel-agent/config.json` and restart `vaultpanel-agent-helper`. ## Heartbeat and offline detection Every 15 seconds the agent sends its system details, CPU, load, memory, swap, disk, network, process count, filesystems and the state of the services it watches. Every few minutes it also reports the installed web stack, certificates, app processes, database sizes, backup files, a security summary and the [self-check](https://docs.vaultpanel.net/guides/servers/self-check). A server whose agent has not reported for 90 seconds is marked **Offline** (`VAULTPANEL_AGENT_OFFLINE_SECONDS`). The panel records `server.offline` and `server.online` in the audit log, and both can be sent to [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) and by [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). ## Updating the agent Agents report which operations they support. When you use a feature newer than a server's agent, the panel refuses it with `AGENT_OUTDATED` and the server page offers an update. - **From the panel** (agent 0.7.0 and newer): click **Update agent** on the server's **Overview**, or run the **Update the agent** [bulk action](https://docs.vaultpanel.net/guides/servers/server-groups#bulk-actions) on many servers. The signed job names the version, size and SHA-256 of the program the panel serves for the server's CPU type. The agent refuses any other file, runs the new program once to check its version, swaps it into `/usr/local/bin/vaultpanel-agent`, keeps the old one as `vaultpanel-agent.previous`, and restarts. The panel offers the update only when it has the program for that server's CPU type. Updating needs `servers.manage`. - **With the upgrade command**: servers still on the old Node.js agent need this once (see [below](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent)). It replaces the agent, keeps the registration and policy in `/etc/vaultpanel-agent`, and restarts the service. ```bash curl -fsSL https://panel.example.com/api/v1/agent/install.sh \ | sudo bash -s -- --upgrade --panel https://panel.example.com ``` A panel with a self-signed certificate adds `--panel-pin` to this command; copy it from the server page. The same `--upgrade --panel --panel-pin ` form moves an agent to a panel that turned HTTPS on, or refreshes its certificate after `vaultpanel https renew`. Agent versions look like `0.50.2-rs.1`. The numbers carry on from the old Node.js agent's 0.42.0, so any "agent 0.38.0 or newer" in these docs is met. ### Moving from the Node.js agent Up to version 0.42.0 the agent was a Node.js program in `/opt/vaultpanel-agent`. It has been replaced by one program written in Rust. The old agent can only install Node.js packages, so the panel cannot move it with an **Update agent** job. Instead, the server's page shows a command to run once on the server, and bulk updates skip the server and say so: ```bash curl -fsSL https://panel.example.com/api/v1/agent/install.sh \ | sudo bash -s -- --upgrade --panel https://panel.example.com ``` With a self-signed panel certificate the command also carries the pin options, as the install command does; copy it from the server page. The command: 1. Downloads the agent for the server's CPU type to `/usr/local/bin/vaultpanel-agent` and checks that it runs. 2. Keeps the registration, key and policy in `/etc/vaultpanel-agent`, so the server stays the same server in the panel, with its history. 3. Removes the old agent's two services and replaces them with the new agent's root service, which then moves itself to its own user and the root helper as usual. 4. Points the panel's cron jobs and Certbot's wildcard certificate hook at the new program. 5. Deletes `/opt/vaultpanel-agent` once the new agent is running. If it does not start, the folder is kept and the command says where to look: `journalctl -u vaultpanel-agent`. After that, **Update agent** and bulk updates work as usual. The panel's own server moves by itself the next time the panel starts. Node.js stays on the server: apps and PM2 still use it, the agent does not. ## Agent policy `/etc/vaultpanel-agent/config.json` is the server owner's local policy. It wins over anything the panel asks. Restart the agent after changing it. | Key | Default | Effect | | --- | --- | --- | | `allowedServices` | Common web, database, mail, DNS and security units | Units that may be inspected, started, stopped or restarted (globs such as `php*-fpm`) | | `watchServices` | Common web stack units | Units reported with each heartbeat | | `allowReboot` | `true` | `false` refuses reboots | | `allowProcessSignals` | `true` | `false` refuses stopping or killing processes | | `allowWebStackInstall` | `true` | `false` refuses installing packages | | `allowWebsites`, `allowApplications`, `allowDatabases` | `true` | `false` refuses every website, app or database operation | | `allowBackups`, `allowCron` | `true` | `false` refuses backups and restores, or cron jobs | | `allowFirewall`, `allowSshConfig`, `allowFail2ban`, `allowUpdates` | `true` | `false` refuses firewall, SSH, Fail2ban or update changes | | `allowContainers`, `allowDns`, `allowMail` | `true` | `false` refuses container, DNS or email operations | | `allowTerminal` | `true` | `false` refuses the browser terminal | | `allowSelfUpdate` | `true` | `false` refuses updates from the panel; use the upgrade command instead | | `runAsRoot` | `false` | `true` keeps one root service instead of its own user plus a root helper | ## Replacing the agent's registration If you reinstalled the server or lost the agent's key, open the server's **Settings** tab and click **New enrollment token**, then run the new install command on the server. Any earlier unused token stops working, and the current agent keeps running until the new one registers. Registering a new agent revokes the old one. ## Removing a server On the server's **Settings** tab, **Danger zone > Remove server** removes it from the panel. You type the server's name to confirm. - The agent is revoked at once and stops, and queued jobs are cancelled. - Nothing on the server itself is deleted: websites, apps and databases stay as they are. - Metrics and job history are kept for the audit trail. To uninstall the agent from the machine afterwards, run on the server: ```bash sudo systemctl disable --now vaultpanel-agent vaultpanel-agent-helper sudo rm -f /etc/systemd/system/vaultpanel-agent.service /etc/systemd/system/vaultpanel-agent.service.root \ /etc/systemd/system/vaultpanel-agent-helper.service sudo systemctl daemon-reload sudo rm -f /usr/local/bin/vaultpanel-agent /usr/local/bin/vaultpanel-agent.previous \ /etc/cron.d/vaultpanel /usr/local/lib/vaultpanel/acme-dns-hook sudo rm -rf /etc/vaultpanel-agent /var/lib/vaultpanel /var/cache/vaultpanel sudo userdel vaultpanel-agent ``` Backups in `/var/backups/vaultpanel` are kept; [Uninstalling](https://docs.vaultpanel.net/getting-started/uninstalling#disconnect-another-server) explains each line. ## Troubleshooting | Symptom | What to do | | --- | --- | | The server stays **Waiting for agent** | Check the install command's output on the server. Tokens are single use and expire; create a new one under **Settings**. "Agents must connect over HTTPS" means the panel URL in the command is plain HTTP. | | The install stops with "does not match the pin in the install command" | The panel at that address does not have the certificate the command was made for. Copy a new install command and check the address. | | The server shows **Offline** | Run `systemctl status vaultpanel-agent` and `journalctl -u vaultpanel-agent` on the server. | | `CLOCK_SKEW` | The server's clock is more than 5 minutes off. Turn on time synchronization: `sudo timedatectl set-ntp true`. | | `AGENT_REVOKED` | The server was removed or re-registered. Run the install command again with a new token. | | `AGENT_UNREACHABLE` on a job | The agent did not pick the job up within 5 minutes. | | `NOT_ALLOWED` on a job | The agent's policy refuses it, for example `allowedServices` or `allowReboot`. | | `HELPER_UNAVAILABLE` | The root helper is not answering: `sudo systemctl restart vaultpanel-agent-helper`. | | **Update agent** says the Node.js agent is replaced by running the command | The server still runs the old Node.js agent. Run the upgrade command from the server page once: see [Moving from the Node.js agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent). | | `AGENT_PACKAGE_MISSING` | The panel has no agent program for this server's CPU type, so it cannot install or update it. | More in [Troubleshooting](https://docs.vaultpanel.net/troubleshooting). --- # Monitoring and alerts URL: https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts > Live and historical server metrics, and alert rules that fire on CPU, memory, disk, load, offline servers, failed services, websites and self-checks. Every agent reports its server's health every 15 seconds. The panel keeps that history for charts, and the worker checks it against alert rules every 15 seconds. Alerts show in the top bar, on the server's page and in the audit log, and can be sent by email and to webhooks. ## Monitoring **Monitoring > Monitoring** shows the live health of every server: CPU, memory, the fullest disk, load, network in and out, services and firing alerts, with a trend for the last hour. Select a server for its charts, services and processes. Each server's **Overview** tab has the full charts: | Chart | Series | | --- | --- | | CPU and memory | CPU %, memory % | | Load average | Load over 1 minute | | Disk and swap | Disk % of `/`, swap % | | Network | Bytes received and sent per second | ![The Overview tab of the server vmi3756066: a Resources card with CPU at 6%, memory at 18% and disk at 17%, network, processes, uptime and 7 of 8 services running, beside one-hour charts of CPU and memory, load average, and disk and swap](https://docs.vaultpanel.net/screenshots/server-detail-light.png) The **Filesystems** card shows every real mounted filesystem the agent found (up to 20, skipping `/boot` and snaps), with its usage. ## Metrics and history | Range | Source | Kept for | | --- | --- | --- | | 1h, 6h, 24h | Raw samples, one every 15 seconds, averaged to fit the chart | 7 days (`VAULTPANEL_METRICS_RETENTION_DAYS`) | | 7d, 30d, 90d | Hourly averages | 90 days (`VAULTPANEL_METRICS_HOURLY_RETENTION_DAYS`) | The worker averages every completed hour of raw samples into the hourly table, so long ranges stay fast and are kept much longer than raw samples. ## How alerts work Alerts follow the same model as Prometheus rules: 1. When a rule's condition becomes true on a server, an alert event starts as **Pending**. 2. If the condition holds for the rule's whole duration, the event becomes **Firing**. This is recorded in the audit log as `alert.fire`. 3. When the condition clears, a firing event becomes **Resolved** (`alert.resolve`). A pending event whose condition clears is dropped without firing. When a server sends no fresh data, metric and service rules are left as they are instead of being resolved. While a server is offline, only the **Server offline** rule is evaluated for it. Each condition is tracked on its own. A disk rule fires separately for each filesystem that crosses the threshold, and a service rule for each failed service. ## Alert rules Open **Monitoring > Alerts > Rules** to see, add and change rules. Managing rules needs `alerts.manage`. | Field | Values | | --- | --- | | **Name** | Up to 100 characters | | **Watch** | What the rule checks (see below) | | **Threshold** | For metric rules only, within the metric's range | | **Service** | For **Service down** only: one unit name, or empty for any watched service | | **For at least** | Immediately, 1, 5, 10, 15 or 30 minutes, or 1 hour | | **Severity** | **Warning** or **Critical** | | **Servers** | One server, or **All servers, including ones added later** | ### What a rule can watch | Watch | Fires when | Threshold | | --- | --- | --- | | **CPU usage** | CPU % is at or above the threshold | 1 to 100 % | | **Memory usage** | Memory % is at or above the threshold | 1 to 100 % | | **Disk usage** | Usage of any mounted filesystem is at or above the threshold | 1 to 100 % | | **Swap usage** | Swap % is at or above the threshold | 1 to 100 % | | **Load per CPU core** | The 1-minute load divided by the number of cores is at or above the threshold (1 means every core is fully busy) | 0.1 to 100 | | **Server offline** | The server is marked offline | None | | **Service down** | A watched service has failed, or is stopped although it is enabled at boot | None | | **Website down** | A website on the server fails the panel's [uptime checks](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) | None | | **Server self-check failed** | One of the server's [self-checks](https://docs.vaultpanel.net/guides/servers/self-check) reports an error (agent 0.39.0 and newer) | None | ### Default rules A new panel starts with these rules, which you can change or delete: | Rule | Watch | Threshold | For at least | Severity | | --- | --- | --- | --- | --- | | High CPU usage | CPU usage | 90 % | 10 minutes | Warning | | High memory usage | Memory usage | 90 % | 5 minutes | Warning | | Disk almost full | Disk usage | 90 % | 1 minute | Critical | | Server offline | Server offline | | 1 minute | Critical | | Service down | Service down | | 1 minute | Warning | | Website down | Website down | | 1 minute | Critical | | Server self-check failed | Server self-check failed | | 10 minutes | Warning | Deleting a rule resolves its open alerts at once. Past alerts stay in the history. ## Firing alerts **Monitoring > Alerts** has four tabs: **Firing**, **Pending**, **History** and **Rules**. Firing alerts also show: - in the top bar of every page, - at the top of the server's **Overview** tab, - in the audit log, as `alert.fire` and `alert.resolve`. With `alerts.acknowledge`, click **Acknowledge** on a firing alert to show the team someone is on it. Only firing, unacknowledged alerts can be acknowledged. Resolved alerts are kept for 90 days (`VAULTPANEL_ALERT_HISTORY_DAYS`). ## Notifications Alerts reach people outside the panel in two ways: - **Email**: with [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) set up, the panel emails owners and admins, and any extra addresses you list, when an alert starts firing. Its default events also include servers going offline. - **Webhooks**: a [webhook](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) can subscribe to `alert.firing`, `alert.resolved`, `server.offline` and `server.online`, as signed JSON or as Slack or Discord messages. ## Troubleshooting An alert that never fires usually means the condition did not hold for the rule's whole duration, or the server had no fresh telemetry. Rules are evaluated by the panel's worker, so it must be running (`vaultpanel status` on an installed panel shows it). --- # Self-check URL: https://docs.vaultpanel.net/guides/servers/self-check > Every five minutes the agent checks that the panel's features will work on its server, and shows the exact command that fixes a failure. The self-check confirms that a server can do what the panel asks of it: the agent's root helper answers, its files are readable, the file manager starts, NGINX and Apache accept their configuration, certificates renew, the clock is right and no service has failed. It needs agent 0.39.0 or newer. ## Where to see it The **Self-check** card on each server's **Overview** tab lists every check with its result, and a badge such as "6 of 7 passed". The agent runs the checks as root every 5 minutes and sends the report with its heartbeat; **Check now** runs them on demand. Each check has one of four results: | Result | Meaning | | --- | --- | | Error | Something the panel does fails now, or would fail at the next restart. The **Server self-check failed** alert fires. | | Warning | Worth fixing; nothing fails yet. | | OK | Nothing to do. | | Info | Nothing to judge, for example no Let's Encrypt certificate yet. | ## The checks | Check | How it is checked | When it fails | Fix | | --- | --- | --- | --- | | **Root helper** | Whether the agent's root helper answers | Error: no job, file request or terminal can run | `sudo systemctl restart vaultpanel-agent-helper` | | **Agent privileges** | Which user the agent runs as | Warning: the agent runs as root, with the reason (for example `runAsRoot` is set) | See [How the agent runs](https://docs.vaultpanel.net/guides/servers/connecting-servers#how-the-agent-runs) | | **Agent files** | `stat` of the agent's program (`/usr/local/bin/vaultpanel-agent`) and every folder above it, which everyone must be able to read and run | Error: some are for root only, so the agent's own user and the file manager, which runs the same program as each site's user, cannot start it | `sudo chmod -R u=rwX,go=rX /usr/local/bin/vaultpanel-agent` for the program, or `sudo chmod o+x` on the folder the card names, as shown on the card | | **File manager** | Starts the file manager's worker as `nobody`, exactly as for a site, and asks it to answer | Error: the file manager fails for every website | The card shows the worker's own error message | | **NGINX configuration** | `nginx -t` | Error: website changes cannot be applied, and NGINX would not start again after a restart | `sudo nginx -t` shows the failing line | | **Apache configuration** | `apache2ctl -t`, when Apache is installed | Error, as for NGINX | `sudo apache2ctl -t` | | **Certificate renewal** | Certbot's renewal timer and its last run, and the `vaultpanel-reload-nginx` deploy hook | Warning: the timer is missing, masked or stopped, its last run failed, or the hook is missing | `sudo systemctl enable --now certbot.timer`, or issue or renew a certificate from the panel | | **Clock** | `timedatectl` reports whether the clock is synchronized | Warning: certificates, cron jobs and the agent's signed requests need the right time | `sudo timedatectl set-ntp true` | | **Failed services** | `systemctl list-units --state=failed` | Warning: one or more systemd units failed (up to 20 named) | `systemctl --failed`, then `journalctl -u ` for each | > **Note:** A missing or stopped Certbot timer is only a warning: the panel renews due certificates itself a day into their renewal window when Certbot does not. Issuing or renewing a certificate from the panel turns the timer back on and restores the reload hook. ## Alerts The built-in **Server self-check failed** alert rule fires for each check that reports an error and stays failing for 10 minutes, longer than the 5 minutes between reports, so one bad read during a change does not alert anyone. Warnings never fire it. A report older than 30 minutes is not judged. Change the rule under **Monitoring > Alerts > Rules**; see [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts#alert-rules). ## Older agents Agents before 0.39.0 do not send a self-check. The card then lists what newer agents check; update the agent from the server's **Overview** tab to see the results. --- # Terminal URL: https://docs.vaultpanel.net/guides/servers/terminal > Open a root shell on a connected server from the browser, and record, replay and download terminal sessions. Owners only. The terminal gives owners a root shell on a server from the panel, like an SSH session, without opening SSH to their computer. Opening and closing a terminal is always written to the audit log, and sessions can be recorded for replay. ## Who can open it Opening a terminal needs `servers.terminal`, which only the **Owner** role has. It is never granted to admins, to an API token scope, to a plugin or to the AI assistant: a root shell goes beyond anything the allow-listed operations can do, so it is only for a person signed in to the panel in a browser. The server's agent must be 0.11.0 or newer and allow it (`allowTerminal`, on by default). When [panel access by address](https://docs.vaultpanel.net/guides/security/panel-access) is on, the terminal is refused from addresses that are not on the list. ## Open a terminal Use **Infrastructure > Terminal** and pick a server, or the **Terminal** tab on a server's page. The shell is root's login shell, started in the server's own mount namespace, so it sees the server as an SSH session would. - **Copy**: select text, then **Copy** or Ctrl+Shift+C (Ctrl+C also copies while text is selected). On macOS, ⌘C. - **Paste**: Ctrl+V or right-click. Over plain HTTP, browsers only allow the keyboard shortcut or right-click paste. - **Full screen**: the toolbar button; Esc leaves it. A badge shows whether the session is being recorded, and what is recorded. ## How it works A terminal is not an agent operation: it is a separate channel, and the operation allow-list stays unchanged. 1. The browser asks the API for a terminal with the session cookie and CSRF token, and gets a one-time ticket valid for 30 seconds. 2. The browser opens a WebSocket with that ticket. 3. The panel asks the agent for a shell with an envelope signed by the panel's key, for this server, valid for a minute and used once, exactly like a job. 4. The panel passes bytes between the browser and the agent's shell. Each agent keeps one signed WebSocket open to the panel for this, and reconnects by itself. A session ends when the browser closes, the person signs out or loses the owner role, or the agent restarts. Running `systemctl restart vaultpanel-agent` inside a terminal therefore ends that terminal. ### Limits | Limit | Value | | --- | --- | | Open terminals per server | 5 | | Open terminals per person | 10 | Past either limit the panel answers `TOO_MANY_TERMINALS`; close a terminal first. ## Recordings The panel records sessions as the bytes pass through it, as [asciicast v2](https://docs.asciinema.org/manual/asciicast/v2/) files in its data folder, readable only by the panel's own user. **Infrastructure > Terminal > Sessions and recordings** lists every terminal opened from the panel, newest first. Open one to replay it in the panel, or click **Download** to play it with asciinema. The **Recording** settings on the same page: | Setting | Default | | | --- | --- | --- | | **Record terminal sessions** | On | What the shell shows on screen, with timing, so it can be replayed | | **Also record what is typed** | Off | Every key sent to the server | | **Keep recordings for (days)** | 90 | 1 to 3650. Older sessions and their recordings are deleted. | | **Largest recording (MB)** | 50 | 1 to 1024. A session that prints more keeps running; its recording stops there. | > **Warning:** **Also record what is typed** includes passwords typed at prompts that do not show them, such as `sudo` or `mysql -p`. Keep it off unless you need a record of every key. Only owners can watch, download and delete recordings, since they can hold secrets shown on screen. Deleting a recording removes the session and its file for good, and is written to the audit log. ## Audit log | Action | When | | --- | --- | | `server.terminal.open` | A terminal opens, with whether it is recorded | | `server.terminal.close` | A terminal closes, with its duration and amount of output | | `terminal.recording.settings` | Recording settings change | | `terminal.recording.delete` | A recording is deleted | --- # Logs URL: https://docs.vaultpanel.net/guides/servers/logs > Read and search a server's systemd journal live through its agent, and find where service, website, app and cron logs are kept. **Monitoring > Logs** reads a server's logs from the systemd journal, live, through its agent. Nothing is copied to or stored on the panel: each read asks the agent for the newest lines. ## Read a server's logs Pick an online server at the top of the page, then a source: | Source | What it holds | | --- | --- | | **System journal** | Everything the server logs | | **Kernel** | Kernel messages (dmesg) | | **Sign-ins and sudo** | SSH logins, `sudo` and other authentication | | **Cron** | What the cron daemon started | Then narrow the result: | Filter | Options | | --- | --- | | **Find text** | Plain text, up to 200 characters, matched without regard to case over the newest 20,000 lines | | **Level** | A journal priority and everything more severe (Emergency, Alert, Critical, Error, Warning, Notice, Info), or **All levels** | | **Time range** | Any time, or the last 15 minutes, hour, 6 hours, 24 hours or 7 days | | **Lines** | 100, 300, 1000 or 2000 | Click **Read**, or tick **Refresh every 10 s** to follow the log. With a search, the result says how many lines matched out of how many were scanned. Lines that look like errors or warnings are colored; that is a hint, not a filter. Reading server logs needs `servers.logs` (owners and admins by default) and agent 0.5.0 or newer. ## Other logs | Log | Where | | --- | --- | | A service's journal | The server's **Services** tab, **Logs** on each service. See [Servers](https://docs.vaultpanel.net/guides/servers#services). | | A website's NGINX access and error logs | The website's **Logs** tab | | An app's output and errors | The app's **Logs** tab | | A cron job's output | **Automation > Cron Jobs**, kept with each run | | What a job did on a server | The job's page, from **Monitoring > Jobs** | | What people did in the panel | The [audit log](https://docs.vaultpanel.net/guides/security/audit-log) | --- # Server groups and bulk actions URL: https://docs.vaultpanel.net/guides/servers/server-groups > Group servers such as Production or Europe, watch their health together, and run one operation on many servers at once or one at a time. Server groups are named sets of servers you filter by, watch together and act on. Bulk actions run one allow-listed operation on several servers, either all at once or one server at a time, with each server's part tracked as an ordinary job. ## Server groups **Infrastructure > Server Groups** lists your groups. Each card shows how many of its servers are online, firing alerts, and average CPU, memory and disk. To create one, click **New group** and set: | Field | Rules | | --- | --- | | **Name** | Up to 60 characters: letters, numbers, spaces and `. _ - ( ) &` | | **Description** | Optional, up to 300 characters | | Color | Blue, green, amber, red, purple, teal or gray | | Servers | Up to 500 per group | A server can be in several groups. You can also set a server's groups from its **Settings** tab. Creating, changing and deleting groups needs `servers.manage`; deleting a group never touches its servers or the bulk actions run on it. Open a group to see its servers side by side with **Online**, **Firing alerts**, **CPU average**, **Memory average**, **Disk average** and **Agents to update**, and its recent bulk actions. ## Bulk actions Start a bulk action in either of two ways: - On **Infrastructure > Servers**, tick two or more servers and click **Run on selected** (up to 200 servers). - Open a group and click **Run on group**. Running a bulk action needs `servers.bulk` (owners and admins) in addition to the permission of the operation itself. ### Operations Only these operations can be run as a bulk action: | Operation | What it does | Default mode | Checked after the job | | --- | --- | --- | --- | | **Restart a service** | Restarts the same systemd service on every server | All at once | | | **Start a service** | Starts a stopped systemd service on every server | All at once | | | **Check a service** | Reads the state of a systemd service on every server | All at once | | | **Install security updates** | Installs waiting security updates with unattended-upgrades | One server at a time | | | **Update the agent** | Installs the agent version this panel serves; servers already on it are skipped | All at once | The server reports the new version, within 3 minutes | | **Reboot** | Restarts the servers | One server at a time | The server comes back with a newer boot time, within 10 minutes | The service operations take the systemd service name, the same on every server. Each agent still only manages the services its policy allows. ### Modes | Mode | Behavior | | --- | --- | | **All at once** | Every server starts right away. Fastest. | | **One server at a time** | Each server must finish before the next one starts, including coming back after a reboot or reporting a new agent version. With **Stop if a server fails** (on by default), the servers after a failed one are not touched. | ### Skipped servers Servers that cannot run the operation are listed as **Skipped** with the reason instead of failing the action: offline servers, servers without an agent, agents too old for the operation, and, for **Update the agent**, servers already on that version, servers whose CPU type the panel has no agent program for, and servers still on the old Node.js agent, which [move with the command on their page](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent). If no server can run it, the action is refused. ### The panel's own server **This server** always runs last, so rebooting or restarting its agent cannot cut off the servers after it. A reboot of the panel's own server waits until every other server is done, in either mode. The panel is then unreachable until it starts again on that server, and that server is given a day, instead of 10 minutes, to report back. ### Following and cancelling **Infrastructure > Bulk Actions** lists every bulk action with its progress; viewing them needs `jobs.read`. Open one to see each server in the order it runs, its state (waiting, running, verifying, succeeded, failed, skipped or cancelled) and a log link to exactly what the agent did. Cancelling stops the servers that have not started, and cancels jobs still waiting for their agent. Anything already running on a server finishes. ### Who it runs as Each server's part is created as the person who started the action, with the same permission checks, duplicate checks, logs and audit entries as running it by hand. Later servers in a one-at-a-time action re-check that person's current access, so deactivating them or removing their permission stops the rest. Bulk actions are recorded in the audit log as `bulk_action.create`, `bulk_action.cancel` and `bulk_action.finish`. --- # Websites URL: https://docs.vaultpanel.net/guides/websites > Create static, PHP and reverse proxy websites on your servers, and learn what VaultPanel sets up for each one in Linux, NGINX and PHP-FPM. A website in VaultPanel is a site served by NGINX on one of your servers: its own Linux user and folder, its own NGINX configuration, and for PHP sites its own PHP-FPM pool. You create and change it in the panel; the server's agent does the work and checks that the site answers afterwards. ![The Websites list with three sites on vmi3756066: docs.vaultpanel.net (a Node.js application), vaultpanel.net (a static site) and wordpress.vaultpanel.net (PHP 8.4), each with HTTPS active](https://docs.vaultpanel.net/screenshots/websites-light.png) ## Website types | Type | What it serves | Use it for | | --- | --- | --- | | **Static site** | HTML, CSS, JavaScript and other files, as they are. | Plain HTML sites, built front ends (Vite, React, Vue, Hugo) and single-page apps. | | **PHP site** | PHP through the site's own PHP-FPM pool, running as the site user. | WordPress, Laravel, Symfony and any other PHP application. | | **Reverse proxy** | Forwards requests to an app listening on a port on `127.0.0.1`. | Node.js, Python, Go or Ruby apps. | The website of an app you deploy from **Applications** is a reverse proxy that VaultPanel creates and links for you. See [Applications](https://docs.vaultpanel.net/guides/applications). To bring websites over from cPanel, see [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel). ## Before you start - The server is connected and its agent reports in. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). - NGINX is installed. Open the server's page, go to the **Websites** tab and use the **Web stack** card to install NGINX, PHP-FPM and Certbot (or **Install all missing**). VaultPanel refuses to create a website on a server without NGINX. - For a PHP site, at least one PHP version is installed on the server. See [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions). ## Create a website ### Open the form Go to **Web > Websites** and click **New website**. ### Choose the type and the server Pick **Static site**, **PHP site** or **Reverse proxy**, and the **Server** the site runs on. Only servers with a connected agent are listed. ### Fill in the fields | Field | Required | Notes | | --- | --- | --- | | **Domain** | Yes | The primary domain, such as `example.com`. Point its DNS at the server before you issue a certificate. | | **Site name** | Yes | Also the site's Linux user and folder name, so it cannot be changed later. 3 to 32 characters: lowercase letters, digits and dashes, starting with a letter. System names such as `root`, `www-data`, `nginx` or `mysql` are reserved. | | **More domains** | No | One per line: `www.example.com`, a subdomain, or a wildcard such as `*.example.com`. Up to 20 domains in total. | | **PHP version** | PHP sites | One of the versions installed on the server. | | **App port** | Reverse proxies | The port your app listens on. Requests go to `127.0.0.1` on this port. | | **Document root** | No | The folder inside the site that is served. Defaults to `public`. Not used by reverse proxies. | ### Create it Click **Create website**. The website shows as **Creating** while the agent sets it up, then **Active**. The page links to the operation log, so you can follow each step. A domain can belong to one website only. VaultPanel refuses a domain another site already lists, and the panel's own domain (see [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain)). ## What VaultPanel sets up Creating a website runs one operation on the server. Every step checks what is already there, so running it again is safe. 1. **A Linux user** named after the site, with no login shell (`/usr/sbin/nologin`) and its own group. NGINX's user (`www-data`) joins that group so it can read the site's files. 2. **The site's home folder** at `/var/www/`, readable by the site user and its group only, with the document root, `tmp` and `logs` folders inside. A new site gets a placeholder `index.html` (or `index.php`) in its document root, which you replace with your own files. 3. **A PHP-FPM pool** for PHP sites, running as the site user. 4. **An NGINX server block**, tested with `nginx -t` before NGINX reloads. 5. **A health check**: the agent asks NGINX on the server for the site's front page and records the answer. | Path | What it is | | --- | --- | | `/var/www/` | The site's home folder. | | `/etc/nginx/sites-available/.conf` | The site's NGINX configuration, linked from `sites-enabled` while the site is enabled. | | `/etc/php//fpm/pool.d/.conf` | The site's PHP-FPM pool (PHP sites). | | `/var/log/nginx/vp-.access.log` | NGINX access log. | | `/var/log/nginx/vp-.error.log` | NGINX error log. | | `/var/www//logs/php-error.log` | PHP errors (PHP sites). | ### The NGINX configuration VaultPanel generates each site's server block from its settings, and overwrites it whenever you save the site in the panel. Do not edit the file by hand: use [custom NGINX rules](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess) instead. - Every site serves `/.well-known/acme-challenge/` from a shared folder over HTTP, so Let's Encrypt can issue and renew certificates for any site type. - Hidden files such as `.env` and `.git` are never served. - Requests can carry up to 64 MB (`client_max_body_size 64m`). A PHP site's **Largest upload** setting changes this; see [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings). - Static sites serve files with `try_files`. PHP sites send `.php` requests to the site's PHP-FPM socket. Reverse proxies forward to `127.0.0.1:` with the usual `Host`, `X-Real-IP`, `X-Forwarded-For` and `X-Forwarded-Proto` headers, and pass WebSocket upgrades. - With an active certificate, a second server block serves HTTPS on port 443 (TLS 1.2 and 1.3, HTTP/2). **Redirect HTTP to HTTPS** sends plain HTTP visitors there. - IPv6 listeners are added only when the server has IPv6. If `nginx -t` rejects the new configuration, the agent puts the previous one back and the change fails with the test's output. A bad change never takes NGINX down. ### The PHP-FPM pool Each PHP site's pool runs as the site user on its own socket, so one site cannot read another's files. The pool starts PHP processes on demand (up to 10 by default), limits PHP to the site's home folder with `open_basedir`, keeps sessions and uploads in the site's `tmp` folder, and allows uploads up to 64 MB by default. Change the limits per site with [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings). ## The website page Open a website from **Web > Websites** to manage it. Tabs appear according to the site's type and your permissions. | Tab | What it holds | | --- | --- | | **Overview** | Status, health check, [uptime](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) and, for PHP sites, the **PHP version** card. | | **Domains** | The site's domains and their DNS status. See [Domains](https://docs.vaultpanel.net/guides/websites/domains). | | **Subdomains** | Subdomains of the site's domains, each served as a website of its own. | | **SSL** | The certificate. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). | | **Deployments** | Git deploy for static and PHP sites. See [Git deploy](https://docs.vaultpanel.net/guides/websites/git-deploy). | | **Environment** | Variables for Git deploy builds. | | **Files** | The [file manager](https://docs.vaultpanel.net/guides/websites/file-manager) for this site. | | **Databases** | The [databases](https://docs.vaultpanel.net/guides/databases) linked to the site. | | **WordPress** | The [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools), for a PHP site with WordPress from the app installer. | | **Apps** | The [app installer](https://docs.vaultpanel.net/guides/websites/cms-installer), for PHP sites. | | **Statistics** | Visitors, page views and traffic from the access log. See [Statistics](https://docs.vaultpanel.net/guides/websites/statistics). | | **Logs** | The last 100 to 2,000 lines of the site's NGINX access or error log. | | **Backups** | The site's [backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups). | | **Staging & clone** | Staging copies, push to live and clones. See [Staging and clones](https://docs.vaultpanel.net/guides/websites/staging-and-clones). | | **Malware** | ClamAV scans and what they found. See [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning). | | **Firewall** | The web application firewall and sign-in protection. See [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall). | | **SFTP** | An SFTP account locked into the site's folder. See [SFTP](https://docs.vaultpanel.net/guides/websites/sftp). | | **Cron** | The site's [cron jobs](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs). | | **Settings** | Type, PHP version, app port, document root, single-page app, `.htaccess` files, the [page cache](https://docs.vaultpanel.net/guides/websites/caching) and [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings) (PHP sites), custom NGINX rules, disable and delete. | ## Change a website's settings On the **Settings** tab you can change: - **Type**: switch between static, PHP and reverse proxy. A site deployed from Git keeps its type until you turn Git deploy off. - **PHP version** (PHP sites) and **App port** (reverse proxies). - **Document root**: the folder inside the site that is served. - **Single-page app** (static sites): addresses with no file of their own get `index.html`, so links such as `/dashboard` work after a refresh in React, Vue or Angular apps. - **Use .htaccess files** (static and PHP sites): see [NGINX rules and .htaccess](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess). - **Page cache** and **PHP settings** (PHP sites), each in its own card: see [Caching](https://docs.vaultpanel.net/guides/websites/caching) and [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings). Each change runs as one operation. The site shows **Applying changes** until it finishes, and only one change can run at a time. A failed change leaves the site as it was, both in the panel and on the server. > **Note:** **Single-page app** needs agent 0.30.0 or newer, and cannot be combined with `.htaccess` files: add the `index.html` fallback to your `.htaccess` file instead. ## Environment variables The **Environment** tab holds variables for websites deployed from Git. They are stored encrypted in the panel and passed to the install and build commands of each deployment. - **Static sites**: a build copies the variables it uses (such as `VITE_API_URL`) into the site's files, where visitors can read them. Never put passwords or private keys here. - **PHP sites**: the variables are also written to the release's `.env` file, where Laravel and Symfony read them. This happens only when the site serves a folder of the repository (such as `public`) and the repository has no `.env` file of its own. Use **Edit as text** to paste them in `KEY=value` form, one per line. See [Git deploy](https://docs.vaultpanel.net/guides/websites/git-deploy). ## Disable, enable and delete - **Disable website** stops NGINX from serving the site. Its files, user and certificate are kept, and **Enable website** serves it again. - **Delete website** removes the site's NGINX configuration, its PHP-FPM pool, its Apache site (when `.htaccess` files are on) and its certificate from the server. You type the site name to confirm. When you delete a website, **Also delete the files** decides what happens to its files: - **Off** (the default): the Linux user and `/var/www/` stay on the server. Creating a site with the same name later uses them again. - **On**: VaultPanel deletes the Linux user, everything in its home folder and its NGINX logs. This cannot be undone. A website that serves an app is deleted without its files: the app keeps running on its port and only its domains stop being served. Delete the app to remove its files. ## Website statuses | Status | Meaning | | --- | --- | | **Creating** | The agent is setting the site up. | | **Active** | The site is live. | | **Applying changes** | A change is running. | | **Disabled** | NGINX does not serve the site. | | **Deleting** | The site is being removed. | | **Failed** | The site was never created on its server. Use **Try again**, or delete it. | The list also shows **Not answering** when the agent's health check failed after the last change, and **Down** when [uptime monitoring](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) finds the site unreachable. ## Hosting customers Customers on a [hosting plan](https://docs.vaultpanel.net/guides/hosting-and-billing) see and manage only their own websites, and each one counts against their plan. A customer's reverse proxy can only point at the port of one of their own apps, and a customer cannot add a domain under another account's domain or under one of the panel's DNS zones that is not theirs. Custom NGINX rules are set by staff only. ## Permissions | Permission | Allows | | --- | --- | | `websites.read` | Seeing websites, domains and certificates. | | `websites.manage` | Creating, changing, deleting websites and their certificates. | | `websites.logs` | Reading the NGINX logs. | | `files.read`, `files.write` | Browsing and changing files in the file manager. | See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles). ## Next steps - [Domains](https://docs.vaultpanel.net/guides/websites/domains) - [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates) - [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions) - [NGINX rules and .htaccess](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess) - [File manager](https://docs.vaultpanel.net/guides/websites/file-manager) - [Git deploy](https://docs.vaultpanel.net/guides/websites/git-deploy) - [Uptime monitoring](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) - [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer) - [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings) - [Caching](https://docs.vaultpanel.net/guides/websites/caching) - [Statistics](https://docs.vaultpanel.net/guides/websites/statistics) - [SFTP](https://docs.vaultpanel.net/guides/websites/sftp) - [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) - [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning) - [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools) - [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel) - [Staging and clones](https://docs.vaultpanel.net/guides/websites/staging-and-clones) --- # Moving from cPanel URL: https://docs.vaultpanel.net/guides/websites/moving-from-cpanel > Move websites, their files and databases, and email from a cPanel full account backup to one of your servers. VaultPanel can move a cPanel account to one of your servers from its full account backup. Upload the backup, see what the server found in it, pick what to move and the names to use, and the panel does the rest. Nothing on the old server changes. | What | What comes over | | --- | --- | | **Websites** | The main domain, addon domains and subdomains, each with its aliases, folder and PHP version. | | **Databases** | Each MySQL database in the backup, imported into a new MariaDB database with its own user. | | **Email** | Whole email domains: their mailboxes with their passwords, size limits and mail, and their forwarders. | Moving websites and databases needs agent 0.48.0 or newer on the server. Moving email needs agent 0.50.0 or newer. ## Before you start - **A full account backup.** In cPanel, open **Backup** (or **Backup Wizard**) and download a full account backup. The file is named like `backup-….tar.gz` or `cpmove-user.tar.gz`. A backup that keeps the home folder as `homedir.tar` inside it, or holds more than one account, is refused. - **A server that is online**, with NGINX and PHP-FPM for the websites and MariaDB for the databases. - **For email**, a mail server set up on that server. See [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting). - **Permissions**: `websites.manage` and `databases.manage`, and `mail.manage` to move email. Moving from cPanel is for staff: hosting customers' hosts move their sites for them. > **Note:** The backup goes through the panel, so its size is limited by `VAULTPANEL_FILE_UPLOAD_MAX_MB` in the panel's `/opt/vaultpanel/.env`: 2048 MB (2 GB) by default, up to 10240 MB. Raise it and restart the panel for larger accounts. The panel needs that much free disk space while the backup is on its way. ## Move an account ![The Move from cPanel page: an Upload a cPanel backup card with Move to server set to vmi3756066, a Backup file picker for backup-….tar.gz or cpmove-user.tar.gz and an Upload and read it button, above No moves yet](https://docs.vaultpanel.net/screenshots/migrations-light.png) ### Upload the backup Go to **Websites** and click **Move from cPanel**. Choose the server under **Move to server**, pick the **Backup file** and click **Upload and read it**. The file goes up in pieces of up to 8 MB, with its progress shown. A piece that fails because of the network is sent again. ### Wait while the server reads it The server fetches the backup from the panel, checks it against its SHA-256 and lists what is in it. The move shows **Reading the backup**, then **Ready to move**. Nothing is unpacked yet except cPanel's small settings files. ### Pick what to move The page lists the account's websites, databases and email domains, all ticked. For each one you keep: | Item | Fields | | --- | --- | | Website | **Website name** (also its Linux user and folder), **Domains** separated by commas, and **PHP** (the version cPanel used, when the backup says). | | Database | **Database name here**. Its user gets the same name, cut to 32 characters. | | Email domain | Its mailboxes and forwarders come as a whole. Mailboxes whose password cannot come over are counted. | Untick what should stay behind. ### Move them Click **Move them**. The move shows **Making websites and databases**, then **Moving files and data**, then **Moved**. The page follows along; large backups take a while. ## What happens **Websites.** Each one is made the usual way: a PHP website with its own Linux user, folder and PHP-FPM pool. Its files are unpacked from the backup into the site's `public` folder, owned by the website, without setuid bits. When another moved website's folder is inside this one (an addon domain inside `public_html`, for example), that folder is left out: it belongs to the other website. Links in the backup never make the server write outside the site. **Databases.** Each one is made with its own user with full access, then the dump from the backup is imported the way [database imports](https://docs.vaultpanel.net/guides/databases/import-and-export) are: as an account that can reach only that database. A database is linked to the first moved website, so that website's backups include it. **WordPress.** A WordPress whose `wp-config.php` uses a moved database is pointed at the new database, user and password. Other apps (Joomla, Laravel and so on) need their database settings changed by hand. **Email.** Each email domain is added to the server's mail server, without changing its DNS records. Its mailboxes come with: - their passwords: cPanel's SHA512-CRYPT hashes, which are never kept in a job's stored output, - their size limits, - all their mail: folders, and messages read and unread. The mail is owned by the mail server's account; links and Dovecot's old index files are dropped and rebuilt on first use. Forwarders come with their addresses. Pipes, files, `:fail:`, `:blackhole:` and catch-all forwarders are left out. Up to 500 mailboxes come from one backup. Addresses this server already has are left as they are and listed under **Left as they were**. Mailboxes whose password cannot come over are listed under **Set a password for these mailboxes**: set a new one on the Email page. When the move is done, the backup is deleted from the server. ## After the move ### Check each website Open each moved website before its DNS points here, for example with an entry in your computer's hosts file. ### Point the DNS here Change each domain's DNS to the new server. For email, point the domains' MX records here when you are ready. Mail that reaches the old server after the backup was made stays there. ### Issue SSL certificates Once the DNS points here, issue each website's certificate. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). ## Discard a move **Discard** removes a backup you no longer want to move from the server. It is not possible while the backup is being read or moved. A finished move shows **Hide** instead. Earlier moves are listed under **Earlier moves** on the **Move from cPanel** page. ## When a move fails The move shows **Failed** with the reason, and **Details** opens the operation log. - If it fails while websites and databases are being made, what was already made is kept. Delete it, or move the rest by hand. - If the backup is no longer on the server, upload it again. - A dump that uses another database (`CREATE DATABASE` or `USE`) or sets a `DEFINER` is refused while importing. See [Import and export](https://docs.vaultpanel.net/guides/databases/import-and-export#troubleshooting). See [Migrations](https://docs.vaultpanel.net/api-reference/migrations) in the API reference. --- # Domains URL: https://docs.vaultpanel.net/guides/websites/domains > Add aliases and wildcard domains to a website, create subdomains as sites of their own, and check that each domain points at the right server. Every website has a primary domain and up to 19 more. VaultPanel writes them all into the site's NGINX configuration, and checks in public DNS that each one reaches the site's server. ## Primary domain and aliases The first domain of a website is its primary domain. It names the site in lists, and the agent's health check and the panel's uptime checks use it (or, when it is a wildcard, the first domain that is not). The other domains are aliases: NGINX serves the same site for each of them. To change them, open the website, go to the **Domains** tab and click **Edit domains**: - **Primary domain**: the main address. - **More domains**: one per line, such as `www.example.com`. A website can have up to 20 domains, each listed once. A domain can belong to one website only, so VaultPanel refuses a domain that another site, or the panel itself, already uses. > **Note:** Domains added after a certificate was issued are not in it yet. The **SSL** tab says so: issue the certificate again to include them. ## Wildcard domains A domain such as `*.example.com` makes the website serve every name under `example.com` that no other website lists itself. NGINX prefers exact names, so `shop.example.com` on another site still goes to that site. - The DNS needs a wildcard record: an `A` (or `AAAA`) record named `*` that points at the server. - HTTPS for a wildcard needs a wildcard certificate (through a DNS check) or an uploaded certificate that covers it. Let's Encrypt's normal check cannot issue wildcard names. See [Wildcard certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates). - A wildcard over a suffix people register domains under, such as `*.co.uk`, is refused. - Serving wildcard domains needs agent 0.37.0 or newer on the server. ## Check DNS Before you issue a certificate, each domain needs an `A` or `AAAA` record that points at the website's server. **Check DNS** on the website's **Domains** tab (or on each row of **Web > Domains**) looks the domains up in public DNS and compares the answers with the server's addresses. | Result | Meaning | | --- | --- | | **Points here** | The domain resolves to one of the server's addresses. | | **Points elsewhere** | The domain resolves, but to other addresses. | | **No DNS record** | Public DNS has no `A` or `AAAA` record for it. | | **Lookup failed** | The lookup itself failed. | For a wildcard domain, VaultPanel looks up a random name under it, so the check tells you whether the `*` record exists. When some domains do not point at the server, the tab shows the addresses to use in an `A` record at your DNS provider. DNS changes can take a while to spread. ## The Domains page **Web > Domains** lists the domains of all your websites in one place, with the website and server each belongs to, its DNS status and whether HTTPS covers it. Domains are added on each website's page; this page is for checking them. ## Subdomains A subdomain such as `blog.example.com` can be served as a website of its own, with its own folder and Linux user, on the same server as its parent domain. ### Open the form Go to **Web > Subdomains** and click **New subdomain**. ### Fill in the fields | Field | Notes | | --- | --- | | **Subdomain** | The name before the domain, such as `blog` or `shop.eu`, and the domain to put it under: one of your websites' domains. `www` is not accepted: add `www.example.com` to the parent website's domains instead. | | **Type** | **Static site** or **PHP site**. | | **PHP version** | For PHP sites, one of the versions installed on the server. | | **Document root** | The folder inside the site that is served. Defaults to `public`. | VaultPanel names the new site after its domain (`blog.example.com` becomes `blog-example-com`) and picks a free name when that one is taken. ### Create it The subdomain is created like any website. When one of the panel's [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) holds the parent domain, VaultPanel also adds an `A` record for the subdomain there (and an `AAAA` record when the parent domain has one), unless the name already has an address or alias. The record is taken out again when you delete the subdomain. When the DNS is elsewhere, add the `A` record yourself. Subdomains also appear on **Web > Websites**, where they are managed like any other site. Deleting one from **Web > Subdomains** keeps its folder on the server unless you tick **Also delete its files**. ### Subdomains for hosting customers Hosting customers can add subdomains under their own domains only. Each one counts against their plan's subdomain limit, not its website limit. When staff create a subdomain under a customer's domain, it belongs to that customer and counts against their plan. ## Name servers for customers On a server that runs DNS, staff can set the name servers that hosting customers on it are told to use. Go to **Web > DNS Zones**, find the server under **DNS servers** and click **For customers**: - **Name servers**: the host names customers set at their registrar, such as your hosting brand's name servers. Customers see them on their **My Hosting** page. - **Add a DNS zone for each new customer domain**: when a customer creates a website for a new registered domain (`example.com`, not a subdomain), VaultPanel adds its DNS zone on this server with those name servers. The zone is removed with the customer's account. See [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) for how zones work. --- # SSL certificates URL: https://docs.vaultpanel.net/guides/websites/ssl-certificates > Serve websites over HTTPS with free Let's Encrypt certificates, wildcard certificates or your own uploaded ones, renewed automatically before they expire. Each website can have one certificate. VaultPanel issues free certificates from Let's Encrypt through Certbot on the website's server, renews them automatically, and also installs certificates you bought elsewhere. Manage a website's certificate on its **SSL** tab, and every certificate on **Web > SSL Certificates**. ## Before you start - **The domains point at the server.** Let's Encrypt checks each domain over HTTP, so each one needs an `A` or `AAAA` record for the server. Use **Check DNS** on the **Domains** tab. See [Domains](https://docs.vaultpanel.net/guides/websites/domains#check-dns). - **Certbot is installed** on the server: open the server's page, go to the **Websites** tab and install it from the **Web stack** card. - **The website is enabled.** Let's Encrypt has to reach it. - **Ports 80 and 443 are open** in the server's [firewall](https://docs.vaultpanel.net/guides/security/firewall) and at your hosting provider. ## Issue a Let's Encrypt certificate ### Open the SSL tab Open the website, go to the **SSL** tab and choose **Let's Encrypt**. ### Choose the options | Option | Default | What it does | | --- | --- | --- | | **Email for Let's Encrypt** | Your sign-in address | Let's Encrypt sends expiry warnings here if renewal ever fails. | | **Redirect HTTP to HTTPS** | On | Visitors on `http://` are sent to `https://`. | | **Wildcard certificate** | Off, or on when the site has a wildcard domain | Shown when the site's domains fit one wildcard certificate. See [Wildcard certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates). | | **Check domains first** | On | Before asking Let's Encrypt, the agent checks that each domain reaches this server, so a DNS mistake does not count against Let's Encrypt's rate limits. | | **Use the Let's Encrypt staging service** | Off | Issues a test certificate that browsers do not trust. Use it to try your setup without using up rate limits. | ### Issue it Click **Issue certificate**. The certificate shows as **Issuing** while Certbot runs, then **Active**. Follow the progress in the operation log. When it is active, NGINX serves the site on port 443 as well. The certificate covers every domain of the website except wildcards, which need a [wildcard certificate](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates). It is stored by Certbot under the name `vp-` in `/etc/letsencrypt/live/vp-/`. If a request fails, the **SSL** tab shows the error. A failed attempt to issue a certificate again leaves the working certificate in place. > **Tip:** Try the staging service first when you set up a new server. Let's Encrypt limits how many certificates and failed attempts each domain may have, and staging certificates do not count. Then click **Issue again** without the staging option. ## Wildcard certificates A wildcard certificate covers a domain and every name one level under it: `example.com` and `*.example.com`. It is the only way to get a Let's Encrypt certificate for a website with a [wildcard domain](https://docs.vaultpanel.net/guides/websites/domains#wildcard-domains), and it covers new subdomains without issuing again. Let's Encrypt checks wildcard certificates through DNS instead of HTTP: the agent adds a `TXT` record named `_acme-challenge` for the domain, waits until it is published, and removes it afterwards. That record can go in one of two places. ### Through the panel's DNS zone When the server that hosts the website also serves the domain's [DNS zone](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones), the agent adds the record to that zone itself. 1. Add the domain under **Web > DNS Zones** on the website's server, and point the domain's name servers at it at your registrar. 2. On the website's **SSL** tab, tick **Wildcard certificate (*.example.com)** and issue the certificate. ### Through a DNS provider When the domain's DNS is at Cloudflare or Namecheap, the agent adds the record through the provider's API. Staff save the provider's credentials once under **Web > DNS Zones > DNS providers**. See [DNS providers](https://docs.vaultpanel.net/guides/dns-and-email/dns-providers). 1. Tick **Wildcard certificate**. 2. In **Check DNS through**, choose the provider account instead of **This server's DNS zone**. The domain must use that provider's name servers. For Namecheap, the server's public IPv4 address must be whitelisted for Namecheap's API. > **Note:** Wildcard certificates need agent 0.28.0 or newer, and agent 0.38.0 or newer through a DNS provider. All of a website's domains must fit one wildcard certificate; when they do not, upload a certificate that covers them instead. ## Upload a certificate To use a certificate from another certificate authority, open the website's **SSL** tab and choose **Upload a certificate**. | Field | What to paste | | --- | --- | | **Certificate** | The site's certificate first, then the intermediate certificates (the CA bundle) your provider gave you, all as PEM text. | | **Private key** | The private key as PEM text, without a passphrase. It is sent to the server once and not kept in the panel. | | **Redirect HTTP to HTTPS** | On by default. | Use **Load from a file** to read either from a file. Before anything is installed, VaultPanel checks that the key belongs to the certificate, that the certificate has not expired and that it covers every domain of the website. The agent checks again on the server. To remove a passphrase from a key first: ```bash openssl pkey -in key.pem -out plain.pem ``` An uploaded certificate is never renewed by VaultPanel. Before it expires, use **Replace certificate** to upload the renewed one. Uploading needs agent 0.28.0 or newer. ## Manage a certificate With a certificate active, the **SSL** tab shows its names, issuer and dates, and an **Actions** card: ![The SSL tab of wordpress.vaultpanel.net: an active Let's Encrypt certificate covering wordpress.vaultpanel.net with its issuer, validity dates, contact email and certificate name, beside an Actions card with Renew now, Also serve plain HTTP, Issue again and Turn HTTPS off](https://docs.vaultpanel.net/screenshots/website-ssl-light.png) | Action | What it does | | --- | --- | | **Renew now** | Renews a Let's Encrypt certificate straight away, even outside the renewal window. Not shown for uploaded certificates. | | **Redirect HTTP to HTTPS** / **Also serve plain HTTP** | Turns the redirect from `http://` to `https://` on or off. | | **Issue again** / **Replace certificate** | Issues a new certificate (for example after adding domains), or uploads a new one. | | **Turn HTTPS off** | NGINX stops serving the site over HTTPS. Visitors who saved the `https://` address see an error. | ## Automatic renewal Let's Encrypt certificates last 90 days, and renew by themselves: 1. Certbot's timer on each server renews certificates once they are inside the renewal window. The agent keeps that timer on, and a hook reloads NGINX after each renewal. 2. The panel asks the server to renew any certificate that is still not renewed a day into the window, once a day per certificate, so a stopped timer does not leave a site to expire. Set the window on **Web > SSL Certificates**, in the **Automatic renewal** card: | Setting | Range | Default | | --- | --- | --- | | **Renew this many days before expiry** | 7 to 60 days | 30 | | **Warn when this many days are left** | At least 1, fewer than the renewal window | 14 | Saving applies the window on every server with certificates. Agents older than 0.25.0 keep Certbot's default of 30 days. Changing the setting needs the `settings.manage` permission. ### Expiry warnings A certificate renews long before the warning date, so reaching it means renewal failed. VaultPanel then raises these events: | Event | When | | --- | --- | | `ssl.expiring` | A certificate has fewer days left than the warning setting. It shows as **Expiring soon**. | | `ssl.expired` | A certificate expired. | | `ssl.renew_failed` | An automatic renewal by the panel failed. | Each one goes to the [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) that subscribe to it, and by email when you tick it under **Alerts by email** on [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). The [uptime check](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) also reports a website whose served certificate expired. ## The SSL Certificates page **Web > SSL Certificates** lists every certificate with its website, server and expiry date. Filter by **Active**, **Expiring soon**, **Expired**, **Issuing** or **Failed**. Staging certificates are marked **Staging** and uploaded ones **Uploaded**. The dates update from the agent, so a renewal by Certbot shows up here on its own. | State | Meaning | | --- | --- | | **Issuing** | A request is running. | | **Active** | Served by NGINX. | | **Expiring soon** | Active, with fewer days left than the warning setting. | | **Expired** | Active, but past its end date. | | **Failed** | The last request failed and there is no working certificate. | | **HTTPS off** | The site is served over HTTP only. | ## Troubleshooting - **The domain does not reach this server.** Fix the `A` or `AAAA` record and wait for DNS to update, then issue again. **Check domains first** catches this before Let's Encrypt is asked. - **Some domains are not covered.** Domains added after the certificate was issued, and wildcard domains without a wildcard certificate, are left out. Issue the certificate again. - **The wildcard option needs a DNS zone.** Add the zone under **Web > DNS Zones** on the website's server and point the domain's name servers at it, or use a DNS provider. - **The agent cannot issue wildcard or uploaded certificates.** Update the agent on the server. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). For more, see [Troubleshooting](https://docs.vaultpanel.net/troubleshooting). --- # PHP versions URL: https://docs.vaultpanel.net/guides/websites/php-versions > Install PHP 7.4 to 8.5 side by side on a server and choose the version each PHP website runs, without touching its files or settings. A server can run several PHP versions at once, and each PHP website runs one of them through its own PHP-FPM pool. Staff install versions on the server; a website's owner, hosting customers included, picks which one the site uses. ## Supported versions VaultPanel can install PHP **7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5**. A version the operating system ships comes from its own packages. Any other comes from the repository Ubuntu and Debian users rely on for this, added the first time a version needs it: | System | Repository | | --- | --- | | Ubuntu | `ondrej/php` on Launchpad | | Debian | `packages.sury.org` | Each version is installed with PHP-FPM, the command line and these extensions: MySQL, cURL, GD, mbstring, XML, ZIP and intl (plus JSON for PHP 7.4). ## Install a version ### Open the server Go to **Infrastructure > Servers**, open the server and choose the **Websites** tab. ### Pick the version In the **PHP versions** card, choose a version that is not installed yet and click **Install**. The agent installs it with `apt-get`; follow the progress in the operation log. The card lists the installed versions and the websites running each one. Installing and removing versions needs the `websites.manage` permission. ## Choose a website's version - **New website**: choose the **PHP version** when you create a PHP site. Only versions installed on the chosen server are offered. - **Existing website**: open the website and use the **PHP version** card on its **Overview** tab (or the **PHP version** field on the **Settings** tab), then click **Switch**. Switching moves the site's PHP-FPM pool to the new version. The site's files and settings stay as they are. If the version a site uses is no longer installed on its server, the card says so and asks you to pick another. > **Tip:** Before you switch a production site, check that your application supports the new version. If something breaks, switch back: the previous version stays installed until you remove it. ## Remove a version In the **PHP versions** card, click **Remove** next to a version you no longer need. The button is unavailable while websites use the version. The agent removes its packages and settings with `apt-get`, and refuses when: - a website still runs on that version (move it to another version first), - phpMyAdmin runs on it (see [phpMyAdmin](https://docs.vaultpanel.net/guides/databases/phpmyadmin)), - other software on the server needs it. ## Related - [Websites](https://docs.vaultpanel.net/guides/websites) for how PHP-FPM pools are set up per site. - [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings) for each site's upload size, memory, run time and workers. - [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer) for the minimum PHP version of WordPress, Joomla, Drupal and Laravel. --- # PHP settings URL: https://docs.vaultpanel.net/guides/websites/php-settings > Set a PHP website's largest upload, memory per request, longest run time, form fields and PHP workers, written to its own PHP-FPM pool. Each PHP website runs in its own PHP-FPM pool, so its PHP limits can differ from other sites on the same server. Set them in the **PHP settings** card on the website's **Settings** tab. > **Note:** Changing PHP settings needs agent 0.43.0 or later on the website's server. ## The settings | Setting | Range | Default | What it sets | | --- | --- | --- | --- | | **Largest upload (MB)** | 1 to 2048 | 64 | `upload_max_filesize` and `post_max_size`, and NGINX's `client_max_body_size` for the site. The biggest file a form or the media library takes. | | **Memory per request (MB)** | 32 to 4096 | 128 | `memory_limit`: how much memory one page load may use. | | **Longest run time (seconds)** | 5 to 3600 | 30 | `max_execution_time` and `max_input_time`. After this a page load is stopped. Imports and backups may need more. | | **Form fields** | 100 to 100000 | 1000 | `max_input_vars`. Large menus and page builders need more than 1000. | | **PHP workers** | 1 to 100 | 10 | `pm.max_children`: page loads the site answers at the same time. Each one can use the memory above. | The defaults are what every PHP website had before these settings existed. ## Change them 1. Open the PHP website and go to the **Settings** tab. 2. In the **PHP settings** card, change the values, or click **Recommended for WordPress** to fill in values that suit most WordPress and WooCommerce sites (128 MB upload, 256 MB memory, 120 seconds, 3000 form fields, 10 workers). 3. Click **Save and apply**. **Reset to defaults** fills in the defaults again; click **Save and apply** to use them. The agent writes the values into the site's PHP-FPM pool, and the upload size into the site's NGINX configuration, then tests both with `php-fpm -t` and `nginx -t` before they apply. If a test fails, the site keeps its previous settings. > **Tip:** More workers answer more visitors at once, but each can use the full **Memory per request**. Keep workers times memory below the memory the server can spare. ## Copies of a website [Clones and staging copies](https://docs.vaultpanel.net/guides/websites/staging-and-clones) keep the PHP settings of the website they copy. Switching the site's [PHP version](https://docs.vaultpanel.net/guides/websites/php-versions) keeps them too. ## Related - [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions) to choose the PHP version a site runs. - [Caching](https://docs.vaultpanel.net/guides/websites/caching) to answer more visitors without more workers. - [API reference](https://docs.vaultpanel.net/api-reference/websites#update-a-website) for the `phpSettings` field. --- # Caching URL: https://docs.vaultpanel.net/guides/websites/caching > Speed up PHP websites with NGINX's page cache, and WordPress with a Redis object cache that gives each website its own account. VaultPanel has two caches for PHP websites. They work separately, and a WordPress site can use both. | Cache | What it keeps | Where you turn it on | | --- | --- | --- | | **Page cache** | Finished pages, served by NGINX without running PHP. | The **Page cache** card on a PHP website's **Settings** tab. | | **Object cache (Redis)** | The answers of WordPress's database queries. | The **Object cache (Redis)** card on the website's **WordPress** tab. | > **Note:** Both caches need agent 0.43.0 or later on the website's server. ## Page cache ![The Settings tab of wordpress.vaultpanel.net: the Configuration card with type PHP site, PHP 8.4, document root public and Use .htaccess files, above the Page cache card with Keep pages for (minutes) set to 10 and a Turn on button](https://docs.vaultpanel.net/screenshots/website-settings-light.png) The page cache is NGINX's FastCGI cache. NGINX keeps each finished page for the time you choose and serves it to the next visitors without running PHP, so pages load faster and fewer PHP workers are busy. ### Turn it on 1. Open the PHP website and go to the **Settings** tab. 2. In the **Page cache** card, set **Keep pages for (minutes)**: 1 to 1440 (a day). The default is 10. 3. Click **Turn on**. To change the time later, edit it and click **Save and apply**. **Turn off** stops caching. ### What is never cached - Signed-in visitors and visitors with a session: WordPress, WooCommerce, Laravel, Joomla and Drupal session cookies, and plain `PHPSESSID`. - Forms and anything that is not a `GET` or `HEAD` request. - Addresses with a query string (`?…`). - Admin and sign-in pages, carts, checkouts and account pages: `/wp-admin/`, `wp-login.php`, `xmlrpc.php`, `/wp-json/`, `wp-cron.php`, `/cart`, `/checkout`, `/my-account`, `/basket`, `/administrator/`, feeds and XML sitemaps. - Pages that set a cookie. Only answers with status 200, 301 and 302 are kept. ### Empty the cache Click **Purge cache** in the **Page cache** card. Every page is made fresh on its next visit. Changes from the [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools) (updates, plugins, theme and maintenance mode) empty the cache on their own. After you edit a page in WordPress itself, purge the cache or wait until the time runs out. ### Check that it works Pages served through the cache carry an `X-VaultPanel-Cache` header: `HIT` when NGINX served the page from the cache, `MISS` when PHP made it. ```bash curl -sI https://example.com/ | grep -i x-vaultpanel-cache ``` The header is left out when the site's [custom NGINX rules](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess) contain their own `add_header` lines, so those rules keep working. ### Limits - PHP websites only. - Not with `.htaccess` files: with **Use .htaccess files** on, Apache runs PHP, and the card asks you to turn `.htaccess` files off first. - [Clones and staging copies](https://docs.vaultpanel.net/guides/websites/staging-and-clones) keep the page cache setting of the website they copy. ## Redis object cache for WordPress WordPress can keep the answers of its database queries in Redis, so pages and the dashboard build faster, especially with WooCommerce and many plugins. ### Install Redis on the server 1. Open the server and go to its **Databases** tab. 2. In the **Database server** card, install **Redis**. VaultPanel runs its own Redis for websites, `vaultpanel-redis`, apart from any other Redis on the server: - It listens on `127.0.0.1` port 6380 only. - It is a cache only: nothing is written to disk, it uses up to 256 MB, and the least used keys are dropped when it is full. - Each website has its own Redis account that reaches only that website's keys, without administrative or dangerous commands. One website cannot read or empty another's cached data. - The stock `redis-server` service, which has no password, is stopped and disabled. ### Turn it on for a website Open the website's **WordPress** tab and click **Turn on** in the **Object cache (Redis)** card. The agent: 1. installs the Redis Object Cache plugin from wordpress.org, if it is not there yet, 2. writes its settings to `wp-config.php`, 3. checks that WordPress reaches Redis, and takes it all back if it does not. The card then shows **On** when WordPress reaches Redis, or **Not connected** when it cannot. Pages still work without the cache; check that `vaultpanel-redis` runs on the server's **Services** tab. **Empty object cache** removes the website's cached keys and says how many went. **Turn off** stops using Redis. If another plugin already provides an object cache (`wp-content/object-cache.php`), the card names it. Turn that plugin off in WordPress to use Redis here. ## Permissions Turning either cache on or off and emptying it needs the `websites.manage` permission. Installing Redis on a server needs `websites.manage` too. ## Related - [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings) for PHP workers and memory. - [API reference](https://docs.vaultpanel.net/api-reference/websites#empty-the-page-cache) for `pageCache` and purging. --- # NGINX rules and .htaccess URL: https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess > Add custom NGINX directives to a website's server block, or turn on .htaccess files so Apache serves the site behind NGINX for rewrites and protection. VaultPanel generates each website's NGINX configuration from its settings. When a site needs more, such as redirects, rewrites, headers or caching, you have two options: add **custom NGINX rules** to its server block, or turn on **`.htaccess` files** so Apache serves the site behind NGINX, the way WordPress plugins and many PHP applications expect. ## Custom NGINX rules Custom rules are added to the site's server block, like a virtual host include. Open the website, go to the **Settings** tab and use the **Custom NGINX rules** card. ```nginx # Send the old blog to its new address. location /blog/ { return 301 https://blog.example.com$request_uri; } # Cache static assets for a month. location ~* \.(css|js|png|jpg|svg|woff2)$ { expires 30d; add_header Cache-Control "public"; } gzip on; gzip_types text/css application/javascript; ``` Before saving, VaultPanel reads the rules the way NGINX does and checks every directive against an allow list. The agent checks them again, writes the configuration and runs `nginx -t`. If the test fails, the site keeps its current configuration. ### What is allowed | Kind | Allowed | | --- | --- | | Blocks | `location`, `if`, `limit_except` | | Redirects and rewrites | `return`, `rewrite`, `break`, `set`, `try_files`, `error_page`, `internal`, `absolute_redirect`, `port_in_redirect`, `server_name_in_redirect`, `merge_slashes` | | Headers and caching | `add_header`, `add_trailer`, `expires`, `etag`, `if_modified_since`, `charset`, `default_type`, `index`, `autoindex` | | Compression | `gzip`, `gzip_comp_level`, `gzip_min_length`, `gzip_proxied`, `gzip_types`, `gzip_vary` | | Access | `allow`, `deny`, `satisfy`, `valid_referers` | | Limits and timeouts | `client_max_body_size`, `client_body_timeout`, `keepalive_timeout`, `send_timeout`, `limit_rate`, `limit_rate_after` | | Proxying | `proxy_pass` (to a fixed `http://` or `https://` address), `proxy_set_header`, `proxy_hide_header`, `proxy_pass_header`, `proxy_http_version`, `proxy_buffering`, `proxy_cache_bypass`, `proxy_connect_timeout`, `proxy_read_timeout`, `proxy_send_timeout`, `proxy_redirect` | | PHP | `fastcgi_param`, `fastcgi_buffer_size`, `fastcgi_buffers`, `fastcgi_read_timeout` | | Content | `sub_filter`, `sub_filter_once`, `sub_filter_types`, `log_not_found` | Anything else is refused, including `root`, `alias`, `include`, log directives and Unix sockets, and so is another `location /` (the site already has one). The rules can be up to 8,192 characters. ### Who can set them Custom rules go into NGINX as text, so only staff can write them: a hosting customer's change to them is refused. They need agent 0.18.0 or newer on the server. > **Warning:** Custom rules apply to every request the server block handles. Test them on a staging site first: a rule that passes `nginx -t` can still redirect or block more than you meant. ## .htaccess files With **Use .htaccess files** on, NGINX passes the site's requests to Apache, which reads `.htaccess` files in the site's folders. Rewrites, redirects, headers and password protection in `.htaccess` then work, as WordPress plugins and many PHP applications expect. NGINX still handles HTTPS, certificates and the Let's Encrypt check. ### Turn it on 1. Install **Apache** on the server: open the server's page, go to the **Websites** tab and install it from the **Web stack** card. Apache is optional software and is not part of **Install all missing**. 2. Open the website, go to the **Settings** tab, tick **Use .htaccess files** and save. ### How it runs - Apache listens on `127.0.0.1:8080` only, behind NGINX, as its own user (`vp-apache`). It joins a site's group only while that site has `.htaccess` files on, so it can read that site's files and no others. - PHP still runs in the site's own PHP-FPM pool, as the site user. - The site's Apache configuration is `/etc/apache2/sites-available/vp-.conf`, and its logs are `/var/log/apache2/vp-.access.log` and `.error.log`. VaultPanel tests it with `apache2ctl configtest` and puts the previous one back when the test fails. ### What .htaccess files may contain Besides the `AuthConfig`, `Indexes` and `Limit` groups (password protection, directory listings and access rules), `.htaccess` files may use: | Purpose | Directives | | --- | --- | | Rewrites | `RewriteEngine`, `RewriteBase`, `RewriteCond`, `RewriteRule`, `RewriteOptions` | | Redirects | `Redirect`, `RedirectMatch`, `RedirectPermanent`, `RedirectTemp` | | Errors and headers | `ErrorDocument`, `Header` | | Caching | `ExpiresActive`, `ExpiresByType`, `ExpiresDefault`, `FileETag` | | File types | `AddType`, `AddCharset`, `AddDefaultCharset`, `AddEncoding`, `AddLanguage`, `DefaultLanguage` | Directives such as `SetHandler` and `SetEnv` are not allowed, so a site cannot send requests to another site's PHP or change PHP's settings. Symbolic links are followed only when they belong to the same owner, and hidden files other than `.well-known` are never served. ### Limits - `.htaccess` files are for static and PHP sites, not reverse proxies. - A static site cannot be a [single-page app](https://docs.vaultpanel.net/guides/websites#change-a-websites-settings) and use `.htaccess` files at the same time: add the `index.html` fallback to your `.htaccess` file instead. - `.htaccess` files need agent 0.18.0 or newer. Turning `.htaccess` files off removes the site's Apache configuration and takes Apache's user out of the site's group. --- # File manager URL: https://docs.vaultpanel.net/guides/websites/file-manager > Browse, edit, upload and download a website's files in the browser, unpack and create archives, and change permissions, all as the site's own Linux user. The file manager works inside a website's home folder, `/var/www/`. Every request runs on the server as the website's own Linux user, so it can reach that site's files and nothing else, and new files belong to the site. Open it from **Data & Files > File Manager** and pick a website, or from the **Files** tab of a website. ## What you can do | Action | How | | --- | --- | | Browse | Click folders, or use the path at the top to go back up. Up to 2,000 entries are listed per folder. | | Edit a text file | Click the file. The editor opens text files up to 10 MB; binary files can be downloaded but not edited. | | Create | **New file** or **New folder**. | | Upload | **Upload** files from your computer. A file with the same name asks before it is replaced. | | Download | The download button on a file's row. | | Rename, delete | The buttons on each row. | | Extract | The extract button on a `.zip`, `.tar.gz`, `.tgz` or `.tar` file. | | Compress | Select files and folders, then click **Compress** to make a `.zip` file. | | Permissions | The permissions button on each row. | Paths always stay inside the website's folder. Symbolic links are listed but never followed. ## Large files Small files go straight through the panel. Larger ones travel in pieces, so their size is not limited by a single request: - **Uploads** go up in pieces of up to 8 MB. The panel keeps them until the whole file is in, checks its SHA-256, and the server's agent then fetches the file over its signed connection and saves it in the site as the site's user. The panel's own limit is set with `VAULTPANEL_FILE_UPLOAD_MAX_MB` (default 2048 MB); no agent takes more than 10 GB. - **Downloads** of large files work the other way: the agent reads the file as the site's user and sends it to the panel, which checks it against the agent's SHA-256 before you download it. The limit is `VAULTPANEL_FILE_DOWNLOAD_MAX_MB` (default 2048 MB), and copies are removed an hour after they are ready. Saving a file from the editor is limited to 1 MB. ## Extract archives Click the extract button on an archive and choose: | Field | Notes | | --- | --- | | **Extract into folder** | A path inside the site. A folder that does not exist yet is created; leave it empty for the home folder. | | **Replace files that already exist** | Off by default: files that already exist in the folder are kept as they are. | The archive is unpacked on the server as the website's user. It is unpacked only when its content fits in the free disk space (and 20 GB by default). The agent installs `unzip`, `zip` and `tar` when they are missing. ## Compress files Select up to 200 files and folders in one folder, then compress them. Give the archive a name ending in `.zip`. ## Permissions The permissions dialog shows who may read, write and run (or open, for folders) the file or folder, as a grid and as a number: - Folders are usually `755`. - Files are usually `644`; scripts that run, `755`. For a folder, **Also change everything inside** sets the folder permissions on every folder inside it and separate permissions on every file. Permissions are three digits from 0 to 7; special bits (setuid, setgid, sticky) are not available. ## Permissions to use it | Permission | Allows | | --- | --- | | `files.read` | Browsing, opening and downloading files. | | `files.write` | Creating, editing, uploading, renaming, deleting, extracting, compressing and changing permissions. | Hosting customers reach only their own websites' files. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles). ## Related - [Git deploy](https://docs.vaultpanel.net/guides/websites/git-deploy): deploy a site from a repository instead of uploading its files. - [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups): back up a website's files before large changes. --- # Git deploy URL: https://docs.vaultpanel.net/guides/websites/git-deploy > Deploy static and PHP websites from a Git repository into release folders, with builds, environment variables, instant rollbacks and signed push-to-deploy webhooks. Instead of uploading files, a static or PHP website can deploy from a Git repository. Each deployment clones the repository on the server, runs your install and build commands, and switches the site to the new release. The newest releases stay on the server, so a rollback is instant, and a push to your branch can deploy by itself. Git deploy is optional and set per website. Apps (Node.js, Python, Go, Ruby) deploy from Git on their own: see [Deployments](https://docs.vaultpanel.net/guides/applications/deployments). ## How it works - Each deployment goes into its own folder under `releases/`. - The site serves `current`, a link to the live release's output folder. NGINX (and PHP-FPM for PHP sites) follow the link. - The files the site served before, usually `public/`, are kept. The site serves them again if you turn Git deploy off. - `.ssh/` holds the site's deploy key for private repositories. A deployment goes through these stages, as the site's own Linux user: | Stage | What happens | | --- | --- | | Prepare | The site's release folders are checked. | | Clone | The branch is cloned into a new release folder. | | Install | Dependencies are installed (see [Install command](https://docs.vaultpanel.net/guides/websites/git-deploy#build-settings)). | | Build | Your build command runs. | | Publish | The output folder is found and `current` is switched to it. | | Health check | The agent checks that the site still answers. | A deployment that fails before the switch leaves the live release untouched. One whose site stops answering after the switch is switched back. ## Requirements - A static or PHP website. See [Websites](https://docs.vaultpanel.net/guides/websites). - **Git** on the server: install it from the **App runtime** card on the server page's **Applications** tab. - For PHP sites with a `composer.json`, **Composer** on the server (optional software, from the same card). - For `npm`, `npx`, `yarn` or `pnpm` commands, Node.js installed system-wide on the server. A Node.js installed in a home folder (for example by nvm) cannot be used. - Agent 0.22.0 or newer for static sites, 0.24.0 or newer for environment variables, 0.32.0 or newer for PHP sites. ## Turn on Git deploy ### Open the Deployments tab Open the website and go to its **Deployments** tab. ### Enter the repository and build settings Fill in the settings described in [Build settings](https://docs.vaultpanel.net/guides/websites/git-deploy#build-settings). ### Turn it on Click **Turn on Git deploy**. With **Deploy now** ticked, the first deployment starts as soon as the site's release folders and deploy key are set up. For a private repository over SSH, leave **Deploy now** off: add the deploy key to the repository first, then deploy. ### Build settings | Setting | Notes | | --- | --- | | **Git repository** | An `https://` URL for a public repository, or an SSH address such as `git@github.com:you/site.git` for a private one. Passwords in the URL are not accepted. | | **Branch** | The branch to deploy. Defaults to `main`. | | **Output folder** | The folder that is served after the build. Static sites: such as `dist` or `build`. PHP sites: the folder with `index.php`, such as `public` for Laravel and Symfony, so the rest of the repository stays out of reach of visitors. Empty serves the repository as it is. | | **Build command** | Optional. Static sites: such as `npm run build`; empty for plain HTML. PHP sites: runs after Composer, such as `php artisan config:cache`. | | **Install command** | Optional. Empty: PHP sites get `composer install` when there is a `composer.json`. When there is a build command and a `package.json`, npm installs the dependencies (`npm ci` with a lockfile, otherwise `npm install`). | | **Releases to keep** | 1 to 20; default 5. Older releases are removed after each deployment. The live and previous releases are always kept. | Commands run one per line, up to 10 lines of up to 500 characters each, as the site user. They run without a shell, so `|`, `&`, `;`, `<`, `>`, backticks and `$(` are refused: put each command on its own line instead. Blank lines and lines starting with `#` are skipped. The settings are saved at once and used by the next deployment. ## Private repositories Each website has its own deploy key. Once Git deploy is set up on the server, the **Deploy key** card shows its public key. Add it to the repository as a read-only deploy key (on GitHub: **Settings > Deploy keys**), and use the repository's SSH address. ## Environment variables The website's **Environment** tab holds variables for its deployments, stored encrypted in the panel. They are given to the install and build commands. - **Static sites**: a build copies the ones it uses into the site's files, so visitors can read them. Do not put passwords or private keys here. - **PHP sites**: they are also written to the release's `.env` file, where Laravel and Symfony read them, when the site serves an output folder (such as `public`) and the repository has no `.env` file of its own. Saved variables are used by the next deployment. ## Deploy and roll back - **Deploy now** on the **Deployments** tab starts a deployment of the branch's latest commit. - Each row in the deployments list shows the commit, how it started (**Manual**, **First deploy**, **Git push** or **Rollback**), its status and duration. The live release is marked **Live**. - **Roll back** switches the site to an earlier release that is still on the server. Nothing is rebuilt. While a deployment runs, the website shows **Applying changes** and other changes wait. ## Push to deploy With push to deploy, each push to the website's branch deploys it. The webhook works with GitHub, GitLab, Gitea, Forgejo and Bitbucket, and every request must be signed with the webhook's secret. ### Create the webhook On the **Deployments** tab, in the **Push to deploy** card, click **Turn on**. VaultPanel shows a **Webhook URL** and a **Secret** once: copy both now. ### Add it to your repository In your Git host, add a webhook with: - the **Webhook URL** as its address, - content type `application/json`, - push events, - the **Secret** in its secret field (GitLab: **Secret token**). The URL has the form `https://panel.example.com/api/v1/hooks/deploy/`, built from the panel's address. Pushes to other branches and other events are ignored, and a ping is acknowledged without deploying. | Git host | How the request is signed | | --- | --- | | GitHub, Gitea, Forgejo, Bitbucket | An HMAC-SHA256 of the body in `X-Hub-Signature-256`, `X-Gitea-Signature` or `X-Forgejo-Signature`. | | GitLab | The secret itself in `X-Gitlab-Token`. | A request without a valid signature is refused and recorded in the audit log. If the URL or secret leaks, click **Create a new URL**: the old URL stops working. **Turn off** removes the webhook. > **Warning:** A webhook turned on before VaultPanel signed webhooks shows **On, unsigned**: anyone with its URL can start a deployment. Click **Create a new URL** to get a secret, then update the webhook in your Git host. ## Turn off Git deploy **Turn off Git deploy** on the **Deployments** tab stops deployments, rollbacks and push to deploy, and the webhook URL stops working. The site serves the folder it served before Git deploy was turned on, with the files it had then, and you manage it with the [file manager](https://docs.vaultpanel.net/guides/websites/file-manager) again. Releases stay on the server until the website is deleted. While Git deploy is on, the website's type cannot change, and its document root is the live release: set the folder to serve with **Output folder** instead. --- # Uptime monitoring URL: https://docs.vaultpanel.net/guides/websites/uptime-monitoring > How the panel checks each website the way visitors reach it, records uptime and downtime, and raises the Website down alert when a site stops answering. VaultPanel checks every website from the panel itself, the way visitors reach it: through public DNS, over HTTPS when the site has a certificate for the name. A site that stops answering shows **Down** and raises the **Website down** alert. Monitoring is on for every new website. ## How a check works Every 5 minutes by default, the panel's worker checks the websites that are due: 1. It looks the website's primary domain up in public DNS (or the first domain that is not a wildcard). 2. It asks for the front page, over HTTPS when the website's active certificate covers that domain, otherwise over HTTP. Redirects are not followed. 3. When the check fails, it waits 10 seconds and checks again, so a single blip does not count. A website is **down** when it: - does not answer within 10 seconds, or refuses the connection, - answers with a server error (HTTP 5xx), - serves a certificate that browsers refuse: expired, not covering the domain, not valid yet, or not trusted. A website on a Let's Encrypt staging certificate is not counted as down for being untrusted. Any other answer, including redirects and `404`, means the website is up. Only public addresses, or the website's own server, are contacted. A domain that points at an internal address is reported as down instead of being checked, unless the panel allows private networks with `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE`. Only enabled websites with monitoring on are checked. A website with only wildcard domains has no address to check. ## The Uptime card The **Uptime** card on a website's **Overview** tab shows: | Field | What it shows | | --- | --- | | Status | **Up** or **Down**, and for how long. | | Message | The last result, such as `HTTP 200 in 84 ms` or the reason it is down. | | **Last 24 hours**, **Last 7 days**, **Last 30 days** | Uptime as a percentage. | | **Response time** | The average response time today. | | **Certificate served** | When the certificate the site served expires. | | **Recent downtime** | When each outage started, how long it lasted and why. | **Check now** runs one check straight away, without the second try. **Turn monitoring off** stops the checks for this website, forgets its current state and ends any open downtime, so its alert resolves. **Turn monitoring on** starts them again. ## The Website down alert A built-in alert rule, **Website down**, fires while a website fails its uptime checks for 60 seconds, with severity **critical**. It works like any other [alert rule](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts): change its duration or severity, turn it off, and get it by email and webhook through the `alert.firing` and `alert.resolved` events. - Email: tick **An alert started firing** under **Alerts by email** on [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). It is ticked by default. - Webhooks: subscribe a [webhook](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) to `alert.firing`. ## Settings Two settings in the panel's `.env` file (`/opt/vaultpanel/.env` on a panel set up by the installer) control the checks: | Setting | Default | What it does | | --- | --- | --- | | `VAULTPANEL_UPTIME_CHECK_SECONDS` | `300` | How often each website is checked. At least 60 seconds, or `0` to turn regular checks off (**Check now** still works). | | `VAULTPANEL_UPTIME_HISTORY_DAYS` | `30` | How many days of check history the panel keeps, from 1 to 365. | Restart the panel after changing them: ```bash sudo vaultpanel restart ``` > **Note:** The panel's own website (see [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain)) is not checked here. --- # Statistics URL: https://docs.vaultpanel.net/guides/websites/statistics > See a website's visitors, page views, traffic, bots and errors per day, with its top pages, referrers, browsers and missing pages, read from its NGINX access log. The **Statistics** tab of a website shows how it is used: visitors, page views, traffic, bots and errors for each day, and the top pages, the sites visitors came from, their browsers and systems, and the pages not found. Nothing is added to the website's pages: the numbers come from its NGINX access log on the server. > **Note:** Website statistics need agent 0.49.0 or later on the website's server. ## How they are collected Once a day, the panel asks each server to read the access logs of its websites (`/var/log/nginx/vp-.access.log`, and its rotated and compressed copies too). The agent sums each day and sends only the totals to the panel. Click **Read now** on the tab to read the log straight away. The first read goes back 14 days, so a website shows some history as soon as it is read. After that, each read picks up from the last day it saw. ### Privacy Only the day totals and top lists reach the panel. Addresses, user agents and query strings stay in the log on the server. The panel stores statistics, not raw visits, for about a year (400 days). ## What the numbers mean ![The Statistics tab of wordpress.vaultpanel.net over 30 days: 46 visitors, 76 page views, 35.3 MB of traffic in 5,167 requests and 4,860 bots and errors, above a chart of visitors and page views from Oct 20 to Nov 18](https://docs.vaultpanel.net/screenshots/website-stats-light.png) Choose the period at the top of the tab: **7 days**, **30 days**, **90 days** or **1 year**. | Number | What it counts | | --- | --- | | **Visitors** | Different visitors each day, added up. A visitor is a different address and browser on that day, not a cookie. | | **Page views** | Requests for pages. Images, styles, scripts and requests from bots are not page views. | | **Traffic** | The data sent, and the number of requests. | | **Bots and errors** | Requests from bots, and the number of `4xx` and `5xx` answers (with the server errors separately). | A chart shows visitors and page views per day. Below it: | Card | What it lists | | --- | --- | | **Top pages** | The pages viewed most. | | **Where visitors came from** | Other sites that linked visitors here. | | **Browsers**, **Systems** | Visitors' browsers and operating systems, with their share. | | **Pages not found (404)** | Addresses that answered 404. | | **Responses** | Requests by status class: `2xx`, `3xx`, `4xx` and `5xx`. | ## No visits yet If the tab shows no visits, either the log has not been read yet (it is read within a day, or now with **Read now**), or the website's domain does not point at this server yet. Visits show the day after they happen. ## Permissions The **Statistics** tab, and **Read now**, need the `websites.read` permission. Hosting customers see the statistics of their own websites. ## Related - [Uptime monitoring](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) for whether the website answers. - [API reference](https://docs.vaultpanel.net/api-reference/websites#get-website-statistics) for the statistics endpoints. --- # SFTP URL: https://docs.vaultpanel.net/guides/websites/sftp > Turn on SFTP for a website so you can upload and edit its files with FileZilla, WinSCP, Cyberduck or sftp, locked into the website's own folder. Each website can have an SFTP account: its own Linux user signs in over SSH with a password, SSH keys or both, and sees only the website's files. Use it with an SFTP app such as FileZilla, WinSCP or Cyberduck, or the `sftp` command. Manage it on the website's **SFTP** tab. > **Note:** SFTP accounts need agent 0.47.0 or later on the website's server. The protocol is SFTP, not FTP. ## Turn SFTP on ![The SFTP tab of wordpress.vaultpanel.net: the SFTP access card marked Off with a Turn on button, a Password card with Generate and Save and turn on, and an SSH keys card with no keys yet and a box to add a public key](https://docs.vaultpanel.net/screenshots/website-sftp-light.png) ### Open the SFTP tab Open the website and go to the **SFTP** tab. ### Turn it on In the **SFTP access** card, click **Turn on**. When the account has no password or key yet, the panel generates a strong password and shows it once. Copy it straight away. You can also turn SFTP on by saving a password (**Save and turn on**) or adding a key (**Add key and turn on**). ### Connect The card shows what to enter in your SFTP app, each with a copy button: | Field | What it is | | --- | --- | | **Host** | The server's public address. | | **Port** | The server's SSH port (22 unless you moved it). | | **Username** | The website's name, which is also its Linux user. | | **Folder** | `/`, where the website's files are. | | **From a terminal** | The `sftp` command to connect, such as `sftp shop@203.0.113.10`. | The change runs as a job; the card shows **Applying…** until it finishes. ## What the account can do - It sees only `/`: no other website, not even their names. The agent locks the user into a root-owned folder onto which the website's home folder is mounted, and mounts it again after every reboot. - It has the same rights on the files as the website itself, so files it uploads belong to the website. - It gets SFTP only: no shell, no port forwarding and no tunnels. The agent writes one SSH configuration file for every website with SFTP on the server, and tests it with `sshd -t` before SSH reloads. ## Passwords and keys The **Password** card sets a password of 12 to 128 characters. Type one, or click **Generate**, then **Save and apply**. The new password is shown once. **Remove password** takes it away; it is not available while SFTP is on and the account has no key. The **SSH keys** card holds up to 20 public keys, one per person or computer, such as the contents of `~/.ssh/id_ed25519.pub`. Paste a key under **Add a public key** and click **Add key**. Each key is listed with its comment and fingerprint; **Remove** stops that computer from signing in. The last key cannot be removed while SFTP is on and there is no password. The panel keeps only a hash of the password, never the password itself. > **Tip:** Keys are safer than passwords. With a password, [Fail2ban](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates) on the server blocks addresses that keep guessing. ## Turn SFTP off Click **Turn off** in the **SFTP access** card. The account can no longer sign in, and its folder, mount and keys are removed from the server. Deleting the website does the same. ## Permissions | Permission | Allows | | --- | --- | | `websites.read` and `files.read` | Seeing the **SFTP** tab and the connection details. | | `websites.manage` | Turning SFTP on and off, and changing the password and keys. | ## Related - [File manager](https://docs.vaultpanel.net/guides/websites/file-manager) to work with the files in the browser. - [SSH](https://docs.vaultpanel.net/guides/security/ssh) for the server's SSH port and sign-in settings. - [API reference](https://docs.vaultpanel.net/api-reference/websites#get-sftp-settings) for the SFTP endpoints. --- # Web application firewall URL: https://docs.vaultpanel.net/guides/websites/web-application-firewall > Turn on ModSecurity with the OWASP Core Rule Set for a website, start in detect-only mode, turn off rules that catch real visitors, and limit WordPress sign-in attempts. The web application firewall checks each request before it reaches a website and stops common attacks such as SQL injection, cross-site scripting and file inclusion. It is ModSecurity in NGINX with the OWASP Core Rule Set (CRS). You install it once per server, and then turn it on for each website on its **Firewall** tab. PHP websites also get **Sign-in protection**, a limit on WordPress sign-in attempts from one address. It does not need the firewall to be installed. > **Note:** The web application firewall and sign-in protection need agent 0.44.0 or later on the website's server. ## Install it on a server ### Open the server's security Open the server and go to its **Security** tab, or open **Security > Firewall** and pick the server. ### Install In the **Web application firewall** card, click **Install**. The agent installs the `libnginx-mod-http-modsecurity` and `modsecurity-crs` packages and loads the rules into NGINX once, for all websites. Installing changes no website: the firewall stays off for every site until you turn it on in that site's **Firewall** tab. If NGINX cannot load the rules, the agent takes the change back and NGINX keeps running as before. Each request the firewall checks costs a little CPU. Installing needs the `security.manage` permission. ## Turn it on for a website ![The Firewall tab of wordpress.vaultpanel.net: the Web application firewall card set to Off with Detect only and Block attacks options, a Sign-in protection card with 10 attempts a minute, Turn on and a Block XML-RPC option, and the What the firewall caught list](https://docs.vaultpanel.net/screenshots/website-firewall-light.png) Open the website and go to the **Firewall** tab. The **Web application firewall** card has three modes: | Mode | What happens | | --- | --- | | **Off** | The firewall does not check this website. The default. | | **Detect only** | Requests are checked and logged, but nothing is blocked. Requests it would block show as **Would block**. | | **Block attacks** | Attacks are answered with `403 Forbidden`. The card shows **Blocking**. | Click a mode to apply it. Each change is an ordinary website change: the agent writes the site's NGINX configuration and tests it with `nginx -t` before NGINX reloads. > **Tip:** Start with **Detect only**. Check **What the firewall caught** for a few days, turn off any rule that catches your own visitors, then switch to **Block attacks**. If the firewall is not installed on the server, the tab says so and the modes cannot be turned on. The firewall works for every website type: static, PHP and reverse proxy. ## Turn rules off for a website A rule that catches real visitors (a form, a page builder, an API call) can be turned off for one website without changing others. - In **What the firewall caught**, click **Turn off for this website** next to the rule. - Or, under **Rules turned off for this website**, type the **Rule id** (such as `942100`) and click **Turn off rule**. Click the cross next to a rule id to turn the rule on again. A website can turn off up to 100 rules. ## What the firewall caught The **What the firewall caught** card lists the newest 50 requests that matched a rule for this website, read from the server's firewall log, and how many requests in the recent log were caught and blocked. Click **Refresh** to read it again. | Column | What it shows | | --- | --- | | **When** | The time and the visitor's address. | | **Request** | The method, address and host name. | | **Rules** | Each rule that matched, with its id and message. | | **Result** | **Blocked** (answered with 403), **Would block** (in detect-only mode) or **Logged**. | Reading the log needs the `websites.logs` permission. ### What the log keeps The firewall writes one log on the server, readable by root only, in `/var/log/vaultpanel-waf`. It keeps the request line, the visitor's address, the response status and the rules that matched. It never keeps headers or request bodies, so no cookies or passwords are stored. Rotated logs are kept for 7 days. ## Sign-in protection PHP websites have a **Sign-in protection** card on the **Firewall** tab. It limits the attempts to sign in to WordPress from one address, which stops password guessing. | Setting | Default | What it does | | --- | --- | --- | | **Attempts a minute from one address** | 10 | 1 to 60. Counts `POST` requests to `wp-login.php` and `xmlrpc.php`. | | **Block XML-RPC (xmlrpc.php)** | Off | Refuses every request to `xmlrpc.php`. Keep it off if you use the WordPress mobile app or Jetpack. | Click **Turn on**, or **Save and apply** after a change. **Turn off** removes the limit. Past the limit, NGINX answers `429 Too Many Requests` until a minute has passed. Visitors who sign in normally never reach it. Only a WordPress at the top of the website is covered. ## Copies of a website A [clone or staging copy](https://docs.vaultpanel.net/guides/websites/staging-and-clones) keeps the firewall mode, the rules turned off and the sign-in protection of the website it was copied from. ## Permissions | Permission | Allows | | --- | --- | | `security.manage` | Installing the firewall on a server. | | `websites.manage` | Changing a website's firewall mode, rules and sign-in protection. | | `websites.logs` | Reading **What the firewall caught**. | ## Related - [Firewall](https://docs.vaultpanel.net/guides/security/firewall) for the server's own port firewall. - [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning) for files already on a website. - [API reference](https://docs.vaultpanel.net/api-reference/websites#read-firewall-events) for the `waf` and `loginLimit` settings. --- # Malware scanning URL: https://docs.vaultpanel.net/guides/websites/malware-scanning > Install ClamAV on a server, scan websites on request or every week, and quarantine, delete or ignore the files a scan finds. VaultPanel scans websites for malware with ClamAV. You install ClamAV once per server, then scan each website from its **Malware** tab, or let the server scan every website once a week. > **Note:** Malware scanning needs agent 0.43.0 or later on the website's server. ## Install ClamAV on a server 1. Open the server and go to its **Security** tab. 2. In the **Malware scans** card, click **Install**. ClamAV then downloads its virus signatures, which takes a few minutes; scans can start once they are there. `clamav-freshclam` keeps them current, and the card shows when they were last updated. ClamAV needs about 1.2 GB of free memory while it scans. When the server has less free memory, the agent refuses the scan with a message saying so; try again at a quieter time, or add memory. ### Weekly scans Click **Scan every website weekly** in the **Malware scans** card to scan each website on the server once a week. The server scans one website at a time, at low priority. **Stop weekly scans** turns it off. Installing ClamAV and turning weekly scans on or off needs the `security.manage` permission. ## Scan a website ![The Malware tab of wordpress.vaultpanel.net: the Malware scan card, last scanned 2h ago with 4380 files and 0 found, a Scan now button and a Scan log link, above an empty Found list saying Nothing found](https://docs.vaultpanel.net/screenshots/website-malware-light.png) Open the website, go to the **Malware** tab and click **Scan now**. The **Malware scan** card shows when the last scan ran, how many files it checked and how many it found, and links to the **Scan log**. A scan runs ClamAV as the website's own Linux user, never as root, at the lowest CPU and disk priority. It checks every file in the site's home folder except its logs, `tmp` folder and caches. ## What a scan finds The **Found** card lists each file with its kind and status. | Kind | Meaning | | --- | --- | | **Malware** | ClamAV recognised the file. The signature name is shown under the path. | | **Suspicious** | A PHP file inside `wp-content/uploads`. WordPress keeps only media there, so a PHP file there is usually planted. Check it before you delete it. | When infected files are found, the tab shows a warning, and the website appears in the dashboard's **Needs attention** list until each file is quarantined, deleted or ignored. ### What to do with a file | Action | What it does | | --- | --- | | **Quarantine** | Moves the file out of the website to a folder only root can read, under `/var/lib/vaultpanel/quarantine`. Pages that need the file stop working until it is restored. **Quarantine all** does this for every file still on the site. | | **Restore** | Puts a quarantined file back where it was. It is never written over another file. Only restore a file you are sure is not malware. | | **Delete** | Removes the file for good, from the website or from quarantine. A backup is the only way back. | | **Ignore** | Leaves the file on the website and stops listing it as found. **Stop ignoring** lists it again. | A file that a later scan finds again keeps its status, so an ignored file stays ignored. Quarantine, restore and delete run on the server as root. The agent walks the file's path from the site's home one folder at a time without following links, so a hacked site cannot trick it into touching files outside the site. > **Tip:** After you quarantine or delete malware, change the website's passwords, update WordPress and its plugins (see [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools)), and scan again. ## Hosting customers Customers see the **Malware** tab of their own websites. When ClamAV is not installed on the server, the tab asks them to contact their host. ## Permissions | Permission | Allows | | --- | --- | | `websites.read` | Seeing the last scan and what it found. | | `websites.manage` | **Scan now**, and quarantining, restoring, deleting and ignoring files. | | `security.manage` | Installing ClamAV and turning weekly scans on or off. | ## Related - [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) to stop attacks before they reach a website. - [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups) to restore a website from before an infection. - [API reference](https://docs.vaultpanel.net/api-reference/websites#get-malware-scan-results) for the malware endpoints. --- # App installer URL: https://docs.vaultpanel.net/guides/websites/cms-installer > Install WordPress, Joomla, Drupal or Laravel in a PHP website in one step, with its database and admin account, from the official release checked on download. The app installer puts WordPress, Joomla, Drupal or Laravel in a PHP website in one step. VaultPanel creates the app's database and user, downloads the app from its own project, checks it, and runs its installer. Open it from **Web > App Installer**, or from the **Apps** tab of a PHP website. ## Supported apps | App | Needs PHP | Installed | Source | | --- | --- | --- | --- | | **WordPress** | 7.4 or newer | In the document root, or a folder of it | wordpress.org, checked against its published SHA-1 | | **Joomla** | 8.1 or newer | In the document root, or a folder of it | The Joomla project's GitHub releases, checked against their SHA-256 | | **Drupal** | 8.1 or newer | As a project folder; the site serves its `web/` folder | `drupal/recommended-project` through Composer, with Drush | | **Laravel** | 8.2 or newer | As a project folder; the site serves its `public/` folder | `laravel/laravel` through Composer | Drupal and Laravel are projects: their code and settings (`.env`, `vendor/`) sit in a folder at the top of the site, and the website's document root becomes the project's public folder, so they are never served. ## Install an app ### Open the installer Go to **Web > App Installer**, or open a PHP website's **Apps** tab, and click **Install an app**. ### Choose the app and where it goes Pick the app, then **An existing PHP website** or **A new website**. For a new website, choose the **Server**, the **Domain**, the **Site name** and the **PHP version**, as when you [create a website](https://docs.vaultpanel.net/guides/websites#create-a-website). ### Fill in the details | Field | Notes | | --- | --- | | **Folder** (WordPress, Joomla) | Optional. `blog` installs the app at `example.com/blog`. The folder must be empty. Leave it empty to install at the site's address. | | **Project folder** (Drupal, Laravel) | Required; `drupal` or `laravel` by default. Made at the top of the site. | | **Site title** | The site's name in the app. | | **Admin username** | 3 to 60 letters, digits, dots, dashes and underscores. | | **Admin email** | Optional. | | **Admin password** | Optional: 12 to 128 characters without spaces. Leave it empty for a strong generated one. | Laravel has no admin account, so it asks only for its folder. ### Install The install takes a minute or two. VaultPanel shows the app's address and, for apps with an admin, its admin page, username and password. > **Important:** The admin password is shown once. Save it before you close the window: VaultPanel does not keep it. ## What the installer does 1. **The website**: a new PHP website when you chose one, created the usual way. 2. **The database**: a database and a user with all privileges on it, on the server's database server, named after the site and the app. It is linked to the website, so the website's [backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups) can include it. It also shows on the [Databases](https://docs.vaultpanel.net/guides/databases) page. 3. **The app**: the agent installs any PHP extensions the app needs (and Composer for Drupal and Laravel), downloads the app, checks it, puts it in the site and runs its installer. Everything runs as the website's own Linux user, and passwords reach the installers through their environment, never their command line. 4. **The document root**: for Drupal and Laravel, the website's document root is pointed at the project's public folder. The installed app shows on the list with its status: waiting, installing, installed, removing or failed. A failed install removes what it put in the site. ## Requirements and limits - The website must be a PHP website running a PHP version the app supports. Switch the version on the website's **Overview** first, or install a newer one: see [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions). - A website that serves an app from **Applications**, or the panel itself, cannot take an installed app. - Drupal and Laravel take over the website's document root, so a website can hold only one of them, and not next to another installed app. - Two apps cannot share a folder. - The project folder cannot be `tmp`, `logs`, `releases`, `shared` or `current`. - The server's agent must be 0.20.0 or newer. For hosting customers, the website (when a new one is made), the database and the database user count against their plan, and the install is refused before anything is made when the plan has no room. ## Remove an app Click the remove button next to the app on the list. Its files are deleted from the website; the website itself stays. - **Also delete its database** deletes the app's database and its user too. Take a [backup](https://docs.vaultpanel.net/guides/backups-and-automation/backups) first if you need the content. - For Drupal and Laravel, the website's document root goes back to what it was before the install. --- # WordPress tools URL: https://docs.vaultpanel.net/guides/websites/wordpress-tools > Update WordPress, its plugins and themes, switch maintenance mode and debug logging, and sign in as an administrator, from the website's WordPress tab. A website with WordPress from the [app installer](https://docs.vaultpanel.net/guides/websites/cms-installer) has a **WordPress** tab. It shows the WordPress version and available updates, the plugins and themes, and the administrators, and lets you change them without signing in to WordPress. > **Note:** The WordPress tools need agent 0.43.0 or later on the website's server, and the `websites.manage` permission. A website with several WordPress installs shows the first one. ## How the tools work Each tool runs on the server as the website's own Linux user, against the website's own WordPress, with the PHP version the site uses. WordPress loads without its plugins while a tool runs, so a broken plugin cannot lock you out. Each change is a job; longer ones, such as updates, open their log in the job drawer. ## Updates The top card shows the WordPress version, the site's address and PHP version, and when updates were last checked. - **Check for updates** asks wordpress.org now. - **Update everything** installs every available update of WordPress, its plugins and its themes. The site shows a maintenance page for a minute while they install. Take a [backup](https://docs.vaultpanel.net/guides/backups-and-automation/backups) first. - **Update all plugins** and **Update all themes** update one kind only. - **Update** next to a plugin or theme updates just that one. When nothing needs updating, the card says that WordPress, its plugins and themes are up to date. ## Plugins and themes The **Plugins** card lists each plugin with its version, whether an update is available, and whether it is **Active**, **Network active** or **Inactive**. Use **Activate** and **Deactivate** to turn a plugin on or off. The **Themes** card lists each theme, its parent theme for child themes, and which one is **Active**. **Activate** switches the theme; visitors see the new theme straight away, and widgets and menus may need setting up again. ## Maintenance mode and debug logging | Switch | When on | | --- | --- | | **Maintenance mode** | Visitors see "Briefly unavailable for scheduled maintenance". Turn it on while you work on the site. | | **Debug logging** | PHP errors and notices go to `wp-content/debug.log`. They are logged, not shown to visitors. | Use **Turn on** and **Turn off** on each switch. ## Administrators The **Administrators** card lists the WordPress administrators. - **Open WordPress admin** (top card) and **Sign in** (next to an administrator) open the WordPress dashboard in a new tab, signed in. The link works once, for two minutes. If nothing opens, allow pop-ups for the panel. - **New password** sets a strong password made by the panel and shows it once. Copy it straight away. The administrator is signed out of WordPress everywhere. ## Object cache The **Object cache (Redis)** card turns on a Redis object cache for the site. See [Caching](https://docs.vaultpanel.net/guides/websites/caching#redis-object-cache-for-wordpress). ## Page cache When the website has the [page cache](https://docs.vaultpanel.net/guides/websites/caching#page-cache) on, updates, plugin and theme changes, and maintenance mode empty it on their own. ## Related - [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer) to install WordPress. - [Staging and clones](https://docs.vaultpanel.net/guides/websites/staging-and-clones) to try updates on a copy first. - [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall#sign-in-protection) to limit sign-in attempts. - [API reference](https://docs.vaultpanel.net/api-reference/websites#wordpress-tools) for the WordPress endpoints. --- # Staging and clones URL: https://docs.vaultpanel.net/guides/websites/staging-and-clones > Make a staging copy of a website to try changes, push it back to the live site with a backup first, or clone a website to a new name and domain. The **Staging & clone** tab of a website copies it to another website on the same server, with its files, its databases and its settings. | Copy | What it is | | --- | --- | | **Staging copy** | A copy at `staging.`, linked to the live website. Try updates and changes there, then push them to the live site. | | **Clone** | A new, separate website with its own name and domain. | > **Note:** Copies need agent 0.43.0 or later on the website's server. ![The Staging & clone tab of wordpress.vaultpanel.net with a Staging card offering a copy at staging.wordpress.vaultpanel.net and a Create staging copy button, beside a Clone card with a Clone website button](https://docs.vaultpanel.net/screenshots/website-copies-light.png) ## What can be copied - Static and PHP websites that are active, with no change running. - Not websites deployed from Git: deploy the repository to another website instead. - Not a website that serves an app: copy the app instead. - Not the panel's own website. - Up to 10 databases linked to the website. ## What a copy holds 1. **A new website** of the same type, PHP version and document root, made the usual way with its own Linux user and folder. 2. **The files.** They are read as the source website's user and written as the copy's, so the copy holds only what the source could read, and all of it belongs to the copy. Logs, `tmp`, `.ssh` and `.cache` are not copied. 3. **The databases** linked to the website: each gets a new database and user of the copy's own, and its data is copied into it. 4. **The settings**: [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings), the [page cache](https://docs.vaultpanel.net/guides/websites/caching#page-cache), `.htaccess` files, single-page app, [custom NGINX rules](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess), and the [web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) and sign-in protection. 5. **WordPress** from the [app installer](https://docs.vaultpanel.net/guides/websites/cms-installer) is pointed at its new database and address, serialized values included, and the copy gets the [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools). A copy starts without a certificate. Issue one on its **SSL** tab once its domain points at the server. ## Make a staging copy ### Open the tab Open the live website and go to the **Staging & clone** tab. ### Create it In the **Staging** card, click **Create staging copy**. Leave **Address** empty to use `staging.`, or type another domain. When the server holds the domain's [DNS zone](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones), the copy's DNS record is added for you. Otherwise point the address at the server yourself. ### Follow it Click **Create staging copy**. The panel opens the new website. The copy is listed under **Recent copies** on both websites, with **Log** to follow it. A website has one staging copy at a time, and a staging copy cannot have one of its own. Anyone with its address can open it. ## Push staging to live A staging copy shows a **Staging copy of …** banner with **Push to live**. 1. Click **Push to live**. 2. Type the live website's domain to confirm. The panel first backs up the live website and its databases. Once the backups are done, the agent copies the staging copy's files and databases over the live site's, and puts the live address back. A WordPress keeps the live site's own database user and address. > **Warning:** Orders, comments or sign-ups made on the live site since the staging copy was made are lost. To get them back, restore the backup taken before the push. See [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups). Pushing needs the `backups.create` permission as well. ## Clone a website 1. On the **Staging & clone** tab, click **Clone website** in the **Clone** card. 2. Enter the **Name** of the copy (lowercase letters, digits and dashes: the copy's Linux user and folder) and its **Domains** (one or more, separated by spaces or commas). 3. Click **Clone website**. The clone is a separate website on the same server. It has no link to the website it came from. ## Copy statuses | Status | Meaning | | --- | --- | | **Preparing** | The new website and its databases are being created. | | **Backing up live** | A push is waiting for the live site's backups. | | **Copying** | The agent copies the files and databases. | | **Done** | The copy is finished. | | **Failed** | The copy stopped. The error is shown under it. | ## Hosting customers A customer's copies count against their plan: a staging copy as a subdomain, a clone as a website, and their databases as databases and database users. ## Permissions | Permission | Allows | | --- | --- | | `websites.manage` | Making staging copies and clones. | | `databases.manage` | Needed as well when the website has linked databases. | | `backups.create` | Needed as well to push a staging copy to live. | ## Related - [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools) to update a staging copy before you push it. - [API reference](https://docs.vaultpanel.net/api-reference/websites#list-a-websites-copies) for the copy endpoints. --- # Running applications URL: https://docs.vaultpanel.net/guides/applications > Deploy Node.js, Python, Go and Ruby apps from Git, run them under PM2 as their own Linux user, and give them a domain with SSL. VaultPanel deploys apps from a Git repository into release folders, keeps them running with PM2 under systemd, and puts NGINX in front of them when you give them a domain. Each app runs as its own Linux user, so one app cannot read another's files. ## Supported runtimes | Runtime | Dependencies | Default build command | Default start command | | --- | --- | --- | --- | | Node.js | `npm ci --include=dev` when there is a `package-lock.json`, otherwise `npm install --include=dev` | None | `npm start` | | Python | A virtual environment in the release (`.venv`), then `pip install -r requirements.txt` | None | `gunicorn app:app` | | Go | `go mod download` when there is a `go.mod` | `go build -o app .` | `./app` | | Ruby | `bundle install --jobs 4`, with gems in the release's `vendor/bundle` | None | `bundle exec puma -b tcp://127.0.0.1:$PORT` | Your own install command replaces the default one. Go and Ruby apps need agent 0.32.0 or newer. Ruby apps run in production mode (`RACK_ENV` and `RAILS_ENV` are `production`; set your own values in the app's environment to change them), and Go apps get `GIN_MODE=release`. PHP websites can also deploy from Git into releases. That is a website feature, described in [Git deployments for websites](https://docs.vaultpanel.net/guides/websites/git-deploy). ## Before you start The server needs the tools apps use. Open the server's page and install them from the **App runtime** card: - **Git** to fetch the code, and **PM2** to keep apps running (installed with npm next to the server's system-wide Node.js). - **Python**, **Go** or **Ruby** for apps in those languages. Node.js apps and PM2 run on a system-wide Node.js, in `/usr/local/bin` or `/usr/bin` (the agent itself does not use Node.js). If Node.js on the server is installed in a home folder (for example with nvm), apps cannot use it: install Node.js system-wide. > **Note:** If the server is missing something, the **New application** form says what to install, and the API answers `409` with the code `SOFTWARE_MISSING`. ## How an app runs Every app gets a Linux user named after the app and a home folder under `/var/www`: - **`releases/`** holds one folder per deployment, named by the time it was made and a random suffix. The newest few are kept for rollbacks. - **`current`** points at the live release. The process always runs from it, so a rollback only moves the link and restarts. - **`shared/`** holds the PM2 process file and the `.env` file (mode 600) written from the app's environment variables. - **`logs/`** holds the app's output and error logs. - **`.ssh/id_ed25519`** is the app's deploy key for private repositories. PM2 runs in the foreground of a systemd unit named `pm2-`, as the app's user. systemd starts it at boot and restarts it if it stops. The unit is sandboxed: the app cannot see `/home` or `/root`, has its own `/tmp`, and cannot gain privileges or change kernel settings. Install, build and start commands run as the app's user, never as root. ## Create an app ### Open the form Go to **Applications** and click **New application**. ### Fill in the app | Field | What it does | | --- | --- | | **Server** | The server the app runs on. It needs a connected agent. | | **Runtime** | Node.js, Python, Go or Ruby. | | **Git repository** | An `https://` URL for a public repository, or an SSH address such as `git@github.com:you/app.git` for a private one. Never put a password in the URL. | | **Branch** | The branch to deploy. Defaults to `main`. | | **App name** | 3 to 32 lowercase letters, digits and dashes, starting with a letter. It is also the Linux user and folder name, must differ from every other app and website on the server, and cannot be changed later. | | **Port** | The port the app listens on, from 1024 to 65535. The app receives it as the `PORT` environment variable. Leave it empty for a worker without a web port. | | **Start command** | The command that starts the app, run from the app's folder. Empty uses the runtime's default. | | **Domain**, **More domains** | Optional. NGINX forwards these domains to the app's port. An app with a domain needs a port. | The form suggests the first free port from 3000 up. Ports 3306, 5432, 6379, 11211 and 27017 are refused because databases and caches usually take them, and so is a port another app or website on the server already uses. ### Add build commands and environment variables (optional) Click **Build commands and environment** to set the **Install command**, the **Build command** and the **Environment variables** (one `KEY=value` per line, like a `.env` file). ### Create it Leave **Deploy as soon as the app is set up** ticked to deploy right away. Untick it to set the app up first, for example to add its deploy key to a private repository before the first deployment. The panel then creates the app's user and folders, adds its website if you gave a domain, and runs the first deployment. Each step is a job you can follow in the drawer. See [Deployments and push to deploy](https://docs.vaultpanel.net/guides/applications/deployments) for what a deployment does. ### Commands Install, build and start commands run without a shell: - one command per line, up to 10 lines of 500 characters each; blank lines and lines starting with `#` are skipped; - arguments are split like a shell would, with quotes grouping words; - pipes, redirects, `;`, `&&`, backticks and `$(...)` are not supported. Put anything more complex in a script in your repository; - `$PORT` and `${PORT}` are replaced by the app's port. The start command is a single line. A program it names is looked up in the release first (for example `node_modules/.bin` or the Python virtual environment), then on the server. ## Environment variables The **Environment** tab lists the app's variables. Edit them one by one, or click **Edit as text** to paste a `.env` file. - Values are stored encrypted in the panel and written to the server only for the app's user, in `shared/.env`. - Up to 100 variables. Names use letters, digits and underscores and cannot start with a digit. Values are up to 8,192 characters. - `PORT`, `PATH`, `HOME`, `USER` and `PM2_HOME` are set by VaultPanel and cannot be set by hand. - Opening the tab is recorded in the audit log, and so is every change (names only, never values). Changes apply on the next deployment. To use them now, click **Apply and restart** on the **Settings changed since the app started** banner. The same banner appears when you change the start command, the port, the health check, the resource limits or the number of copies. > **Tip:** Creating a database for the app can add its connection settings to the environment for you. See [MariaDB databases](https://docs.vaultpanel.net/guides/databases). ## Domains and SSL An app's domains are served by a website of the same name: an NGINX reverse proxy from the domains to the app's port. Add domains when you create the app, or later on its **Domains** tab (the app needs a port first). Domains, DNS checks and certificates are then managed on that website, exactly as for any other site. See [Domains](https://docs.vaultpanel.net/guides/websites/domains) and [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). ## Run, stop and restart The **Overview** tab shows the PM2 process: its state, process ID, memory and restarts. Use **Restart**, **Stop** and **Start** to control it. The app restarts by itself if it crashes, and starts again when the server boots. A **Restart** of a Node.js app with zero-downtime reloads on starts the new process before stopping the old one. See [Zero-downtime reloads](https://docs.vaultpanel.net/guides/applications/deployments#zero-downtime-reloads). ## Logs The **Logs** tab reads the app's output log (`logs/app-output.log`) or error log (`logs/app-error.log`) from the server: the last 200 lines by default, from 10 to 2,000. ## Settings The **Settings** tab holds: | Setting | What it does | | --- | --- | | **Git repository**, **Branch** | Where the next deployment comes from. | | **Start command**, **Install command**, **Build command** | See [Commands](https://docs.vaultpanel.net/guides/applications#commands). | | **Releases to keep** | How many releases stay on the server for rollbacks, from 1 to 20. Default 5. Older ones are removed after each deployment. | | **Health check (seconds)** | How long a new release has to start answering on its port, from 5 to 300. Default 30. | | **Zero-downtime reloads** | Node.js only. See [Zero-downtime reloads](https://docs.vaultpanel.net/guides/applications/deployments#zero-downtime-reloads). | | **Resource limits** | CPU and memory caps. See [Scaling apps](https://docs.vaultpanel.net/guides/applications/scaling#resource-limits). | | **Deploy key** | The public key to add to a private repository. See [Private repositories](https://docs.vaultpanel.net/guides/applications/deployments#private-repositories). | | **Push to deploy** | A webhook that deploys on every push. See [Push to deploy](https://docs.vaultpanel.net/guides/applications/deployments#push-to-deploy). | The repository, branch and build commands apply on the next deployment. The start command and port need a restart with the new settings. ## Apps of hosting customers A hosting customer's app goes on their account's server, counts against their plan, and is capped at the plan's CPU and memory per app. Each customer also has their own app ports, taken from 10000 to 19999: as many as their plan allows apps. Their apps can only listen on those ports, and no other app can take them, so the **Port** field becomes a list of the customer's free ports. See [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing). ## Delete an app On the **Settings** tab, click **Delete app** and type the app's name to confirm. The app stops, its PM2 service is removed, and so are its website, NGINX site and certificate if it has one. Tick **Also delete the files** to delete the Linux user and its releases, logs and `.env` as well. This cannot be undone. The app's databases are always kept. ## Permissions | Permission | Allows | | --- | --- | | `applications.read` | Seeing apps and deployments. | | `applications.deploy` | Deploying, rolling back, starting, stopping and restarting. | | `applications.logs` | Reading the app's logs. | | `applications.manage` | Creating, changing and deleting apps, and their environment variables. | The built-in **developer** role can read, deploy and read logs; **viewer** can only read. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles). --- # Deployments and push to deploy URL: https://docs.vaultpanel.net/guides/applications/deployments > How VaultPanel deploys an app from Git in stages, rolls back to an earlier release, deploys on every push and reloads Node.js apps without downtime. Each deployment clones your branch into a new release folder, installs and builds it there, then switches the app to it and checks that it answers. The running release is never touched until the new one is ready, and a release that fails its health check is switched back. ## Deploy Click **Deploy now** on the app's **Deployments** tab. A deployment also runs when the app is created (unless you untick **Deploy as soon as the app is set up**), and on every push when [push to deploy](https://docs.vaultpanel.net/guides/applications/deployments#push-to-deploy) is on. Only one change runs on an app at a time. While a deployment runs, the app shows as **deploying**, and a second deployment is refused with `409 APPLICATION_BUSY` until it finishes. ## Stages A deployment goes through these stages, in order. A failed deployment names the stage it stopped at. | Stage | What happens | | --- | --- | | **Prepare** | The app's user and folders are checked or created. | | **Fetch** | `git clone --depth 1` of the branch into `releases/`. The commit hash, author and message are recorded. | | **Install** | Dependencies are installed (see [Supported runtimes](https://docs.vaultpanel.net/guides/applications#supported-runtimes)), or your install command runs. | | **Build** | Your build command runs, if there is one. | | **Configure** | The environment and the PM2 process file are written. | | **Start** | `current` switches to the new release and the app starts or restarts. | | **Health check** | With a port, the app must answer on it within the health check time (30 seconds by default). Without a port, it must stay running. | If anything fails before **Start**, the running release keeps running and the half-made release is removed. If the health check fails and there was a previous release, the app switches back to it and the deployment fails with `HEALTH_CHECK_FAILED`. A deployment can run for up to 30 minutes. > **Tip:** A health check failure usually means the app does not listen on the `PORT` environment variable. Read the **Logs** tab's error log for the reason. ## Deployment history ![The Deployments tab of the app vault-panel-docs: a Settings changed since the app started notice with Apply and restart, and one deployment, the first deploy of commit d06c993, marked Succeeded and Live](https://docs.vaultpanel.net/screenshots/app-deployments-light.png) The app's **Deployments** tab lists its deployments, newest first, with their commit, trigger and status, and marks the live release **Live**. **Deployments** in the sidebar lists every deploy and rollback of every app. Open one to see its full log. | Trigger | Started by | | --- | --- | | `manual` | **Deploy now** or the API. | | `create` | The first deployment when the app was created. | | `webhook` | A push to the app's branch. | | `rollback` | A rollback to an earlier release. | Statuses are `queued`, `running`, `succeeded`, `failed` and `cancelled`. ## Roll back The newest releases stay on the server (5 by default; **Releases to keep** in **Settings**, up to 20), always including the live and the previous one. To go back to one, click **Roll back** next to it on the **Deployments** tab. The app switches to that release and restarts with the current environment and start command. Nothing is rebuilt, so a rollback takes seconds. It still runs the health check. You can roll back only to a release that deployed successfully and is still on the server. A release that was removed answers `409 RELEASE_NOT_FOUND`: deploy its commit again instead. ## Private repositories Use the repository's SSH address (`git@github.com:you/app.git`) for a private repository. When the app is set up, VaultPanel makes an Ed25519 deploy key for it in the app's `.ssh` folder. ### Create the app without deploying Untick **Deploy as soon as the app is set up** when you create the app. ### Add the deploy key to the repository Copy the public key from the **Deploy key** card on the app's **Settings** tab, and add it to the repository as a read-only deploy key (on GitHub: **Settings > Deploy keys**). ### Deploy Click **Deploy now**. Git connects with that key and trusts the Git host's key the first time it sees it. `https://` repositories are cloned without a key, so they must be public. ## Push to deploy Push to deploy gives the app a webhook URL for GitHub, GitLab, Gitea, Forgejo or Bitbucket. Each push to the app's branch deploys it; pushes to other branches are ignored. ### Turn it on On the app's **Settings** tab, click **Turn on** on the **Push to deploy** card. Copy the **Webhook URL** and the **Secret** now: they are shown only once. The URL has the form `https://panel.example.com/api/v1/hooks/deploy/`, built from the panel's address, so the panel must be reachable from your Git host. ### Add the webhook to your repository Add a webhook with that URL, content type `application/json`, and push events. Paste the secret in its secret field: | Git host | Where the secret goes | | --- | --- | | GitHub | **Secret** | | GitLab | **Secret token** | | Gitea, Forgejo | **Secret** | | Bitbucket | **Secret** | ### Push A push to the branch answers `202` and starts a deployment with the trigger `webhook`. Ping events and events other than pushes answer `200` and do nothing. ### How requests are checked The token in the URL finds the app, and the secret proves the request came from your Git host: - GitHub, Gitea, Forgejo and Bitbucket sign the body with HMAC-SHA256. VaultPanel reads the signature from `X-Hub-Signature-256` (`sha256=`), `X-Gitea-Signature` or `X-Forgejo-Signature` (``), or `X-Hub-Signature` when it starts with `sha256=`. - GitLab sends the secret itself in `X-Gitlab-Token`. A request without a valid signature answers `401 WEBHOOK_SIGNATURE_INVALID`, deploys nothing, and is recorded in the audit log as `application.webhook_rejected`. The webhook endpoint accepts up to 30 calls a minute. To replace a leaked URL or secret, click **Create a new URL**, then update the webhook in your Git host. **Turn off** removes the webhook. > **Warning:** A webhook turned on before VaultPanel signed webhooks shows **On, unsigned**: anyone with its URL can start a deployment. Click **Create a new URL** to get a secret. ## Zero-downtime reloads Node.js apps can reload without dropping requests: deployments, restarts and saved settings start the new version before stopping the old one, so the port keeps answering. This needs agent 0.32.0 or newer. To use it: 1. Make the start command run a Node.js file directly, such as `node server.js`, not `npm start`. PM2 runs the app in cluster mode, which can only run a Node.js script. A program that is itself a Node.js script, such as `node_modules/.bin/next`, also works. 2. Tick **Zero-downtime reloads** on the **Settings** tab and save. 3. Click **Apply and restart** once, so the app starts in cluster mode. A deployment then logs a reload instead of a restart. If the start command cannot run in cluster mode, the deployment fails at the **Configure** stage and says why. Running several copies of an app uses the same cluster mode. See [Scaling apps](https://docs.vaultpanel.net/guides/applications/scaling). ## API Deployments can be started and followed through the REST API, the SDK and the CLI: ```js import { VaultPanel } from '@vaultpanel/sdk'; const panel = new VaultPanel({ baseUrl: 'https://panel.example.com', token: process.env.VAULTPANEL_TOKEN }); const { job } = await panel.applications.deploy(appId); await panel.jobs.wait(job.id); ``` See [Applications API](https://docs.vaultpanel.net/api-reference/applications) and [CLI commands](https://docs.vaultpanel.net/cli/commands). --- # Scaling apps URL: https://docs.vaultpanel.net/guides/applications/scaling > Run several copies of a Node.js app or several Python workers on one server, and cap an app's CPU and memory with systemd limits. An app can run as several copies on its server to use more CPU cores, and can be capped on CPU and memory so it never takes the whole server. Both are set per app and apply to all of its copies together. ## Run several copies Open the app's **Overview** tab, set **Copies** (or **Workers** for a Python app) in the **Scaling** card, and click **Scale now**. Apps can run from 1 to 16 copies. This needs agent 0.14.0 or newer. How the copies run depends on the runtime: | Runtime | How several copies run | | --- | --- | | Node.js | PM2 cluster mode: the copies share the app's port and PM2 spreads connections between them. | | Python | One process with that many workers: the app gets `WEB_CONCURRENCY`, which Gunicorn and Uvicorn use as their number of workers. | | Go, Ruby | Always one process, so the **Scaling** card is not shown. Start more workers inside the app instead (Puma reads `WEB_CONCURRENCY`). | ### Node.js copies PM2 cluster mode can only run a Node.js script, so the start command must run a Node.js file, such as `node server.js`, not `npm start`. Use the command your `package.json` start script runs. If the start command cannot run in cluster mode, setting more than one copy fails and says why. Copies are added or removed while the others keep serving. Going from one copy to several, or back to one, restarts the app once. With several copies, the **Scaling** card lists each one with its status, process ID, memory, CPU and restarts. ### Python workers Changing the number of workers restarts the app. Programs other than Gunicorn and Uvicorn may ignore `WEB_CONCURRENCY` and run one process; the deployment log says so. A running app is reconfigured as soon as you scale it. A stopped or not yet deployed app uses the new number the next time it starts. ## Resource limits Under **Resource limits** on the app's **Settings** tab: | Setting | Range | Meaning | | --- | --- | --- | | **CPU (% of one core)** | 10 to 6,400 | 100 is one full core, 200 two cores. Empty for no limit. | | **Memory (MiB)** | 64 to 262,144 | The most memory the app may use. Empty for no limit. | The limits are applied by systemd to the app's `pm2-` unit (`CPUQuota` and `MemoryMax`), so they cover every copy together. systemd stops the app if it goes over its memory limit, and starts it again. Limits apply to the running app, not to installs and builds. Changing a limit needs a restart: click **Apply and restart** on the banner that appears. For a hosting customer's app, the limits stay within the CPU and memory per app that the customer's plan allows. See [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing). ## Zero downtime Zero-downtime reloads use the same PM2 cluster mode, even with one copy. See [Zero-downtime reloads](https://docs.vaultpanel.net/guides/applications/deployments#zero-downtime-reloads). --- # Docker containers URL: https://docs.vaultpanel.net/guides/applications/containers > Run Docker images on your servers with safe defaults, published ports, volumes, environment variables and limits, and automatic rollback on updates. VaultPanel runs Docker images from Docker Hub or another public registry on any connected server. It builds every container itself from a few settings, so a container can never be privileged, use the host's network or mount a folder of the host. When an update does not start, the old container comes back. ## Set up Docker Containers need agent 0.10.0 or newer. Go to **Containers** and choose the server: - If Docker is not installed, **Install Docker** installs the system's `docker.io` package and starts it. - If Docker is installed but stopped, **Start Docker** starts it and makes it start at boot. A Docker that is already there, the snap one included, is used as it is. The card then shows how many containers run, how many VaultPanel deployed, the number of images and Docker's data folder. ## Deploy a container Click **Deploy a container**, then fill in: | Field | What it does | | --- | --- | | **Server** | A server where Docker is running. | | **Name** | 3 to 32 lowercase letters, digits and dashes, starting with a letter. Other containers reach it by this name. | | **Image** | Such as `nginx:1.27`, `redis:7` or `ghcr.io/owner/app:tag`. | | **Ports** | Up to 10. Each maps a port on the server to a port in the container, for TCP or UDP, reachable from **This server only** or **Public**. | | **Volumes** | Up to 10. Each is a named volume mounted at a path in the container, optionally read-only. | | **Environment variables** | Up to 100, kept encrypted. | | **Restart** | **Unless stopped** (default), **Always**, **On failure** or **Never**. | | **Health check (seconds)** | How long the new container must stay up before the deployment counts as done. 3 to 300, default 10. | | **Memory limit (MB)** | 32 to 262,144. Empty for no limit. | | **CPU limit (%)** | 5 to 6,400; 100 is one CPU core. Empty for no limit. | | **Command** | Optional. The command to run instead of the image's own, as you would type it. It runs without a shell. | VaultPanel pulls the image, creates the container on its own Docker network (`vaultpanel`), starts it and watches it for the health check time. A container that stops, keeps restarting or, when the image has its own health check, reports unhealthy fails the deployment. One that reports healthy early counts as up straight away. ### Ports | Reachable from | Address | Use it for | | --- | --- | --- | | **This server only** | `127.0.0.1` | A website in front of it (a reverse proxy) or another app on the server. | | **Public** | `0.0.0.0` | Direct access from the internet. | > **Public ports skip the firewall:** Docker opens public ports itself, even when the server's firewall has no rule for them. Anyone on the internet can reach them. Prefer **This server only** and a website in front. ### Volumes A volume is the container's own Docker volume, named `vp--`. Data in volumes survives updates and redeploys. Folders of the host are never mounted. ### Safe defaults Every container VaultPanel deploys runs with: - no privileged mode, no added capabilities or devices, and `no-new-privileges`; - the `vaultpanel` Docker network instead of the host's network; - log files capped at 3 files of 10 MB each; - the labels `io.vaultpanel.managed` and `io.vaultpanel.id`. ## Update a container Open the container and change its settings on the **Settings** tab, then click **Save and redeploy**. Tick **Pull the image again** to get the newest image for the tag even when the server already has it. **Redeploy** pulls and recreates the container with its current settings. An update replaces the container safely: 1. The image is pulled when you asked for it or when the server does not have it yet. 2. The current container is stopped and set aside under another name. 3. The new container is created, started and watched for the health check time. 4. If it stays up, the old container is removed. Its volumes are kept. 5. If it does not, the new container is removed and the old one is started again. Saving new environment variables works the same way: the old container keeps running if the new one does not start. ## Start, stop and logs **All containers** lists every container on the server, including ones VaultPanel did not deploy. You can start, stop, restart, inspect, read the logs of and remove any of them, except the panel's own MariaDB and Redis containers, which the panel and the agent refuse to stop, restart or remove. The **Images** tab lists the server's images. **Pull image** downloads one; removing an image deletes it from the server. ## Remove a container On the container's page, click **Remove container**. The container and its record are deleted, and its image stays on the server. Its volumes are kept unless you choose to delete them too, which cannot be undone. ## Permissions | Permission | Allows | | --- | --- | | `containers.read` | Seeing containers and images. | | `containers.operate` | Starting, stopping and restarting containers. | | `containers.logs` | Reading container logs. | | `containers.manage` | Deploying, changing and removing containers, reading their environment variables, installing Docker and managing images. | The built-in **developer** role can read, operate and read logs. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles) and the [Containers API](https://docs.vaultpanel.net/api-reference/containers). --- # MariaDB databases URL: https://docs.vaultpanel.net/guides/databases > Create MariaDB databases and users with generated passwords, add their connection settings to an app, and link them to apps and websites. VaultPanel creates MariaDB databases and users on your servers through the agent, generates strong passwords, keeps them encrypted in the panel, and can hand a database's connection settings straight to an app. ## The database server ![The Databases page: MySQL / MariaDB marked Available and PostgreSQL and Redis coming later, a phpMyAdmin card for vmi3756066 with Open phpMyAdmin, and the database wordpress_vaultpanel_wo26284d used by wordpress-vaultpanel-net, 784.0 KB and Active](https://docs.vaultpanel.net/screenshots/databases-light.png) Databases live in the MariaDB that runs on the server itself, listening on `127.0.0.1` port 3306. The installer can set it up on the panel's own server (see [Installation](https://docs.vaultpanel.net/getting-started/installation)); on any server you can install it from the **Database server** card on the server's page. MySQL 8.4 and 8.0 come in a later version. PostgreSQL and Redis are listed under **Databases** as coming later and cannot be created yet. ## Create a database ### Open the form Go to **Databases** and click **New database**, or open an app's **Databases** tab to create one for that app. ### Name it | Field | What it does | | --- | --- | | **Server** | The server whose MariaDB holds the database. | | **Database name** | 2 to 64 lowercase letters, digits and underscores, starting with a letter. `mysql`, `information_schema`, `performance_schema`, `sys`, `test` and `phpmyadmin` are reserved. | | **For app** | Optional. The app that uses it. | | **For website** | Optional. The website that uses it, so its **Backups** tab can back the database up too. | ### Create a user for it **Create a user for it** is ticked by default. The user is named like the database unless you give a **Username**, and gets the **Access** you choose: | Access | Privileges | | --- | --- | | **Full access** | Read, write and change the structure (tables, indexes). | | **Read only** | `SELECT` only. | With an app chosen, tick **Add the connection settings to the app's environment** to add the variables below to the app. ### Save the password The user's generated password and connection URL are shown once. Admins can look the password up again later. Databases are created with the `utf8mb4` character set and the `utf8mb4_unicode_ci` collation. ## Connect from an app Users connect from the server itself, as `localhost` or `127.0.0.1`, on port 3306. When you add the connection settings to an app's environment, VaultPanel adds these variables, skipping any the app already has: | Variable | Value | | --- | --- | | `DATABASE_URL` | `mysql://:@127.0.0.1:3306/` | | `DB_HOST` | `127.0.0.1` | | `DB_PORT` | `3306` | | `DB_NAME` | The database name | | `DB_USER` | The username | | `DB_PASSWORD` | The password | The password is URL-encoded in `DATABASE_URL`. The app sees the new variables after it restarts: click **Apply and restart** on the app's page. See [Environment variables](https://docs.vaultpanel.net/guides/applications#environment-variables). ## Database users The **Users** tab lists every database user. A user can reach several databases on the same server, with the same access to each. Click **New user** to make one with access to whole databases: | Field | What it does | | --- | --- | | **Username** | 2 to 32 lowercase letters, digits and underscores, starting with a letter. `root`, `mysql`, `debian_sys_maint`, `admin`, `vaultpanel`, `mariadb` and `phpmyadmin` are reserved. | | **Access** | **Full access** or **Read only**. | | **Password** | Generated when left out, or 12 to 72 letters, digits or the symbols `! # % + , . : = ? @ ^ _ ~ -`. | | **Databases** | The databases on that server it may reach, up to 50. | Editing a user changes its access and databases, and can keep the current password, generate a new one, or set one you choose. Click **Password** next to a user to see its password and connection URL: every look is recorded in the audit log. Deleting a user stops apps that use it from connecting. Its databases are kept. ## Link a database to an app or website A database can be linked to one app and one website on the same server. Their **Backups** tabs can then back it up, and list its backups with their own. Change the links with **Link** on the database's row. ## Delete a database Deleting a database removes every table and row in it from the server, and users lose their access to it. Its backups are kept. Without a backup, this cannot be undone. ## Browse and query Open a database to see its tables, browse rows and run SQL in the panel, or open it in phpMyAdmin already signed in. See [Database browser and SQL](https://docs.vaultpanel.net/guides/databases/sql-client) and [phpMyAdmin](https://docs.vaultpanel.net/guides/databases/phpmyadmin). ## Import and export A database's page has **Import**, for a `.sql` or `.sql.gz` dump from phpMyAdmin, mysqldump or a backup, and **Export**, which downloads a fresh dump. See [Import and export](https://docs.vaultpanel.net/guides/databases/import-and-export). ## Back up a database A database backup is a compressed dump of the whole database. Back it up from **Backups**, or from the **Backups** tab of the app or website it is linked to. See [Backing up and restoring](https://docs.vaultpanel.net/guides/backups-and-automation/backups). ## Permissions | Permission | Allows | | --- | --- | | `databases.read` | Seeing databases and users. | | `databases.manage` | Creating, linking and deleting databases and users, seeing passwords, the database browser and one-click phpMyAdmin. | Adding connection settings to an app also needs `applications.manage`. Hosting customers manage only the databases of their own account, within their plan. --- # Database browser and SQL URL: https://docs.vaultpanel.net/guides/databases/sql-client > Browse a database's tables, rows and structure and run SQL inside the panel, read-only by default and confined to that one database. Open a database to see its tables, browse rows and run SQL without leaving the panel. Everything runs as an account that can reach only that database, so a query can never touch another database, the MariaDB system tables or the server's files. It needs the `databases.manage` permission (owners and admins, and hosting customers for their own databases) and agent 0.12.0 or newer. ## Open a database On **Databases**, click a database's name or its **Open** button. Only active databases created in the panel can be opened; databases made outside it are not listed. The **Tables** list on the left shows each table with its approximate row count. Click a table to open it. ## Browse The **Browse** tab shows a table's rows, 50 per page by default (25, 50, 100 or 250 with the rows-per-page selector). `NULL` values show as a grey _NULL_. Click a column name to sort by it, and again to reverse the order. **CSV** downloads the page you see, and **Query** opens the **SQL** tab with a `SELECT` for the table. ## Structure The **Structure** tab lists the table's columns (type, null, key, default, extra), its indexes, and its `CREATE TABLE` statement with a copy button. ## Run SQL The **SQL** tab runs one or more statements. Press **Ctrl + Enter** to run them. Each `SELECT` shows its own result, and each change shows how many rows it affected. ### Read-only by default With **Allow changes** off, the SQL runs as the database's read-only account (`SELECT` and `SHOW VIEW`). An `UPDATE` or `DELETE` fails with a hint to turn changes on. ### Allow changes Tick **Allow changes** to run `INSERT`, `UPDATE`, `DELETE`, `CREATE` and `DROP`, in this database only. SQL that drops, deletes, truncates or alters asks for confirmation first, because it cannot be undone without a backup. Every query run with changes allowed is recorded in the audit log as `database.query`, with its SQL. ## Limits | Limit | Value | | --- | --- | | Rows per result | The first 1,000 rows | | Characters per cell | 5,000; longer values are cut | | SQL per run | 100,000 characters | | Time per statement | 30 seconds | ## How it is kept safe Each database has two accounts of its own that the agent creates and keeps up to date: one that can only read it and one with full access to it, and to nothing else on the server. Each allows at most 5 connections. The SQL you type runs as one of them, never as the database administrator, so `SELECT * FROM mysql.user`, tables in other databases and `SELECT ... INTO OUTFILE` are denied. The MariaDB client runs as the unprivileged `nobody` user and, where the client supports it, in sandbox mode, so client commands such as `\! id` cannot reach the server either. > **Tip:** Prefer phpMyAdmin's import and export screens? See [phpMyAdmin](https://docs.vaultpanel.net/guides/databases/phpmyadmin). --- # Import and export URL: https://docs.vaultpanel.net/guides/databases/import-and-export > Load a .sql or .sql.gz dump into a MariaDB database from its page, and download a fresh export of a database as .sql.gz. A database's page has **Import** and **Export** buttons. Import loads a dump made by phpMyAdmin, mysqldump or a backup. Export downloads a fresh dump of the database. Importing needs agent 0.43.0 or newer on the server. ## Import a dump ### Open the database Go to **Databases** and open the database. It must be **active**. Click **Import**. ### Choose the file Under **File**, choose a `.sql` or `.sql.gz` file. Other files are refused: unzip a `.zip` and upload the `.sql` inside it, or compress the file with gzip instead. ### Choose how to import | Option | What it does | | --- | --- | | **Empty the database first** | Every table in the database is removed, then the file is imported. Off by default: the file then runs on top of what is there. | | **Back up first** | On by default. Takes a backup of the database as it is now, to restore from the **Backups** page if the import goes wrong. If the backup fails, nothing is imported. Shown with the `backups.manage` permission. | ### Import Click **Import**, or **Empty and import** when the database is emptied first. The page shows each step: the backup, the upload with its progress, then **Importing on the server**. The file goes to the panel in pieces of up to 8 MB, and the server's agent then fetches it, checked against its SHA-256. Files up to `VAULTPANEL_FILE_UPLOAD_MAX_MB` (2048 MB by default) can be imported. ### How the import runs A dump file may come from anyone, so the server runs it with as few rights as it can: - The `mysql` client runs as the `nobody` user, in its sandbox mode, so the file cannot run shell or file commands. - It signs in as an account that can reach only this database. A dump cannot change other databases or accounts. The sandbox mode needs a recent MariaDB client (10.5.25, 10.6.18, 10.11.8, 11.0.6 or newer). On an older one, imports are refused: update MariaDB on the server. ## Export a database Click **Export**. The server writes a fresh backup of the database, and the download of it (`.sql.gz`) starts when it is ready. The export is also kept as a backup, listed on the **Backups** page. Export needs the `backups.manage` permission. See [Backing up and restoring](https://docs.vaultpanel.net/guides/backups-and-automation/backups). ## Troubleshooting When an import stops, what came before that point is already in the database. The error says why it stopped: - **The file uses another database** (`CREATE DATABASE` or `USE`): remove those lines, or export the database without them. - **The file sets a `DEFINER`** (views, triggers or procedures): export without definers, or remove the `DEFINER=...` parts. - **Any other error**: fix the file, then import again with **Empty the database first** ticked. ## Permissions | Permission | Allows | | --- | --- | | `databases.manage` | Importing into a database. | | `backups.manage` | Exporting a database, and backing it up before an import. | Hosting customers can import into their own databases. See [Import a dump](https://docs.vaultpanel.net/api-reference/databases#import-a-dump) in the API reference. --- # phpMyAdmin URL: https://docs.vaultpanel.net/guides/databases/phpmyadmin > Set up phpMyAdmin on a server's own port, sign in with a database user, or open any database in phpMyAdmin already signed in from the panel. phpMyAdmin is the classic web interface for MySQL and MariaDB. VaultPanel installs it from the system's packages, so it gets security updates with the rest of the system, and serves it with NGINX on a port of its own. From the panel, each database opens in phpMyAdmin already signed in. ## Set it up ### Check the server's software phpMyAdmin needs NGINX, PHP-FPM and MariaDB. Install any that are missing on the server's page first: NGINX and PHP-FPM from the **Web stack** card, MariaDB from the **Database server** card. ### Choose a port On **Databases**, the **phpMyAdmin** card lists your servers. Click **Set up** next to one and keep port **8081**, or choose another free port from 1024 to 65535. Ports the panel and common services use are refused. When the server's firewall is on, VaultPanel opens the port. ### Serve it over HTTPS When the panel has its own domain with a certificate (**System > Panel Domain**), leave **Serve it over HTTPS** ticked: phpMyAdmin then uses that certificate at `https://:8081/`. Over plain HTTP, passwords travel unencrypted. ### Install Click **Set up phpMyAdmin**. When the job finishes, the card shows the address and **Open phpMyAdmin**. If the job fails because nothing answers on the port, another program uses it: open **Settings** on the card and choose another port. Setting up, changing and turning off phpMyAdmin needs the `servers.manage` permission. ## Sign in with a database user phpMyAdmin's login form takes a database user and its password. Find the password on **Databases > Users** with **Password**. You then see only that user's databases. Signing in as `root`, or with an empty password, is refused. ## Open a database in phpMyAdmin Each active database on a server with phpMyAdmin has a **phpMyAdmin** button on **Databases**, and **Open in phpMyAdmin** at the top of its own page. It opens a new tab already signed in to that database, with nothing to type. This needs agent 0.19.0 or newer and the `databases.manage` permission. It signs in as the database's own full-access account, which reaches only that database, never root. Behind the scenes, the agent leaves a one-time ticket for a fresh token on the server; the ticket can be used once and expires after 2 minutes. When you log out of phpMyAdmin, its normal login form comes back. Each one-click sign-in is recorded in the audit log as `database.phpmyadmin`. ## Turn it off Click the power button next to the server on the **phpMyAdmin** card. NGINX stops serving it. The package stays installed and your databases are not touched; you can set it up again at any time. A firewall rule opened for its port can be removed on the **Firewall** page. --- # DNS & Email URL: https://docs.vaultpanel.net/guides/dns-and-email > Serve your domains' DNS from your own servers, connect Cloudflare or Namecheap for wildcard certificates, host email, and set up the panel's own outgoing mail. VaultPanel can run the DNS and email for your domains on your own servers, the way classic hosting panels do, and sends its own email (invites, password resets, alerts) through an SMTP server you choose. | Feature | What it does | Runs on | | --- | --- | --- | | [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) | Serves a domain's DNS records with BIND. | Your servers | | [DNS providers](https://docs.vaultpanel.net/guides/dns-and-email/dns-providers) | Adds Let's Encrypt's check record at Cloudflare or Namecheap, for wildcard certificates of domains whose DNS stays there. | Your servers, through the provider's API | | [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting) | Mailboxes and forwarders for your domains, with Postfix, Dovecot and OpenDKIM. | Your servers | | [Spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering) | Checks incoming mail with Rspamd and files spam in each mailbox's Junk folder. | Your servers | | [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail) | Roundcube in the browser for your mailboxes, kept up to date. | Your servers | | [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) | The SMTP server VaultPanel itself sends through. | The panel | The features work together. When the panel runs a domain's DNS: - new [subdomains](https://docs.vaultpanel.net/guides/websites/domains#subdomains) get their `A` record added for you, - [wildcard certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates) are checked through the zone, - a mail domain's MX, SPF, DKIM and DMARC records are added to the zone in one step. - [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) - [DNS providers](https://docs.vaultpanel.net/guides/dns-and-email/dns-providers) - [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting) - [Spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering) - [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail) - [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) --- # DNS zones URL: https://docs.vaultpanel.net/guides/dns-and-email/dns-zones > Serve your domains' DNS records from your own servers with BIND, manage records in the panel, and point a domain's name servers at your server. A DNS zone holds a domain's records: where the domain, `www` and `mail` point, its mail servers, and text records such as SPF. VaultPanel can serve zones from your own servers with BIND, the way cPanel and CyberPanel run DNS on the hosting server itself. You edit the records in the panel, and each change reaches the server on its own a moment later. Find zones under **Web > DNS Zones**. ## How it works - Each server answers only for its own zones, as an authoritative name server. It never looks up other names for anyone, so it cannot be misused as an open resolver, and it allows no zone transfers. - The panel keeps every zone's records. Each change raises the zone's serial (in `YYYYMMDDnn` form, never going back) and sends the whole zone to the agent. - The agent checks every record again, writes the zone file and has `named-checkzone` check it before it goes live. When anything fails, it keeps the previous file. - Changes you make while one is on its way are sent right after it, so you can edit several records in a row without waiting. ## Set up DNS on a server ### Open the DNS servers card Go to **Web > DNS Zones**. The **DNS servers** card lists your servers. ### Set it up Click **Set up DNS** next to the server and confirm. The agent installs BIND from the system's packages and sets it up to answer only for the zones you add in VaultPanel. With the firewall on, it opens port 53 (TCP and UDP). The server's own lookups keep working as they do now. The server then shows **Set up**. If BIND was already set up by hand, its options file is replaced and kept as `named.conf.options.vaultpanel-orig`. **Set up again** repeats the set-up. > **Note:** Some hosting providers block port 53. If queries from outside time out while `dig @127.0.0.1 example.com` works on the server, ask your provider to open it. ## Add a zone Click **New zone** and fill in the form: | Field | Notes | | --- | --- | | **Domain** | The domain the zone is for, such as `example.com`. | | **Served by** | A server with DNS set up. | | **Points at** | The IPv4 address for the domain, `www` and `mail`. The server's public address unless you enter another. | | **Also point them at the server's IPv6 address** | Adds `AAAA` records too. Only if the server is reachable over IPv6. | | **Add mail records** | On by default: `mail.example.com`, an `MX` record for it and an SPF record, for email hosted on this server. | | **Use other name server names** | Unless ticked, the zone uses `ns1.example.com` and `ns2.example.com`, both answered by this server. Tick it to enter your own, such as your hosting brand's name servers (up to 4). | Click **Add zone**. The zone starts with the records most sites need: | Name | Type | Value | | --- | --- | --- | | `@` | `NS` | `ns1.example.com` and `ns2.example.com` (or your own name servers) | | `@`, `www` | `A` | The address in **Points at** | | `ns1`, `ns2` | `A` | The same address, when the name servers are inside the zone | | `mail` | `A` | The same address (with **Add mail records**) | | `@` | `MX` | `mail.example.com`, priority 10 (with **Add mail records**) | | `@` | `TXT` | `v=spf1 a mx ~all` (with **Add mail records**) | With IPv6 on, each `A` record gets a matching `AAAA` record. The zone's contact address (in its SOA record) is `hostmaster@example.com` and its default TTL 3,600 seconds; change both under **Zone settings**. ## Point the domain at your server Until the domain's registrar points at your server, the zone has no effect on the internet. Open the zone: the **Name servers** card lists the names to use, with copy buttons. ![The DNS zone example.com on web-1: its name servers ns1 and ns2 with their addresses and a check that public DNS uses them, then the zone's records](https://docs.vaultpanel.net/screenshots/dns-zone-light.png) ### Register the name servers, when they are inside the domain When the name servers are inside the zone (such as `ns1.example.com` for `example.com`), first register them with their addresses at the registrar. Registrars call this "child name servers", "glue records" or "register name servers". ### Set the domain's name servers At the registrar, replace the domain's name servers with the ones the card lists. ### Check the delegation Back in the zone, click **Check now**. Registries can take a few hours to publish the change. | Result | Meaning | | --- | --- | | **Uses these name servers** | Public DNS lists the zone's name servers. The internet now asks your server about the domain. | | **Partly uses them** | Some of the domain's name servers are the zone's, some are not. | | **Uses other name servers** | The registrar still points elsewhere. | | **Not found in public DNS** | The domain has no name servers in public DNS. | | **Lookup failed** | The lookup itself failed. | > **Warning:** Once the registrar points at your server, the records at the previous DNS host stop being used. Copy any records you still need (such as mail or verification records) into the zone first. Many registries want two name servers on different addresses. When both point at one server and the registrar refuses that, use name servers on two servers, or keep the registrar's DNS and add the records there instead. ## Manage records Open a zone and use **Add record**, or the edit and delete buttons on each row. Search and filter the list by type. | Type | Value | | --- | --- | | `A` | An IPv4 address. | | `AAAA` | An IPv6 address. | | `CNAME` | Another host name, making this name an alias of it. | | `MX` | A mail server host name, with a **Priority**. | | `TXT` | Text such as SPF, DKIM, DMARC or a site verification, without quotes. Up to 2,048 printable characters; long values such as DKIM keys are split for you. | | `NS` | A name server host name. | | `SRV` | A target host, with **Priority**, **Weight** and **Port**. | | `CAA` | Which certificate authority may issue certificates: a **Tag** (`issue`, `issuewild` or `iodef`) and a value such as `letsencrypt.org`. | **Name** is relative to the zone: `@` is the domain itself, `www` means `www.example.com`. Names such as `_dmarc` and wildcards (`*` or `*.dev`) are allowed, and a full name or one ending in a dot is converted for you. **TTL (seconds)** is optional, from 60 to 604,800; records without one use the zone's default. A change that would break the zone is refused with the reason: - the zone needs at least one `NS` record for `@`, - a name with a `CNAME` record cannot have other records, and `@` cannot be a `CNAME`, - each record can be listed once, - a zone can hold up to 500 records. ## Zone status | Status | Meaning | | --- | --- | | **Adding** | The zone is being sent to the server for the first time. | | **Live** | The server serves the latest version. | | **Applying changes** | A change is on its way. | | **Changes not applied** | The last change did not reach the server; it still serves the previous records. | | **Failed** | The zone is not on the server. | | **Deleting** | The zone is being removed. | **Apply again** sends the zone to the server again, for example after a failure, or to put back a zone file someone changed by hand. **Delete zone** asks you to type the domain, then removes the zone from the server. While the registrar still points at the server, the domain stops working, so move its name servers somewhere else first. ## DNS for hosting customers On a server with DNS set up, **For customers** on the **DNS servers** card sets: - **Name servers**: the host names customers on this server set at their registrar. Customers see them on their **My Hosting** page, with their domains this panel answers for. - **Add a DNS zone for each new customer domain**: when a customer creates a website for a new registered domain (such as `example.com`, not a subdomain), VaultPanel adds its zone on this server with those name servers. The zone is removed with the customer's account. ## How other features use zones When one of your servers serves a domain's zone, VaultPanel adds records there for you: - **Subdomains** get an `A` record (and `AAAA` when the parent has one). See [Domains](https://docs.vaultpanel.net/guides/websites/domains#subdomains). - **Wildcard certificates** are checked through a temporary `_acme-challenge` record. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates). - **Mail domains** get their MX, SPF, DKIM and DMARC records. See [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting#dns-records). ## Permissions | Permission | Allows | | --- | --- | | `dns.read` | Seeing zones, records and DNS providers. | | `dns.manage` | Setting up DNS on servers, adding and changing zones and records, and managing DNS providers. | --- # DNS providers URL: https://docs.vaultpanel.net/guides/dns-and-email/dns-providers > Connect a Cloudflare or Namecheap account so websites whose DNS stays there can get Let's Encrypt wildcard certificates through the provider's API. A wildcard certificate (`*.example.com`) is checked by Let's Encrypt through DNS: a `TXT` record has to appear in the domain's DNS while the certificate is issued and at every renewal. When the domain's DNS is at Cloudflare or Namecheap, VaultPanel's agent can add that record through the provider's API, so you get wildcard certificates without moving the domain's DNS to one of your servers. DNS providers are used only for this. They do not manage your other records. ## Supported providers | Provider | Credentials | Where to get them | | --- | --- | --- | | **Cloudflare** | **API token** | A token with the **Zone > DNS > Edit** permission for your domains: in Cloudflare, **My Profile > API Tokens > Create Token > Edit zone DNS**. | | **Namecheap** | **API user** and **API key** | Your Namecheap user name, and the key from **Profile > Tools > Namecheap API Access**. | > **Before you use Namecheap:** Namecheap turns its API on only for accounts with 20 domains, or $50 on the account or spent in the last two years, and answers only the IPv4 addresses you whitelist there. Whitelist the public IPv4 address of each server that issues certificates. Namecheap's API also replaces all of a domain's records at once, so VaultPanel writes back every record exactly as it read it, and changes nothing when it cannot read them all. ## Add a provider ### Open the DNS providers card Go to **Web > DNS Zones** and find the **DNS providers** card. Click **Add provider**. ### Enter the account | Field | Notes | | --- | --- | | **Provider** | **Cloudflare** or **Namecheap**. Cannot be changed later. | | **Name** | How it shows when you issue a certificate, such as `Cloudflare (main account)`. Up to 60 characters. | | **API user** | Namecheap only. | | **API token** / **API key** | The secret. | ### Save it Click **Add provider**. You can add several accounts of the same provider. The secret is stored encrypted in the panel and never shown again. When you edit a provider, leave the secret empty to keep the saved one. ## Issue a wildcard certificate through a provider 1. Make sure the domain uses the provider's name servers. 2. Open the website, go to its **SSL** tab, tick **Wildcard certificate** and choose the account in **Check DNS through**. 3. Issue the certificate. The certificate's renewals go through the same provider. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates#wildcard-certificates) for the rest of the options. ## How the credentials are used - The secret is sent to the server's agent only inside the job that issues the certificate, and is removed from the stored job once it ends. - The agent keeps a copy that only root can read, so Certbot can renew the certificate. It stays until a certificate on that website is issued again another way, or the website is deleted. - For Namecheap, the agent changes the records of the domain as registered (such as `example.com` for `shop.example.com`), calling from the server's public IPv4 address. ## Edit and remove providers The **DNS providers** card lists each account with the number of certificates that renew through it. - **Edit** changes the name, user or secret. Servers keep the secret they already have until a certificate there is issued again. - **Remove** is refused while certificates renew through the provider. Issue them again another way, or turn HTTPS off on those websites, first. ## Requirements - Agent 0.38.0 or newer on the website's server. - Only staff can add, see or use DNS providers: `dns.read` to use one when issuing a certificate, `dns.manage` to add, change or remove them. Hosting customers cannot use them. --- # Email hosting URL: https://docs.vaultpanel.net/guides/dns-and-email/email-hosting > Host email for your domains on your own servers with Postfix, Dovecot and OpenDKIM, with mailboxes, forwarders, DKIM signing and the DNS records receivers check. VaultPanel can host email for your domains on your own servers: mailboxes people read in any mail app, forwarders, and DKIM-signed outgoing mail. It sets up three standard programs from the system's packages: | Program | Role | | --- | --- | | **Postfix** | Receives mail from the internet and sends mail for signed-in mailboxes. | | **Dovecot** | Keeps the mailboxes, readable over IMAP and POP3 (TLS only). | | **OpenDKIM** | Signs outgoing mail, so receivers can check it came from your server. | Find email under **Web > Email**. Only staff see this page. ## How it works - Each server that hosts email has one mail server, with a host name such as `mail.example.com` that mail apps and other mail servers connect to. - Mailboxes are virtual: they are not Linux accounts, and Linux accounts cannot sign in to email. Mail is stored in `/var/mail/vhosts///Maildir`, owned by one `vmail` account. - The panel keeps the domains, mailboxes and forwarders. Each change sends the server's whole set to the agent, with password hashes only, never passwords. The agent checks them again and rewrites Postfix's tables, Dovecot's user list and OpenDKIM's keys from them. - Only signed-in mailboxes can send through the server, so it is not an open relay. ## Before you start - **A host name for the mail server**, such as `mail.example.com`, with an `A` record pointing at the server. When VaultPanel runs that domain's DNS, it adds the address for you. - **Port 25 open** at your hosting provider. Some providers block it on new servers; without it, mail neither arrives nor leaves. - **Reverse DNS**: set the PTR record of the server's IP address to the mail host name in your hosting provider's control panel. Many receivers refuse mail from servers whose address does not point back at their name. - **An up-to-date agent.** The panel refuses to set up email on a server whose agent is too old to host it. ## Set up a mail server ![The Email page: a Mail servers card where vmi3756066 is Not set up, with a Set up email button, above an empty domain list saying No email domains yet](https://docs.vaultpanel.net/screenshots/email-light.png) ### Open the Mail servers card Go to **Web > Email**. The **Mail servers** card lists your servers. ### Set up email Click **Set up email** next to the server, enter the **Mail host name**, and confirm. The agent installs Postfix, Dovecot and OpenDKIM. With the firewall on, it opens ports 25, 465, 587, 993 and 995. The server then shows **Running**. **Check DNS** on the card shows whether the **Host name** points at the server and whether the server's address points back at it (**Reverse DNS**). ### The mail server's certificate The mail server needs a certificate for its host name. The card shows which one it uses: - **Let's Encrypt**: a Let's Encrypt certificate for the host name was found on the server under `/etc/letsencrypt/live//`. The mail server reloads after Certbot renews it. - **Own certificate**: none was found, so the agent made its own (valid 10 years). Mail apps warn about it once. After a certificate for the host name is on the server, click **Set up again** to use it. ## Add a domain Click **New domain** and fill in: | Field | Notes | | --- | --- | | **Domain** | Such as `example.com`. | | **Mail server** | One of your servers with email set up. | | **Add its records to the DNS zone** | On by default. When VaultPanel runs the domain's DNS, it adds the MX, SPF, DKIM and DMARC records. They replace the domain's current MX and SPF records, so its mail comes here. Shown with the `dns.manage` permission. | Click **Add domain**. The domain shows **Adding** until the server has made its DKIM signing key, then **Active**. ## Mailboxes On the domain's **Mailboxes** tab, click **New mailbox**: | Field | Notes | | --- | --- | | **Address** | The part before the `@`, such as `info` or `first.last`: lowercase letters, digits, dots, dashes, plus and underscores. | | **Name** | For you; mail apps set the sender name themselves. | | **Size limit (MB)** | Default 1,024 MB. `0` for no limit. | | **Password** | At least 10 characters. Leave it empty to get a generated one. | Click **Add mailbox**. > **Important:** A generated password is shown once: VaultPanel keeps only a hash of it. If it gets lost, set a new one from the mailbox's edit button. Edit a mailbox to change its name, size limit or password. Untick **Mailbox is on** to stop it signing in: it still receives mail, but nobody can read it or send from it. **Check sizes** asks the server how much mail each mailbox holds. When you delete a mailbox, mail sent to it afterwards is refused. Tick **Also delete the mail stored in it** to remove its folder from the server; otherwise the mail stays and comes back if you add the mailbox again. ## Forwarders A forwarder is an address without a mailbox of its own, such as `hello@` for a team. On the **Forwarders** tab, click **New forwarder**, enter the address and, under **Send to**, up to 20 addresses (one per line), on this server or anywhere else. > **Note:** Some providers file forwarded mail as spam when it fails their checks. Forward to mailboxes on your own server where you can. ## DNS records Other mail servers trust your mail only when the domain's DNS has the right records. The domain's **DNS records** tab lists them: | Record | Name | Value | | --- | --- | --- | | MX | `@` | The mail host name, priority 10. Mail for the domain goes there. | | SPF (`TXT`) | `@` | `v=spf1 mx ~all`, or `v=spf1 mx a: ~all` when the host name is outside the domain. Only your mail server may send for the domain. | | DKIM (`TXT`) | `vaultpanel._domainkey` | `v=DKIM1; k=rsa; p=`. Shown once the server has made the domain's signing key. | | DMARC (`TXT`) | `_dmarc` | `v=DMARC1; p=none`: receivers report mail that fails both checks, without rejecting it to start with. | - **When VaultPanel runs the domain's DNS**, the tab links the zone, and **Add to the zone** adds any missing records. A new SPF, DKIM or DMARC record replaces the old one instead of being added next to it. - **When the DNS is elsewhere**, copy the records to where the domain's DNS is hosted (often the registrar). **Check public DNS** shows each record as **In place**, **Different**, **Missing** or **Add where your DNS is**. Changes can take up to the records' TTL to show. ## Connect a mail app The domain's **Mail apps** tab has the settings for Outlook, Apple Mail, Thunderbird and phone mail apps. Choose IMAP and enter them by hand: | | Protocol | Server | Port | Security | | --- | --- | --- | --- | --- | | Incoming | IMAP | The mail host name | 993 | SSL/TLS | | Incoming | POP3 | The mail host name | 995 | SSL/TLS | | Outgoing | SMTP | The mail host name | 587 | STARTTLS | | Outgoing | SMTP | The mail host name | 465 | SSL/TLS | The user name is the full email address and the password is the mailbox's password, for incoming and outgoing mail. ## Spam filtering Each mail server can check incoming mail with Rspamd: spam goes to each mailbox's **Junk** folder, and mail that scores very high is refused. Click **Filter spam** on the **Mail servers** card. See [Spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering). ## Webmail The **Webmail** card on the Email page installs Roundcube on a website of its own, so mailboxes can read and send mail in the browser. See [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail). ## Move email from cPanel A cPanel full account backup can bring a domain's mailboxes (with their passwords and mail) and forwarders here. See [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel). ## Remove a domain Removing a domain removes its mailboxes and forwarders, and the server refuses mail for it. Tick **Also delete all the mail stored for it** to delete the stored mail too. The domain's DNS records stay: change its MX record if its mail should go somewhere else. ## Troubleshooting - **Mail from outside never arrives.** Check that port 25 is open at your provider and that the domain's MX record points at the mail host name. On the server, `ss -ltn` lists Postfix listening on port 25. - **Gmail or Outlook refuse or flag your mail.** Check the DNS records with **Check public DNS** and set the server's reverse DNS to the mail host name. - **Mail apps warn about the certificate.** The mail server uses its own certificate. See [The mail server's certificate](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting#the-mail-servers-certificate). - **The last change did not reach the mail server.** Click **Details** to read the operation log, then **Apply again** on the **Mail servers** card to send the server's settings again. To test a mailbox from the server: ```bash doveadm auth test info@example.com 'the password' ``` ## Permissions | Permission | Allows | | --- | --- | | `mail.read` | Seeing mail servers, domains, mailboxes and forwarders. | | `mail.manage` | Setting up mail servers and changing domains, mailboxes and forwarders. | Hosting customers do not see email hosting. --- # Spam filtering URL: https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering > Check incoming mail with Rspamd, file spam in each mailbox's Junk folder, and refuse mail that scores very high. Each mail server can filter spam. Rspamd checks every message that arrives: the sender's records (SPF, DKIM, DMARC), blocklists of known spam sources and the message itself, and gives it a score. | Score | What happens | | --- | --- | | Below the junk score | The message goes to the inbox. | | At or above the **junk score** (6 by default) | The message goes to the mailbox's **Junk** folder. | | At or above the **refuse score** (15 by default) | The mail server refuses the message, so the sender is told. | Spam in the Junk folder is not lost: people find it there in their mail app or in [webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail). Spam filtering needs agent 0.45.0 or newer on the server. ## How it works - Postfix asks Rspamd about each message as it arrives (Rspamd listens on `127.0.0.1` only). - Above the junk score, Rspamd adds an `X-Spam: Yes` header. A Sieve rule that Dovecot runs before delivery moves those messages to the mailbox's **Junk** folder, and makes the folder when it is missing. - Above the refuse score, Postfix refuses the message during delivery. - Rspamd signs nothing: OpenDKIM still signs outgoing mail. - Rspamd keeps no state of its own, so there is no greylisting and no Bayes learning yet. ## Turn it on ### Open the mail server Go to **Web > Email**. On the **Mail servers** card, click **Filter spam** next to a mail server that is set up. ### Set the scores Tick **Filter spam** and check the two scores: | Field | Notes | | --- | --- | | **Junk folder from score** | 1 to 50. Default 6. Lower catches more spam, and more good mail by mistake. | | **Refuse from score** | 5 to 100, and higher than the junk score. Default 15. | ### Turn it on Click **Turn on**. The agent installs Rspamd and the Dovecot Sieve plugin when they are missing, which takes a minute or two. When the change has reached the server, the card shows **Spam filter on · junk from** and the junk score. To change the scores later, click **Spam filter** on the card, change them and click **Save and apply**. ## Turn it off Click **Spam filter**, untick **Filter spam** and click **Turn off**. Postfix stops asking Rspamd, Dovecot's Sieve rule is removed and Rspamd is stopped, but stays installed. All mail goes to the inbox again. Mail already in Junk folders stays there. ## On the server | File | Contents | | --- | --- | | `/etc/rspamd/local.d/` | Rspamd's settings: `actions.conf` (the scores), `worker-proxy.inc`, `worker-controller.inc`, `milter_headers.conf` and `dkim_signing.conf`. | | `/etc/dovecot/conf.d/99-vp-spam.conf` | Dovecot's Sieve settings. Removed when filtering is off. | | `/etc/dovecot/vaultpanel/spam.sieve` | The rule that files spam in **Junk**. | The panel writes these files whole each time the setting changes, so edits by hand are lost. Rspamd's own web interface listens on `127.0.0.1:11334`, on the server only. Each file is checked before it is used (`rspamadm configtest`, `doveconf -n`, `postfix check`). A file that is refused is put back as it was, and the change fails with the error in its log. ## Troubleshooting - **Good mail lands in Junk.** Raise the junk score a little, for example from 6 to 8. Ask the sender to set up SPF, DKIM and DMARC for their domain. - **Too much spam reaches the inbox.** Lower the junk score a little. Keep the refuse score well above it, so only clear spam is refused. - **The change failed.** Click **Details** on the **Mail servers** card to read the operation log. ## Permissions Changing spam filtering needs `mail.manage`. Hosting customers do not see email hosting. See also [Set spam filtering](https://docs.vaultpanel.net/api-reference/mail#set-spam-filtering) in the API reference. --- # Webmail URL: https://docs.vaultpanel.net/guides/dns-and-email/webmail > Give your mailboxes webmail with Roundcube from the app installer, on a website of its own, and keep it up to date by hand or automatically. Webmail lets people read and send mail in the browser. VaultPanel installs **Roundcube** for this through the [app installer](https://docs.vaultpanel.net/guides/websites/cms-installer), on a website of its own such as `webmail.example.com`. Mailboxes sign in with their full email address and their password. There is no separate admin account. Installing webmail needs agent 0.45.0 or newer on the website's server, and updating it needs 0.46.0 or newer. ## How it works - Roundcube reads mail over IMAP (port 993, TLS) and sends it over SMTP (port 587, STARTTLS) through the mail server on the website's own server. When that server has no mail server, it uses the first mail server set up in the panel. - The newest stable Roundcube release comes from the Roundcube project's GitHub releases and is checked against its published SHA-256 before it is unpacked. - Roundcube goes in a project folder at the top of the website (`roundcube` by default), and the website serves only that folder's `public_html/`. Roundcube's settings, logs and temporary files are never public. - The app installer makes a database and a database user for Roundcube and writes them to `config/config.inc.php`. They count toward a hosting customer's plan like any other. - Roundcube's web installer is removed after the install. ## Before you start - A mail server set up on the **Email** page. See [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting). - A PHP website for webmail, with PHP 8.1 or newer, or let the installer make a new one. Point the domain's DNS at the server. - The `websites.manage` and `databases.manage` permissions. ## Set up webmail ### Open the Webmail card Go to **Web > Email**. Once a mail server is set up, the page has a **Webmail** card. Click **Set up webmail**. The app installer opens with **Roundcube** chosen. ### Choose the website Pick **An existing PHP website** or **A new website**. For a new website, enter its **Domain** (such as `webmail.example.com`), **Site name** and **PHP version**. ### Choose the project folder Keep `roundcube` as the **Project folder**, or enter another name. The folder is made at the top of the site. A website can hold only one Drupal, Laravel or Roundcube app. ### Install Click **Install Roundcube**. The address is shown, and the install takes a minute or two. Its row on the **Webmail** card shows **Installing**, then the address as a link. > **Important:** Give the website an SSL certificate, so passwords are never sent in plain text. Until it has one, the card shows **No HTTPS yet**. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). Roundcube is set up with the Junk folder as its spam folder, so it works with [spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering). Sessions end after 30 minutes without use. ## Updates Roundcube security fixes come out often. Each Roundcube on the **Webmail** card shows its version and when it was last checked. - The panel checks every Roundcube for a newer release about once a day. - When a newer release is out, the card shows the new version as available and an **Update to** button with the version number. Click it to update now. - **Check for updates** asks for the newest release now. - Tick **Update automatically** to let the panel update that Roundcube by itself when its daily check finds a newer release. An update uses Roundcube's own `bin/installto.sh`, which keeps the settings, logs and the data in its database, then updates Roundcube's tables. The release is checked against its SHA-256 like an install. An update never goes back to an older version. When an update fails, the card shows **The last update did not finish** with the error. Updating needs the `websites.manage` permission. ## Remove webmail Roundcube is an installed app of its website. Remove it from the website's **Apps** tab like any other app. See [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer). --- # Panel email URL: https://docs.vaultpanel.net/guides/dns-and-email/panel-email > Connect VaultPanel to an SMTP server so it can send invites, password reset links and alerts by email, and choose which events are emailed to whom. VaultPanel sends its own email through an SMTP server you choose: invite and password reset links, and alerts. Set it up under **System > Panel Email**. This is separate from [email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting) on your servers, although a mailbox made there can be the account the panel sends from. ## What the panel emails | Email | When | | --- | --- | | **Invites and password resets** | New users and customers get their invite link by email, and so does a reset link made on the **Users** or **Customers** page. The link is still shown in the panel, in case the email does not arrive. | | **Forgot password** | The sign-in page offers **Forgot your password?** while panel email is on. | | **Alerts** | The events you choose, such as failed backups, cron jobs and deployments, firing alerts and servers going offline. | When panel email is off, the panel sends nothing and shows links to hand over by other means. ## Set up the SMTP server Any SMTP service works: your own mail server, a mailbox from **Web > Email**, or a service such as Amazon SES, Mailgun or Brevo. ### Enter the mail server In the **Mail server (SMTP)** card: | Field | Notes | | --- | --- | | **Host** | The SMTP server's host name, such as `smtp.example.com`, or an IP address. | | **Port** | Usually 465 or 587. | | **Security** | **SSL/TLS** (encrypted from the start, usually port 465), **STARTTLS** (plain connection upgraded to TLS, required; usually port 587) or **None** (only for a mail server on this machine or a private network). | | **User name (optional)** | Often the full email address. | | **Password** | Stored encrypted in the panel and never shown again. Leave it empty to keep the saved one; **Remove the saved password** deletes it. Changing the host drops the saved password unless you enter a new one. | | **From address** | Such as `panel@example.com`. Your mail server must allow sending from it. | | **From name** | The sender name. | ### Turn it on Tick **Send email from the panel** and click **Save settings**. ### Send a test email Enter an address in **Send a test email to** and click **Send test email**. The test uses the settings in the form, even before you save them, and the result shows at once. When the test fails, VaultPanel explains what went wrong in plain words: a refused user name or password, a host that cannot be found, a port that does not answer (some hosting providers block outgoing mail ports), the wrong security option for the port, or a certificate that does not match the host name. > **Warning:** With **None**, the password travels in plain text. Use it only for a mail server on the same machine or a private network. ## Alerts by email The **Alerts by email** card emails the same events [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) carry, when they happen. Alerts go out once the mail server is saved and email is on. Under **Email when**, tick the events to email. These are ticked until you choose others: - A backup failed - A restore failed - A cron job failed or timed out - A deployment failed - An alert started firing - A server went offline You can also choose finished backups and restores, deployments that went live, resolved alerts, servers back online, and SSL certificates that are expiring, expired or failed to renew. Choose who receives them: - **Send to owners and admins**: every active owner and admin, at their sign-in address. On by default. - **Also send to**: up to 10 more addresses, one per line. ## Recent emails The **Recent emails** card lists what the panel sent in the last 30 days, one row per recipient, with its status: **Sent**, **Retrying** or **Failed**. Invite and reset links are sent at once, so whoever made them knows whether the email went. Alerts are sent by the panel's worker. A failed email is tried again after 1 minute, 5 minutes and 30 minutes, up to 4 attempts in all. Messages are stored with their content encrypted, since a reset link signs someone in. ## Permissions Panel email settings need the `settings.manage` permission. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles). --- # Backups and automation URL: https://docs.vaultpanel.net/guides/backups-and-automation > Back up websites, apps and databases, keep copies off the server, run commands on a schedule, and notify other systems when something happens. VaultPanel keeps the things you host safe and running on their own: backups on demand or on a schedule, copies in S3-compatible storage or on another server, cron jobs that run as each site's user, and webhooks that tell your chat or tools when something needs attention. - [Backing up and restoring](https://docs.vaultpanel.net/guides/backups-and-automation/backups) - [Off-server backup storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage) - [Running cron jobs](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs) - [Webhook notifications](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) ## Two kinds of backup | Backup | What it covers | Where to manage it | | --- | --- | --- | | **Backups** in the panel | The files of a website or app, or the contents of a database. | **Backups** in the sidebar, or the **Backups** tab of a website, app or database. See [Backing up and restoring](https://docs.vaultpanel.net/guides/backups-and-automation/backups). | | The panel's own backup | VaultPanel itself: its database, settings, secret key and certificate. | The `vaultpanel backup` and `vaultpanel restore` commands on the panel's server. See [Backing up the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel). | You need both. Backups in the panel restore a site, app or database; the panel's own backup restores every account, setting and the key that decrypts them if the panel's server is lost. ## What runs in the background The panel's worker handles the scheduled side of automation every 15 seconds: it starts backups that are due, deletes scheduled backups beyond their keep count, and sends webhook deliveries with retries. Keep the `vaultpanel-worker` service running, or none of this happens. Cron jobs are different: the agent writes them into the server's own cron, so they keep running even while the panel is down. The agent reports each run to the panel with its next request. --- # Backing up and restoring URL: https://docs.vaultpanel.net/guides/backups-and-automation/backups > Back up websites, apps and databases by hand or on a schedule, restore one in place with a safety copy first, or download a copy. A backup holds the files of one website or app, or the contents of one database. The agent writes it on the server, records its SHA-256 checksum, and can copy it to off-server storage. You restore it in place, after a safety copy of the current state, or download it. ## What a backup contains | Type | Contents | File | | --- | --- | --- | | **Website** | Every file in the site's folder, except `tmp` and `logs`. | `.tar.gz` | | **App** | The live release, shared files, `.env` and deploy key. Older releases, logs and PM2 state are left out. | `.tar.gz` | | **Database** | A compressed SQL dump of the whole database: tables, views, routines, triggers and events. | `.sql.gz` | Website and app files are archived by `tar` running as the site's or app's own user, so a backup can only read what that user could. On the server, backups are kept in `/var/backups/vaultpanel`, readable by root only: ```text /var/backups/vaultpanel/site//.tar.gz /var/backups/vaultpanel/app//.tar.gz /var/backups/vaultpanel/database//.sql.gz ``` With [off-server storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage), the backup is copied there and, unless the storage keeps local copies, removed from the server once the copy is confirmed. ## Back up now Click **Back up now** on **Backups**, or on the **Backups** tab of a website, app or database: 1. Under **What to back up**, choose the website files, app files or database. A website's or app's own tab also offers the databases linked to it. 2. Under **Store in**, keep **On the server only** or choose a storage. 3. Click **Back up now**. The backup shows as `creating` while the agent writes it, then `completed` with its size. Only one backup of the same website, app or database runs at a time. A backup can run for up to an hour. ## Back up on a schedule ![The Backups page with storage cards for On the server (in use), S3-compatible storage and Another server (SFTP), the Backups, Schedules and Storage tabs, and an empty list saying No backups yet](https://docs.vaultpanel.net/screenshots/backups-light.png) Each website, app and database can have one schedule. Open its **Backups** tab, or the **Schedules** tab on **Backups**, and set: | Field | What it does | | --- | --- | | **Schedule** | A cron expression, or one of the common schedules. See [Schedules](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs#schedules). | | **Time zone** | The time zone the schedule runs in. Default UTC. | | **Backups to keep** | 1 to 100, default 7. | | **Store in** | On the server only, or a storage. | | **Schedule on** | Untick to pause the schedule without losing it. | The panel's worker starts each backup on time. Once a scheduled backup completes, the oldest scheduled backups beyond the number to keep are deleted. Backups taken by hand are never deleted automatically. Failed scheduled backups are kept for 30 days, then removed. > **Note:** Schedules are run by the panel's worker, so the `vaultpanel-worker` service must be running. ## Restore a backup Click **Restore** next to a completed backup. Type the name of the website, app or database to confirm, and keep **Back up the current state first** ticked: it saves a safety copy you can restore to undo the restore. The safety copy is listed with the other backups, with the trigger `pre_restore`. The agent first fetches the backup from storage if it is not on the server, and checks its SHA-256. A file that does not match is never used. Then: | Type | What a restore does | | --- | --- | | **Website** | Every file of the website is replaced with the files in the backup. Files added since are removed. `tmp` and `logs` are left as they are. | | **App** | The app's files and releases are replaced with those in the backup. The app restarts on the release the backup held, and its health check must pass. | | **Database** | The database is dropped and created again from the backup. Rows written since are lost. Users keep their access. | If the safety copy fails, nothing is restored. A backup of a website, app or database that was deleted cannot be restored into it: download it instead. > **Warning:** Restoring replaces the current state. Without a safety copy, changes since the backup cannot be recovered. ## Download a backup Click **Download** next to a completed backup. The agent first copies the backup to the panel and the panel checks its checksum; the download then starts. The prepared copy stays on the panel for 6 hours. The panel accepts downloads up to 10,240 MB by default (`VAULTPANEL_BACKUP_DOWNLOAD_MAX_MB`). For a larger backup, copy it from the server with `scp` or SFTP, or download it from its storage. Every download is recorded in the audit log. ## Delete a backup Click the trash button next to a backup. Its file is removed from the server and from its storage. A backup cannot be deleted while it is being written or restored. ## Statuses and triggers | Status | Meaning | | --- | --- | | `creating` | The agent is writing it. | | `completed` | Written, with its checksum known. | | `failed` | It was never written. | | `deleting` | Its file is being removed. | | `missing` | The file is no longer on the server, for example because it was removed by hand. | | Trigger | Meaning | | --- | --- | | `manual` | Backed up by hand. | | `schedule` | Taken by a schedule. | | `pre_restore` | A safety copy taken before a restore. | ## Notifications Backups and restores send the webhook events `backup.succeeded`, `backup.failed`, `restore.succeeded` and `restore.failed`. See [Webhook notifications](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks). ## Hosting customers Hosting customers back up and restore their own websites, apps and databases. Their backups stay on the server: they neither see nor choose storage, unless staff give them a schedule that uses one. ## Permissions | Permission | Allows | | --- | --- | | `backups.read` | Seeing backups and schedules. | | `backups.create` | Backing up now. | | `backups.manage` | Restoring, downloading, deleting and scheduling backups. | Setting up storage needs `settings.manage`. See [Off-server backup storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage). --- # Off-server backup storage URL: https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage > Copy backups to Amazon S3, Backblaze B2, Wasabi, Cloudflare R2, MinIO or another server over SFTP, so they survive the loss of a server. A backup on the same server does not help when the server is gone. Storage destinations copy each backup off the server: to an S3-compatible bucket, or to another server over SFTP. Owners and admins set them up once; a backup or a schedule then names one. Storage needs agent 0.13.0 or newer on each server whose backups use it, and the `settings.manage` permission to set up. ## How it works 1. The agent writes the backup on the server as usual. 2. It encrypts a copy with the storage's backup key (agent 0.42.0 or newer), copies it to the storage as `.enc` and confirms the copy. 3. Unless the storage keeps local copies, it removes the backup from the server. If the copy fails, the backup stays on the server, completed, and shows why the copy failed. Restoring or downloading a backup that is only in storage fetches it back first, decrypts it and checks its SHA-256. Deleting a backup deletes the stored copy too. Credentials never stay on your servers: the panel stores them encrypted and sends them to the agent only inside the job that needs them, and they are removed from the job once it ends. ## Encryption Copies are encrypted before they leave the server, with AES-256-GCM in 1 MiB authenticated chunks: whoever can read the bucket or the backup server sees only random bytes, and a copy that was changed, cut short or added to is refused when it comes back. Each storage has its own 256-bit key, which the panel makes and keeps encrypted with its other secrets; agents get it only inside the job that needs it. The backups list shows a lock next to copies that are encrypted. Copies made before agent 0.42.0, or by a server whose agent is older, are not encrypted and say so; they restore as before. Update the agent and back up again to replace them. ### Save the backup key If the panel server is lost, its copy of the key goes with it, and the copies in storage can no longer be read. Download each storage's key once, and keep it in a password manager or another safe place that is not the panel server: 1. Open **Backups**, choose the **Storage** tab. 2. Click **Key** on the storage. A text file `vaultpanel-backup-key-.txt` downloads. The Storage tab reminds you until each key has been downloaded. Downloading it is recorded in the audit log, and works only while signed in to the panel, never with an API token. Anyone with the key and access to the storage can read the backups, so treat it like a password. To decrypt a copy without the panel, download it from the bucket or backup server and use the [CLI](https://docs.vaultpanel.net/cli/commands): ```bash vaultpanel backups decrypt 7f3c….sql.gz.enc --key vaultpanel-backup-key-offsite.txt ``` It writes the backup next to it (`7f3c….sql.gz`) and prints its SHA-256, which matches the backup's checksum in the panel when the copy is intact. ## Add S3-compatible storage Open **Backups**, choose the **Storage** tab, click **Add storage** and keep **Kind** on **S3-compatible bucket**. | Field | What it does | | --- | --- | | **Service** | Amazon S3, Backblaze B2, Wasabi, Cloudflare R2, or MinIO or another S3-compatible service. Fills in the endpoint and region. | | **Name** | How the storage is listed in the panel. | | **Region** | The bucket's region, such as `us-east-1`. | | **Endpoint** | The service's address, without a bucket or folder in it. Filled in for Amazon S3, Backblaze B2 and Wasabi from the region; typed in for R2 and other services. | | **Bucket** | 3 to 63 letters, digits, dots and hyphens. Create it with the service first. | | **Folder in the bucket** | Backups go under this folder. Default `vaultpanel`; empty for the top of the bucket. | | **Access key ID**, **Secret access key** | A key for the bucket. The secret is stored encrypted and never shown again; leave it blank when editing to keep the saved one. | | **Also keep each backup on its server** | Restores are faster, but backups also use disk on the server. Off: each backup is removed from the server once the storage confirms its copy. | | **Path-style addresses** | Puts the bucket in the path (`endpoint/bucket/...`) instead of the host name. MinIO and most self-hosted services need it. | Each service's defaults: | Service | Endpoint | Region | Path-style | | --- | --- | --- | --- | | Amazon S3 | `https://s3..amazonaws.com` | `us-east-1` | Off | | Backblaze B2 | `https://s3..backblazeb2.com` | `us-west-004` (the part of the bucket's S3 endpoint after `s3.`) | Off | | Wasabi | `https://s3..wasabisys.com` | `us-east-1` | Off | | Cloudflare R2 | `https://.r2.cloudflarestorage.com` | `auto` | On | | MinIO or another service | Your service's address | `us-east-1` unless the service says otherwise | On | Backups are stored as `////.`, where the type is `site`, `app` or `database`. > **Warning:** An endpoint that starts with `http://` sends backups and the key's signatures unencrypted. Use it only on a private network. ## Add another server over SFTP Backups can go to any Linux server you can reach over SSH. The panel makes its own Ed25519 key pair for the destination; nothing secret is typed in. ### Make a user on the backup server Create a user for backups on the other server, for example: ```bash adduser --disabled-password --gecos "" backups ``` The panel refuses `root`. The backup server's firewall must let your servers in on its SSH port. ### Add the storage Click **Add storage** and choose **Another server, over SFTP**: | Field | What it does | | --- | --- | | **Name** | How the storage is listed in the panel. | | **Host** | The backup server's host name or IP address. | | **User** | A Linux user on that server, not root. | | **SSH port** | Default 22. | | **Folder** | In the user's home, or a full path such as `/srv/backups`. Default `vaultpanel-backups`; made when needed. | | **Also keep each backup on its server** | As for S3 storage. | ### Authorize the panel's key Add the public key the panel shows to the user's `~/.ssh/authorized_keys` on the backup server. Signed in as that user there: ```bash mkdir -p ~/.ssh && echo 'ssh-ed25519 AAAA... ' >> ~/.ssh/authorized_keys ``` Copy the exact line from the panel instead of the example above. ### Check it Click **Check** and choose a server under **From server**. The first check trusts the backup server's host key and shows its fingerprint. An SFTP storage must pass this check once before backups can use it. From then on, a different host key is refused, so nobody can pose as the backup server. If the backup server was reinstalled or its keys changed on purpose, edit the storage and tick the option to trust its new key; changing the host or port also forgets the old key. The next check then trusts the new one. ## Check a storage **Check** asks the agent of the server you choose to write a small file to the storage, read it back and delete it: the same path its backups take. Check every server that will back up to it. ## Use a storage Choose the storage under **Store in** when you click **Back up now** or set a schedule. See [Backing up and restoring](https://docs.vaultpanel.net/guides/backups-and-automation/backups). Hosting customers neither see nor choose storage: their backups stay on the server unless staff give them a schedule that uses one. ## Remove a storage Removing a storage makes the panel forget it, its access key and its backup key. Nothing in the bucket or on the backup server is deleted. A storage that still holds backups or is used by a schedule cannot be removed: delete those backups and change those schedules first. --- # Running cron jobs URL: https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs > Run commands on a schedule as a website's or app's own Linux user, in the server's time zone, with the output of every run kept in the panel. Cron jobs run commands on a schedule: clear a cache, send a report, run a framework's scheduler. Each job runs as the website's or app's own Linux user, never as root, and every run's result and output come back to the panel. ## How cron jobs run The agent keeps each job's settings in a root-only file and writes one line per job to `/etc/cron.d/vaultpanel`. That line runs the agent with the job's id, never your commands themselves. When the job is due, the agent runs the saved commands, one after another and without a shell, as the site's or app's user, starting in its home folder. Because the server's own cron daemon starts the jobs, they keep running while the panel is down. The agent reports each run with its next request to the panel. The server needs the cron daemon. If it is missing, install it from the **Scheduler** card on the server's page; until then, a job is saved but does not run on its schedule. ## Create a cron job Go to **Cron Jobs** and click **New cron job**, or use the **Cron** tab of a website or app. | Field | What it does | | --- | --- | | **Runs as** | The website or app whose Linux user runs the job. | | **Name** | Up to 100 characters, such as `Clear the cache`. | | **Schedule** | When it runs, in the server's time zone. See [Schedules](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs#schedules). | | **Commands** | One command per line, run in order, up to 10 lines. A failing command stops the run. | | **Run in folder** | A folder inside the site's or app's home to start in, such as `current` for an app or `public` for a site. Empty for the home folder itself. | | **Stop after** | How long a run may take before it is stopped: 1, 5, 15 or 30 minutes, or 1, 3, 6 or 24 hours. Default 1 hour. | | **Load the app's environment variables** | Apps only. The run gets the variables from the app's **Environment** tab, as the app itself gets them. | | **Run on the schedule** | Untick to pause the job. A paused job can still be run by hand. | Commands run without a shell, like an app's commands: pipes, redirects, `;` and `&&` are not supported. Put anything more complex in a script and run the script. ```text php artisan schedule:run ``` ## Schedules Cron jobs and backup schedules use the same five-field cron expressions: ```text ┌─ minute (0-59) │ ┌─ hour (0-23) │ │ ┌─ day of month (1-31) │ │ │ ┌─ month (1-12 or JAN-DEC) │ │ │ │ ┌─ day of week (0-7 or SUN-SAT; 0 and 7 are Sunday) │ │ │ │ │ 0 3 * * * ``` Each field accepts `*`, lists (`1,15`), ranges (`1-5`), steps (`*/10`, `0-30/5`) and names (`JAN`, `MON`). A start without a range, such as `5/10`, is refused because cron versions read it differently: write `5-59/10`. As in Vixie cron, when both day fields are restricted, a day matches either of them. These shortcuts also work: | Shortcut | Means | | --- | --- | | `@hourly` | `0 * * * *` | | `@daily`, `@midnight` | `0 0 * * *` | | `@weekly` | `0 0 * * 0` | | `@monthly` | `0 0 1 * *` | | `@yearly`, `@annually` | `0 0 1 1 *` | The form also offers common schedules, such as **Every 5 minutes** (`*/5 * * * *`) and **Every day at 03:00** (`0 3 * * *`), and shows the next run time. ## Run now Click **Run now** to run a job right away. Its result comes back with the job, like a scheduled run. ## Runs and output Each job keeps its last 50 runs, with up to 16 KB of output each. Open a job's runs to see when each started, how long it took, its exit code and its output. | Status | Meaning | | --- | --- | | Succeeded | Every command exited with 0. | | Failed | A command failed, which stopped the run. | | Timed out | The run took longer than **Stop after**. | | Skipped (still running) | The previous run had not finished, so this one did not start. | A failed or timed-out run sends the webhook event `cron.failed`. See [Webhook notifications](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks). ## Delete a cron job Deleting a job removes it from the server, so it stops running. Its run history is deleted too. ## Permissions | Permission | Allows | | --- | --- | | `cron.read` | Seeing cron jobs and their runs. | | `cron.run` | Running a job now. | | `cron.manage` | Creating, changing and deleting cron jobs. | Hosting customers manage the cron jobs of their own websites and apps, within their plan's limit. --- # Webhook notifications URL: https://docs.vaultpanel.net/guides/backups-and-automation/webhooks > Send signed JSON, Slack or Discord notifications when backups or cron jobs fail, deployments finish, alerts fire, servers go offline or certificates expire. Webhooks tell other systems when something happens in the panel: a chat channel, an incident tool or your own script. VaultPanel sends a `POST` request for each event a webhook subscribes to, signs JSON requests with the webhook's secret, and retries failed deliveries. ## Events | Event | When it is sent | | --- | --- | | `backup.succeeded` | A backup finished. | | `backup.failed` | A backup failed. | | `restore.succeeded` | A restore finished. | | `restore.failed` | A restore failed. | | `cron.failed` | A cron job failed or timed out. | | `deployment.succeeded` | A deployment or rollback of an app went live. | | `deployment.failed` | A deployment or rollback of an app failed. | | `alert.firing` | An alert started firing. | | `alert.resolved` | An alert resolved. | | `server.offline` | A server went offline. | | `server.online` | A server came back online. | | `ssl.expiring` | An SSL certificate is close to expiring. | | `ssl.expired` | An SSL certificate expired. | | `ssl.renew_failed` | Automatic SSL renewal failed. | **Test** sends a `webhook.test` event. ## Formats | Format | Body | | --- | --- | | **JSON (signed)** | The event as JSON, signed with HMAC-SHA256 in `X-VaultPanel-Signature`. | | **Slack** | A message for a Slack incoming webhook: `{ "text": "VaultPanel: ..." }`. | | **Discord** | A message for a Discord channel webhook: `{ "content": "VaultPanel: ...", "allowed_mentions": { "parse": [] } }`, cut to 2,000 characters. | Slack and Discord messages are one line that summarizes the event, such as `VaultPanel: Backup of database shop on web-1 failed: ...`. ## Add a webhook ### Open Webhooks Go to **Webhooks** under **Automation** and click **Add webhook**. Managing webhooks needs the `webhooks.manage` permission (owners and admins). ### Fill it in | Field | What it does | | --- | --- | | **Name** | How it is listed, such as `Ops channel`. | | **Format** | **JSON (signed)**, **Slack** or **Discord**. | | **URL** | Where requests go: an `http` or `https` URL, without `user:password@`. Kept encrypted; lists show only its host. | | **Events** | At least one event. | | **On** | Untick to stop sending without deleting the webhook. | For Slack, create an incoming webhook in Slack and paste its URL. For Discord, create a webhook in the channel's **Integrations** settings. ### Copy the signing secret For JSON webhooks, the signing secret (it starts with `whsec_`) is shown once. Store it where your receiver can read it. **Replace signing secret** makes a new one. ### Send a test Click **Test**. The panel sends a `webhook.test` event straight away and shows the HTTP status your endpoint answered. ## The request Every delivery is a `POST` with these headers: | Header | Value | | --- | --- | | `Content-Type` | `application/json` | | `User-Agent` | `VaultPanel-Webhook/1` | | `X-VaultPanel-Event` | The event, such as `deployment.succeeded`. | | `X-VaultPanel-Delivery` | The delivery's id. It stays the same when a delivery is retried. | | `X-VaultPanel-Timestamp` | Unix time in seconds when this attempt was sent. | | `X-VaultPanel-Signature` | JSON format only: `sha256=` followed by the hex HMAC-SHA256 of the timestamp, a `.`, and the body. | A JSON body has the event, when it happened, its data and the delivery id: ```json { "event": "deployment.succeeded", "occurredAt": "2026-11-10T09:31:02.118Z", "data": { "application": { "id": "0b9f6c1e-3f0e-4c63-9a52-2f7c2d0f4a11", "name": "shop-api" }, "kind": "deploy", "commit": "8c1d2e4f9a7b3c5d6e1f2a3b4c5d6e7f8a9b0c1d", "releaseId": "20261110093015-a1b2c3", "server": { "id": "5d2a7e90-1c3b-4f6d-8e9a-0b1c2d3e4f50", "name": "web-1" } }, "id": "e3b4c5d6-7a8b-4c9d-8e0f-1a2b3c4d5e6f" } ``` ### Event data | Event | `data` fields | | --- | --- | | `backup.succeeded`, `backup.failed` | `backup` (`id`, `trigger`, `sizeBytes`), `resource` (`type`, `name`), `server` (`id`, `name`), and `error` (`code`, `message`) when it failed. | | `restore.succeeded`, `restore.failed` | As for backups, plus `restore` (`id`, `safetyBackupId`). | | `cron.failed` | `cronJob` (`id`, `name`, `user`, `owner`), `run` (`status`, `exitCode`, `trigger`, `startedAt`, `durationMs`, `outputTail`: the last 1,000 characters of output), `server`. | | `deployment.succeeded`, `deployment.failed` | `application` (`id`, `name`), `kind` (`deploy` or `rollback`), `commit`, `releaseId`, `server`, and `error` when it failed. | | `alert.firing` | `server`, `rule` (the rule's name), `severity`, `subject`, `message`. | | `alert.resolved` | `server`, `rule`, `subject`. | | `server.offline` | `server`, `lastSeenAt`. | | `server.online` | `server`. | | `ssl.expiring`, `ssl.expired` | `website` (`id`, `name`), `server`, `domains`, `notAfter`, `daysLeft`, `staging`. | | `ssl.renew_failed` | `website`, `server`, `domains`, `notAfter`, `error`. | | `webhook.test` | `webhook` (`id`, `name`), `message`. | ## Verify the signature Check the signature of every JSON request before you trust it. Compute the HMAC over the raw body, exactly as received, before parsing it. Rejecting timestamps older than a few minutes also stops replayed requests. **Node.js** ```js import crypto from 'node:crypto'; import express from 'express'; const app = express(); const secret = process.env.VAULTPANEL_WEBHOOK_SECRET; // whsec_... app.post('/vaultpanel', express.raw({ type: 'application/json' }), (req, res) => { const timestamp = req.get('X-VaultPanel-Timestamp') ?? ''; const signature = req.get('X-VaultPanel-Signature') ?? ''; const expected = `sha256=${crypto.createHmac('sha256', secret).update(`${timestamp}.${req.body}`).digest('hex')}`; const valid = signature.length === expected.length && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)) && Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300; if (!valid) return res.sendStatus(401); const { event, data } = JSON.parse(req.body); console.log(event, data); res.sendStatus(204); }); app.listen(3000); ``` **SDK** ```js import { verifyEvent } from '@vaultpanel/sdk'; // rawBody: the request body exactly as received (a string or Buffer). const event = verifyEvent({ body: rawBody, headers: req.headers, secret: process.env.VAULTPANEL_WEBHOOK_SECRET }); if (!event) { // Wrong signature, or a timestamp more than 5 minutes off. return res.writeHead(401).end(); } console.log(event.event, event.data); ``` **PHP** ```php 300) { http_response_code(401); exit; } $event = json_decode($body, true); error_log($event['event']); http_response_code(204); ``` ## Deliveries and retries The panel's worker sends deliveries in the background, so the `vaultpanel-worker` service must be running. A delivery succeeds when your endpoint answers with a `2xx` status within 10 seconds. A delivery that fails with a network error, a timeout, or a `408`, `429` or `5xx` answer is tried again up to 3 more times: 1 minute, 5 minutes and 30 minutes after the previous attempt. Any other answer, or an address webhooks may not reach, fails it straight away. Deliveries still pending for a webhook that was turned off fail. Open a webhook's deliveries to see each one's event, status, HTTP status, duration and error. **Send again** resends a finished delivery. Deliveries are kept for 30 days. ## Private addresses Webhooks only go to public addresses by default. VaultPanel checks the address after DNS resolution and connects to that same address, so a name cannot resolve to something else later. | Addresses | Allowed | | --- | --- | | Public addresses | Always. | | Private ranges: `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, IPv6 unique local | Only with `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE=true` in the panel's `.env`. | | Loopback, link-local (including cloud metadata at `169.254.169.254`), multicast | Never. | New panels refuse private addresses since version 0.2.0. Panels installed earlier keep their previous behaviour. ## Plugins A plugin receives its events through a webhook of its own, managed on the plugin's page under **Plugins** rather than on **Webhooks**. See [Plugins](https://docs.vaultpanel.net/developers/plugins). --- # Security URL: https://docs.vaultpanel.net/guides/security > How VaultPanel protects the panel and your servers, and where to manage firewalls, SSH, brute-force protection, updates, sign-in and access. VaultPanel manages servers as root, so its design keeps that power narrow: the panel itself runs without root, every change is a signed job from a fixed allow-list, and every action is audited. This section covers the security model and the settings you manage, on each server and for the panel. ## Security overview **Security > Security Overview** scores every server on what VaultPanel checks from the summary each agent reports every 5 minutes: | Check | OK when | | --- | --- | | **Firewall** | UFW is installed and on, and does not let in everything no rule blocks | | **Root sign-in over SSH** | Root cannot sign in with a password (keys only, or not at all) | | **SSH passwords** | Only SSH keys are accepted | | **Brute-force protection** | Fail2ban is running and watches SSH | | **Automatic security updates** | Security updates install every day | | **Waiting security updates** | None are waiting | | **Agent privileges** | The agent runs as its own user, with a root helper (agent 0.36.0 and newer) | **Restart needed** appears as information when installed updates need a reboot. The overview also counts servers with the firewall off and agents too old to report security settings (firewall, SSH, Fail2ban and update management need agent 0.6.0 or newer). The same checks, and every setting behind them, are on each server's **Security** tab. That tab also has the **Malware scans** card, which installs ClamAV and can scan every website weekly, and the **Web application firewall** card, which installs ModSecurity with the OWASP Core Rule Set for websites to turn on. See [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning) and [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall). Reading them needs `security.read`; changing them needs `security.manage`. Both belong to owners and admins by default, and every change runs as a job and is recorded in the audit log as `security.*`. ![The Security tab of the server vmi3756066: Security checks at 7 of 7 passed for the firewall, root sign-in over SSH, SSH passwords, brute-force protection, automatic and waiting security updates and agent privileges, above the Firewall card](https://docs.vaultpanel.net/screenshots/server-security-light.png) ## How the panel is protected - **No root.** The API and the worker run as the unprivileged `vaultpanel` user in a systemd sandbox: no capabilities, `NoNewPrivileges`, a read-only system with write access only to the panel's own folder, and private `/tmp` and devices. `.env` and the TLS key belong to root and are only readable by the panel. The single root step connects the panel's own server before the API starts and takes no input from the network. - **HTTPS from the first start.** A new install serves the panel over HTTPS with a self-signed certificate, so passwords, the setup token and session cookies never cross the network in clear. Plain HTTP is available only on `127.0.0.1`. HSTS is sent only where the certificate is trusted, on a [panel domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). - **Sessions and CSRF.** Session tokens are random 256-bit values stored hashed, in `HttpOnly`, `SameSite=Strict` cookies that are `Secure` in production, lasting 12 hours (`VAULTPANEL_SESSION_TTL_HOURS`). State-changing browser requests also need a per-session CSRF token. Changing a password, role or active state ends sessions. - **Rate limits.** Sign-in, setup, password reset and agent registration are rate-limited per IP address, and the whole API allows 600 requests per minute per address. See [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor#rate-limits-and-lockout). - **Validated input.** Every route validates its input, database queries are parameterized, CORS is closed by default and errors never include stack traces; a request ID links them to the server log. - **Secrets at rest.** Passwords are scrypt hashes; session, enrollment and reset tokens are stored as SHA-256 hashes. Two-factor secrets, the job-signing key, app and container environment variables, database passwords, webhook URLs and secrets, and AI provider keys are encrypted with AES-256-GCM using keys derived from `VAULTPANEL_SECRET_KEY`. - **Outgoing calls.** Webhooks and plugins never call loopback, link-local (cloud metadata) or reserved addresses, and reach private networks only with `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE=true` (off by default). The host is resolved before each attempt and the request goes to the checked address, so DNS cannot be switched after the check. ## How servers are protected - **Signed, allow-listed jobs.** The agent signs every request it sends, and the panel signs every job. The agent runs only operations in its allow-list, re-validates their parameters, and runs fixed commands without a shell. There is no endpoint that runs arbitrary commands. - **A root helper, not a root agent.** From agent 0.36.0 the agent that talks to the panel runs as its own user with no capabilities. A separate root helper runs only jobs and terminal sessions it has checked against the panel's signature itself. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers#how-the-agent-runs). - **Local policy wins.** Each server's `config.json` can refuse whole areas, such as reboots, firewall changes or the terminal, whatever the panel asks. - **Lockout protection.** The agent refuses firewall rules and SSH changes that would close SSH or the panel, or leave no administrator able to sign in. Such requests fail with `LOCKOUT_REFUSED`. - **Helper checks.** If the agent is not connected to its root helper, it refuses jobs with `HELPER_UNAVAILABLE` (agent 0.50.1) rather than run them without root. - **Isolation.** Each website and app runs as its own Linux user. App units also get `ProtectHome`, kernel and control-group protections, and optional CPU and memory caps. ## Managing security - [Firewall](https://docs.vaultpanel.net/guides/security/firewall) - [SSH](https://docs.vaultpanel.net/guides/security/ssh) - [Fail2ban and updates](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates) - [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles) - [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor) - [Panel access by address](https://docs.vaultpanel.net/guides/security/panel-access) - [Audit log](https://docs.vaultpanel.net/guides/security/audit-log) - [Best practices](https://docs.vaultpanel.net/best-practices) ## Reporting a vulnerability Do not open a public issue. Report it privately through GitHub: **Security > Report a vulnerability** on [VaultPanel/packages](https://github.com/VaultPanel/packages), VaultPanel's public repository. Include what an attacker can do and what they need first, the steps to reproduce it, and the VaultPanel and agent versions (`vaultpanel version`). You get an acknowledgement within 3 working days, and an assessment within 10 working days. Security fixes go into the latest release, so keep the panel updated (`sudo vaultpanel update`) and update agents from the panel. --- # Firewall URL: https://docs.vaultpanel.net/guides/security/firewall > Manage UFW on each server from the panel, with incoming and outgoing rules, default policies and lockout protection for SSH and the panel. VaultPanel manages UFW, the Uncomplicated Firewall, on each server through its agent. You decide which ports can be reached from outside and, from agent 0.34.0, where the server itself may connect. The agent refuses any change that would lock you out of SSH or the panel. Open **Security > Firewall** and pick a server, or the **Firewall** card on a server's **Security** tab. Viewing needs `security.read`; changes need `security.manage`. ## Install and turn on If UFW is missing, click **Install UFW**. Installing changes nothing until you turn the firewall on. **Turn on** first adds rules that keep these open to everyone, then starts UFW: - SSH, on every port it listens on (read from `sshd -T`); - on the panel's own server, the port people reach the panel on; - websites (ports 80 and 443), when NGINX is installed. Every other incoming connection is then handled by the default policy. Open what else you need, such as an app on its own port or a database reached from outside, with **Add rule** before you turn the firewall on. **Turn off** makes every listening port reachable again. The rules are kept and come back when you turn the firewall on again. > **Note:** Installing NGINX while the firewall is on also opens ports 80 and 443, unless a rule blocks them on purpose. Setting up DNS or email hosting opens their ports in the same way. ## Default policies **Incoming connections no rule matches**: | Policy | Effect | | --- | --- | | **Deny** | Block everything that no rule allows (recommended) | | **Reject** | Refuse everything that no rule allows, and tell the sender | | **Allow** | Let everything in that no rule blocks | **Outgoing connections no rule matches** (agent 0.34.0 and newer): | Policy | Effect | | --- | --- | | **Allow** | The server may connect anywhere that no rule blocks (usual) | | **Deny** | The server may only connect where a rule allows | | **Reject** | Like Deny, but programs are told at once instead of waiting | Before the outgoing default becomes **Deny** or **Reject**, the agent adds outgoing allow rules for what the server needs: | Kept open | Ports | | --- | --- | | The panel's address and port, so the agent keeps reporting | The panel's port | | DNS | 53 | | Web, for updates, Git and Let's Encrypt | 80, 443 | | Time (NTP) | 123 | | Mail, if a mail server is installed | 25, 465, 587 | Anything else a program needs to reach, such as an outside database or an API on its own port, needs its own outgoing allow rule. ## Rules ![The Firewall page: the firewall is on with lockout protection for SSH (port 22) and the panel (port 8090), incoming connections denied and outgoing allowed by default, rules allowing ports 22, 8090, 80 and 443, and 8081, and the web application firewall card marked Installed](https://docs.vaultpanel.net/screenshots/firewall-light.png) Click **Add rule** and fill in: | Field | Values | | --- | --- | | **Direction** | Incoming, or Outgoing (agent 0.34.0 and newer) | | **Action** | **Allow**: let connections in. **Limit**: allow, but block an address that opens 6 or more connections in 30 seconds (good for SSH). **Deny**: drop connections silently. **Reject**: refuse connections and tell the sender. | | **Protocol** | TCP, UDP, or TCP and UDP | | **Port** | One port (`8080`), a list (`80,443`) or a range (`6000:6007`), up to 15 ports. Empty means every port. A list or range needs TCP or UDP. | | Source or destination | `any`, an IP address, or a network such as `203.0.113.0/24`. Incoming rules have a source; outgoing rules have a destination. | | **Note** | Optional, up to 60 characters: letters, digits, spaces and `. , : _ ( ) / + -` | A rule needs a port, an address, or both. Shortcuts fill in common ports: SSH (22), HTTP (80), HTTPS (443), Web (80 and 443), MySQL / MariaDB (3306) and PostgreSQL (5432). Rules apply over IPv4 and IPv6. Deny and reject rules are placed first, so they win over allow rules. Changes apply right away. Rules added outside VaultPanel, for example with `ufw` by hand, are listed with a note and left alone: change them with `ufw`. ### Blocking an address The **Failed SSH sign-ins** card on the **SSH** page lists the addresses that failed to sign in over the last 24 hours. **Block** adds a deny rule for one address. Your own address cannot be blocked this way. For automatic blocking, use [Fail2ban](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates). ## Lockout protection The agent knows the server, so it enforces these rules whatever the panel asks: - A deny or reject rule from everyone on an SSH port or the panel's port is refused. - Deleting the last rule that keeps one of those ports open is refused. - An outgoing deny or reject rule that covers the panel's address and port is refused, as is deleting the last outgoing rule that keeps the panel reachable while outgoing connections are not allowed. The panel also refuses a deny or reject rule that would block the address of the person adding it. Refused changes fail with `LOCKOUT_REFUSED` and a message saying what to add first. > **Docker publishes ports around UFW:** Docker opens public container ports itself, bypassing UFW. Containers deployed from the panel bind to `127.0.0.1` unless you choose a public port. See [Containers](https://docs.vaultpanel.net/guides/applications/containers). ## Web application firewall UFW decides which ports can be reached. The web application firewall looks inside web requests to websites and stops common attacks such as SQL injection and cross-site scripting. Its **Web application firewall** card is on **Security > Firewall** and on a server's **Security** tab: **Install** loads ModSecurity and the OWASP Core Rule Set into NGINX, off for every website. You then turn it on for each website on its **Firewall** tab. It needs agent 0.44.0 or later. See [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall). ## If you get locked out Use your hosting provider's web console, then run `ufw allow 22/tcp` or `ufw disable`. If a server went offline after setting outgoing connections to **Deny**: the agent resolves the panel's address once, when the default changes. If the panel's IP address changed since, add an outgoing allow rule for the new address from the server's console, for example `ufw allow out to 203.0.113.10 port 8090 proto tcp`, or run `ufw default allow outgoing`. If you open the panel on a port other than the one in its address, the firewall on the panel's own server does not know to keep it open. Add a rule for it, or fix the panel's address with `vaultpanel url`. --- # SSH URL: https://docs.vaultpanel.net/guides/security/ssh > Control root sign-in, password sign-in and sign-in attempts, move SSH to another port, manage authorized keys and set the login message. VaultPanel manages the OpenSSH server on each server: who may sign in and how, which port SSH listens on, and the public keys of root and other login accounts. Every change is tested before SSH reloads, and the agent refuses any change that would leave no administrator able to sign in. Open **Security > SSH** and pick a server, or the **SSH** card on a server's **Security** tab. Viewing needs `security.read`; changes need `security.manage`. ## Sign-in settings | Setting | Options | | --- | --- | | **Root sign-in** | **Allowed**: root can sign in with a password or a key. **Keys only**: root can sign in only with an SSH key. **Not allowed**: root cannot sign in over SSH; use another user and `sudo`. | | **Allow password sign-in** | Turn this off once you sign in with an SSH key. Keys cannot be guessed. | | **Sign-in attempts per connection** | 1 to 10. Fewer attempts slow down password guessing. | Click **Save SSH settings**. The agent writes `/etc/ssh/sshd_config.d/00-vaultpanel.conf`, tests it with `sshd -t`, checks the effective settings with `sshd -T`, then reloads SSH. Open sessions stay connected. If any step fails, the previous file is put back. > **Tip:** The safe setup is **Root sign-in: Keys only** with password sign-in off. Add your key first, then sign in with it in a second terminal before you turn passwords off. ### When a setting does not apply `sshd` uses the first value it reads for an option. If `/etc/ssh/sshd_config` sets the same option above its `Include /etc/ssh/sshd_config.d/*.conf` line, the change fails with `SSHD_OVERRIDDEN`: remove or comment out that line and save again. VaultPanel's file is read before other drop-ins such as `50-cloud-init.conf`. `SSHD_CONFIG_INVALID` shows what `sshd -t` said; the previous settings stay. ## SSH keys The keys card lists the authorized keys of root (`/root/.ssh/authorized_keys`) with their comment, type and fingerprint. From agent 0.34.0 the account menu next to **Add key** also lists every account people can sign in to: those with a login shell and a user ID from 1000. **Add key** takes one public key line, for example the contents of `~/.ssh/id_ed25519.pub`. Supported types are `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `sk-ssh-ed25519@openssh.com` and `sk-ecdsa-sha2-nistp256@openssh.com`. Options in front of the key, such as `from=` or `command=`, are not accepted. Create a key on your computer if you do not have one: ```bash ssh-keygen -t ed25519 cat ~/.ssh/id_ed25519.pub ``` Another account's keys are written by a small helper that first switches to that account's own user, so a `.ssh` folder or key file replaced by a symbolic link cannot redirect the write. A symlinked `authorized_keys` is refused. The **Administrator accounts** list shows root and the members of `sudo`, `admin` or `wheel`, with how many keys each has and whether a password is set. ## Lockout protection The agent refuses an SSH settings change, or removing a key, that would leave no administrator account (root, or a member of `sudo`, `admin` or `wheel` with a login shell) able to sign in with a key or a password. The card warns you before you save when no administrator who could still sign in has a key. Refused changes fail with `LOCKOUT_REFUSED`. ## Change the SSH port Moving SSH off port 22 cuts down on automated password guessing. This needs agent 0.34.0 or newer. ### Add the new port Click **Change port** and enter a free port, usually from 1024 to 65535. Leave **Keep port 22 open too for now** ticked: SSH then listens on both ports while you move. The agent refuses the panel's port, ports 80 and 443, and a port another program listens on (`PORT_IN_USE`). When the firewall is on, it opens the new port first. It then writes the `Port` lines, tests with `sshd -t` and `sshd -T`, and restarts SSH. The change is only kept once SSH answers on every port; otherwise the old file comes back (`SSH_NOT_LISTENING`). Open sessions stay connected. ### Sign in on the new port ```bash ssh -p 2222 root@203.0.113.10 ``` A firewall at your hosting provider, such as a cloud security group, may need the new port opened too. ### Close the old port Back in the panel, click **Close port 22**. SSH then listens on the new port alone, and VaultPanel removes the firewall rule it had added for the old one. Fail2ban's SSH jail follows the new ports automatically. ## Login message The **Login message** card sets what someone sees when they sign in over SSH or open the [terminal](https://docs.vaultpanel.net/guides/servers/terminal). This needs agent 0.21.0 or newer. | Mode | What is shown | | --- | --- | | **VaultPanel only** (default) | The VaultPanel banner with its links (website, documentation, best practices, the panel's address and the `vaultpanel` command), then the "Last login" line | | **System message** | The operating system's own welcome text, help links, news and update notices | **Show the system's message** and **Show only VaultPanel** switch between them. Switching back restores the system's message exactly as it was. ## Failed sign-ins **Failed SSH sign-ins** summarizes failed attempts over the last 24 hours from the system journal, by address. **Block** adds a [firewall](https://docs.vaultpanel.net/guides/security/firewall) deny rule for one address. To block repeat offenders automatically, turn on [Fail2ban](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates). ## If you get locked out Use your hosting provider's web console, remove `/etc/ssh/sshd_config.d/00-vaultpanel.conf` and run `systemctl reload ssh`. After a port change, connect with `ssh -p `, and check `journalctl -u ssh` if SSH did not answer on the new port. --- # Fail2ban and security updates URL: https://docs.vaultpanel.net/guides/security/fail2ban-and-updates > Block addresses that keep failing to sign in over SSH with Fail2ban, and keep servers patched with automatic daily security updates. Two settings keep a server hard to break into over time: Fail2ban blocks addresses that keep guessing SSH passwords, and unattended-upgrades installs the operating system's security fixes every day. Both are managed per server. Viewing needs `security.read`; changes need `security.manage`. ## Brute-force protection with Fail2ban Fail2ban reads the SSH log and blocks an address that fails to sign in too many times. Its card, **Brute-force protection**, is on **Security > SSH** and on each server's **Security** tab. If Fail2ban is missing, click **Install Fail2ban**. The agent installs it together with `python3-systemd`, so Fail2ban can read the systemd journal; without that package it reads `/var/log/auth.log`. ### Settings | Setting | Default | Range | | --- | --- | --- | | **Protect SSH** | | Starts Fail2ban now and at every boot | | **Failed attempts** | 5 | 1 to 20 | | **Within (minutes)** | 10 | 1 to 1440 | | **Block for (minutes)** | 60 | 1 to 43,200 (30 days) | | **Never block** | | Up to 20 addresses or networks, one per line | The server itself is always on the **Never block** list. Add the addresses you work from; **Add my address** fills in yours as the panel sees it. Saving writes `/etc/fail2ban/jail.d/vaultpanel.local`, checks it with `fail2ban-client --test`, enables and restarts Fail2ban, then checks that the SSH jail runs. If the jail does not start, the previous file is put back and the change fails with `JAIL_FAILED`: usually `python3-systemd` is missing (`apt install python3-systemd`), and `/var/log/fail2ban.log` has the details. When you [move SSH to another port](https://docs.vaultpanel.net/guides/security/ssh#change-the-ssh-port), the jail follows the new ports. ### Blocked addresses Below the settings the card shows how many addresses are blocked now, how many since Fail2ban started, and how many are failing now. Each blocked address has **Unblock**. The **Failed SSH sign-ins** card next to it summarizes the last 24 hours from the journal, and **Block** adds a permanent [firewall](https://docs.vaultpanel.net/guides/security/firewall) rule for one address. ## Security updates The **Security updates** card on each server's **Security** tab manages unattended-upgrades, the Debian and Ubuntu tool that installs security fixes from the operating system every day. It needs apt. - **Install**: installs unattended-upgrades when it is missing. - **Turn on** / **Turn off**: daily automatic security updates. The agent writes `/etc/apt/apt.conf.d/20auto-upgrades`. - The number of security updates waiting, out of all waiting updates, counted with `apt-get -s upgrade` and cached for 6 hours. - **Install security updates now**: runs `unattended-upgrade` at once. Services it updates restart, and it can take several minutes. The server is not restarted. When installed updates need a reboot, the card says so; restart from the server page when it suits you. To patch many servers, run **Install security updates** as a [bulk action](https://docs.vaultpanel.net/guides/servers/server-groups#bulk-actions). It runs one server at a time by default. ## Security checks Both settings feed the [security overview](https://docs.vaultpanel.net/guides/security#security-overview): **Brute-force protection** is OK when Fail2ban runs and watches SSH, **Automatic security updates** when updates install every day, and **Waiting security updates** when none are waiting. --- # Users and roles URL: https://docs.vaultpanel.net/guides/security/users-and-roles > Invite people to the panel, give them one of the built-in roles, and see exactly which permissions each role grants. Everyone who signs in to the panel has an account with one role. A role is a fixed set of permissions, and the panel checks permissions, never role names, in its service layer, so the same rules apply in the browser, the API, the CLI and the AI assistant. Every denial is recorded in the audit log as `authz.denied`. ## Users **Users & Access > Users** lists everyone who can sign in, with their role, status and last sign-in. Search by name or email, and filter by role or by active and inactive accounts. Viewing users needs `users.read`; inviting and changing them needs `users.manage`. ### Invite a user Click **Invite a user** and enter their name, email and role. The panel creates an invite link that works once and expires after 72 hours; they choose their own password with it. When [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) is set up, the link is emailed to them; otherwise send it yourself over a channel you trust. The link is not shown again. ### Change a user Click a user to open **Edit**: | Action | Effect | | --- | --- | | **Name** | Changes their display name | | **Role** | Changes their role and signs them out everywhere. You cannot change your own role. | | **Active (can sign in)** | Unticking it deactivates the account and ends its sessions. You cannot deactivate yourself. | | **Create password reset link** | A one-time link that expires after 2 hours, emailed when panel email is set up | | **Turn off two-factor sign-in** | For someone who lost their authenticator app and recovery codes. They are signed out everywhere. | Staff accounts are deactivated, not deleted: an inactive account cannot sign in. Hosting customers' accounts are managed from their page under **Hosting > Customers** instead. ### Rules that protect accounts - You can only give roles at or below your own, and only manage users whose role is not above yours. Admins therefore cannot give the owner role or change owners. - The panel must keep at least one active owner: demoting or deactivating the last one fails with `LAST_OWNER`. - A password must have at least 12 characters. ## Built-in roles **Users & Access > Roles** shows the built-in roles and the permission matrix. Custom roles are not available yet. ![The Roles page: cards for the Owner, Admin, Developer, Viewer and Customer roles with their user and permission counts, above the permission matrix](https://docs.vaultpanel.net/screenshots/roles-light.png) | Role | For | | --- | --- | | **Owner** | Full control of the panel, including other owners and the server terminal | | **Admin** | Managing servers, users (except owners) and settings. Everything an owner has except the server terminal. | | **Developer** | Viewing servers, websites, DNS zones, email, apps, containers and databases; deploying and restarting apps; starting, stopping and restarting containers; backing up; running cron jobs; routine operations such as service restarts; working on website files; and asking the AI assistant | | **Viewer** | Read-only access to servers, websites, DNS zones, email, apps, containers, databases, backups, cron jobs and jobs, and the AI assistant | | **Customer** | A hosting customer, who manages only the websites, apps, databases, backups and cron jobs of their own account, within their plan | The **Customer** role is never given from the Users page. It comes with creating a customer under **Hosting > Customers**, and its permissions only ever apply inside that customer's account. See [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing). ### Owner-only `servers.terminal`, a root shell in the browser, belongs to owners alone. It is not given to admins, and never through an API token, a plugin or the AI assistant. See [Terminal](https://docs.vaultpanel.net/guides/servers/terminal). ## Permissions Permissions are named `area.action`. The tables below list every permission and the built-in roles that have it. ### Panel and people | Permission | Allows | Owner | Admin | Developer | Viewer | Customer | | --- | --- | :-: | :-: | :-: | :-: | :-: | | `dashboard.view` | View the dashboard | ✓ | ✓ | ✓ | ✓ | | | `users.read` | View users and their roles | ✓ | ✓ | | | | | `users.manage` | Invite, update, deactivate users and issue password reset links | ✓ | ✓ | | | | | `roles.read` | View roles and their permissions | ✓ | ✓ | | | | | `audit.read` | View the audit log | ✓ | ✓ | | | | | `settings.manage` | Change panel settings | ✓ | ✓ | | | | | `jobs.read` | View jobs and their logs | ✓ | ✓ | ✓ | ✓ | ✓ | | `jobs.cancel` | Cancel queued jobs | ✓ | ✓ | | | | | `assistant.use` | Ask the AI assistant, which reads what you are allowed to see and proposes changes for you to approve | ✓ | ✓ | ✓ | ✓ | | | `plugins.manage` | Install, approve, turn off and remove plugins, and see the events sent to them | ✓ | ✓ | | | | ### Servers and monitoring | Permission | Allows | Owner | Admin | Developer | Viewer | Customer | | --- | --- | :-: | :-: | :-: | :-: | :-: | | `servers.read` | View servers, their status and metrics | ✓ | ✓ | ✓ | ✓ | | | `servers.manage` | Add, rename and remove servers, manage server groups, update agents and issue enrollment tokens | ✓ | ✓ | | | | | `servers.services` | Check, start, stop and restart services and read their logs | ✓ | ✓ | ✓ | | | | `servers.processes` | List running processes on a server | ✓ | ✓ | ✓ | | | | `servers.reboot` | Reboot a server | ✓ | ✓ | | | | | `servers.signal` | Stop or kill processes on a server | ✓ | ✓ | | | | | `servers.bulk` | Run an operation on several servers at once (each server still needs the permission for the operation itself) | ✓ | ✓ | | | | | `servers.terminal` | Open a root terminal on a server from the browser (owners only; every session is in the audit log) | ✓ | | | | | | `servers.logs` | Read system, kernel, sign-in and cron logs on servers | ✓ | ✓ | | | | | `alerts.read` | View alerts and alert rules | ✓ | ✓ | ✓ | ✓ | | | `alerts.acknowledge` | Acknowledge firing alerts | ✓ | ✓ | ✓ | | | | `alerts.manage` | Create, change and delete alert rules | ✓ | ✓ | | | | | `security.read` | View firewall rules, SSH settings, Fail2ban and update status of servers | ✓ | ✓ | | | | | `security.manage` | Change firewall rules, SSH settings, SSH keys, Fail2ban and automatic updates, and install security updates | ✓ | ✓ | | | | ### Websites, apps and data | Permission | Allows | Owner | Admin | Developer | Viewer | Customer | | --- | --- | :-: | :-: | :-: | :-: | :-: | | `websites.read` | View websites, domains and SSL certificates | ✓ | ✓ | ✓ | ✓ | ✓ | | `websites.manage` | Create, change and delete websites, their domains and SSL certificates, and install the web stack | ✓ | ✓ | | | ✓ | | `websites.logs` | Read website access and error logs | ✓ | ✓ | ✓ | | ✓ | | `files.read` | Browse and download website files | ✓ | ✓ | ✓ | | ✓ | | `files.write` | Upload, edit, rename and delete website files | ✓ | ✓ | ✓ | | ✓ | | `applications.read` | View applications, their deployments and process state | ✓ | ✓ | ✓ | ✓ | ✓ | | `applications.manage` | Create, change and delete applications, and view and change their environment variables | ✓ | ✓ | | | ✓ | | `applications.deploy` | Deploy, roll back, start, stop and restart applications | ✓ | ✓ | ✓ | | ✓ | | `applications.logs` | Read application output and error logs | ✓ | ✓ | ✓ | | ✓ | | `databases.read` | View databases and database users | ✓ | ✓ | ✓ | ✓ | ✓ | | `databases.manage` | Create and delete databases and database users, change access and view passwords | ✓ | ✓ | | | ✓ | | `containers.read` | View Docker, containers and images on servers | ✓ | ✓ | ✓ | ✓ | | | `containers.operate` | Start, stop and restart containers | ✓ | ✓ | ✓ | | | | `containers.logs` | Read the output of containers | ✓ | ✓ | ✓ | | | | `containers.manage` | Install Docker, deploy, change and remove containers, pull and remove images, and view container environment variables | ✓ | ✓ | | | | | `dns.read` | View DNS zones and their records | ✓ | ✓ | ✓ | ✓ | | | `dns.manage` | Set up DNS servers, and create, change and delete DNS zones and records | ✓ | ✓ | | | | | `mail.read` | View email domains, mailboxes and forwarders | ✓ | ✓ | ✓ | ✓ | | | `mail.manage` | Set up mail servers, and create, change and delete email domains, mailboxes and forwarders | ✓ | ✓ | | | | ### Backups and automation | Permission | Allows | Owner | Admin | Developer | Viewer | Customer | | --- | --- | :-: | :-: | :-: | :-: | :-: | | `backups.read` | View backups, backup schedules and restores | ✓ | ✓ | ✓ | ✓ | ✓ | | `backups.create` | Back up websites, apps and databases now | ✓ | ✓ | ✓ | | ✓ | | `backups.manage` | Restore, download and delete backups, and manage backup schedules | ✓ | ✓ | | | ✓ | | `cron.read` | View cron jobs and their run history | ✓ | ✓ | ✓ | ✓ | ✓ | | `cron.run` | Run a cron job now | ✓ | ✓ | ✓ | | ✓ | | `cron.manage` | Create, change and delete cron jobs | ✓ | ✓ | | | ✓ | | `webhooks.manage` | Create, change and delete webhooks and see their deliveries | ✓ | ✓ | | | | ### Hosting and billing | Permission | Allows | Owner | Admin | Developer | Viewer | Customer | | --- | --- | :-: | :-: | :-: | :-: | :-: | | `customers.read` | View customers, their hosting plans and what they use | ✓ | ✓ | | | | | `customers.manage` | Create customers, change their plan, suspend, unsuspend and remove them, and move websites, apps and databases to them | ✓ | ✓ | | | | | `plans.manage` | Create, change and delete hosting plans | ✓ | ✓ | | | | | `billing.manage` | Create and revoke the API keys billing systems use | ✓ | ✓ | | | | ## API tokens API tokens act as the person who created them, narrowed to the scopes chosen for the token. A token can never do more than its owner, and narrowing someone's role narrows their tokens too. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens). --- # Sign-in and two-factor URL: https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor > Protect panel accounts with two-factor sign-in, passkeys and recovery codes, require it by policy, manage signed-in sessions and understand lockout and rate limits. Panel accounts sign in with an email address and a password, and optionally a code from an authenticator app, or with a passkey. Owners and admins can require two-factor sign-in for some or all accounts, see every signed-in browser and end sessions. ## Passwords - Passwords need at least 12 characters and are stored as scrypt hashes. - A failed sign-in takes the same time whether or not the account exists. - Changing your password under **Account** signs you out everywhere else. ### Forgotten passwords When [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) is set up, the sign-in page offers **Forgot your password?** and emails a reset link, at most once every 5 minutes per account. Without panel email, ask an owner or admin: with `users.manage` they can click **Create password reset link** on your account under **Users**. Reset links work once and expire after 2 hours. ## Two-factor sign-in Two-factor sign-in uses time-based one-time codes (TOTP, RFC 6238) from an app such as 1Password, Authy or Google Authenticator. The secret is encrypted at rest, and a code cannot be used twice. ### Turn it on ### Start the setup Open **Account** from the account menu. Under **Two-factor sign-in**, click **Set up two-factor sign-in**. ### Add the account to your app Add it with the **Setup key**, or click **Open in authenticator app** on a phone that has one. ### Confirm a code Enter the six-digit **Code from the app** and click **Turn on**. ### Save your recovery codes The panel shows 10 one-time recovery codes, such as `7kq3m-x9t2p`. **Copy** or **Download** them now: they are not shown again. From then on, signing in asks for a code after your password. If you lose your app, choose **Lost your app? Use a recovery code**. Each recovery code works once, using one is recorded in the audit log, and **Account** shows how many are left. - **Make new codes** replaces all your recovery codes. It asks for your password and a current code. - **Turn off two-factor sign-in** also asks for your password and a current code. Someone who lost both their app and their recovery codes needs an owner or admin with `users.manage` to click **Turn off two-factor sign-in** on their account under **Users**, or under **Security > Authentication**. That account is signed out everywhere. ### Require it for everyone **Security > Authentication** sets the two-factor policy. It needs `settings.manage` (owners and admins). | Policy | Who must use two-factor sign-in | | --- | --- | | **Optional** | Each person decides | | **Owners and admins** | Owners and admins | | **Everyone** | Every account | You must use two-factor sign-in yourself before you can require it; otherwise saving fails with `TWO_FACTOR_REQUIRED_FIRST`. The policy applies at once: someone it covers who has not set it up can only set it up, or sign out, until they do. Agents and webhooks are not affected. The **People** list on the same page shows each account's role, two-factor state, active sessions and last sign-in. > **Note:** One-time sign-in links that a [billing system](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api) requests for a hosting customer skip the second factor, because the billing system's key can already set that account's password. Each link works once, within two minutes. ## Passkeys A passkey signs you in with your device's fingerprint, face or PIN. **Sign in with a passkey** on the sign-in page needs no email, password or code. A passkey is a whole sign-in: the device and the check it makes count as two factors, so no authenticator code is asked after it. ### What passkeys need - The panel opened on its domain name over HTTPS, such as `https://panel.example.com`. Passkeys do not work on an IP address or over plain HTTP (only `http://localhost` is allowed). Set up a [panel domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain) first. - A recent browser. If the browser cannot use passkeys there, **Account** says so and the sign-in page does not show the button. A passkey works only on the panel address it was made on, so a look-alike site cannot use it. A passkey made on one address does not work on another. ### Add a passkey ### Open Passkeys Open **Account** from the account menu. Under **Passkeys**, click **Add a passkey**. ### Name it and confirm your password Keep or change the **Name** (the panel suggests one, such as `Mac · Safari`), enter **Your password** and click **Continue**. The password stops anyone else using this browser from adding a way into your account. ### Confirm on your device Your browser or phone asks you to make the passkey and to check your fingerprint, face or PIN. Add one passkey for each phone, computer or security key you use, up to 20 per account. The list shows each passkey's name, the address it is for, whether it is **synced** between your devices, and when it was last used. **Remove** takes one away. ### How the panel checks them - The device must confirm it is you (fingerprint, face or PIN) every time. - Each sign-in request works once and expires after 5 minutes. - A passkey whose counter goes backwards is refused, because it may have been copied. - The panel checks the signatures itself (ES256, EdDSA and RS256 keys). It keeps only the public key. - A refused passkey counts as a failed sign-in towards the account lockout below. ### Passkeys and the two-factor policy A passkey counts as two-factor sign-in. Someone the [two-factor policy](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor#require-it-for-everyone) covers who has a passkey does not also need an authenticator app. ## Sessions A session lasts 12 hours by default (`VAULTPANEL_SESSION_TTL_HOURS`, from 1 hour to 30 days). Session cookies are `HttpOnly`, `SameSite=Strict` and, in production, `Secure`. Changing a password, role or active state ends that person's sessions. - **Account > Where you're signed in** lists your browsers. Sign out one you no longer use, or **Sign out everywhere else**. If you see one you don't recognise, sign it out and change your password. - **Security > Authentication > Signed-in browsers** lists everyone's active sessions. With `users.manage` you can end any of them, except those of people whose role is above yours. ## Rate limits and lockout | What | Limit | | --- | --- | | Failed sign-ins on one account | 5, then the account is locked for 15 minutes (`ACCOUNT_LOCKED`) | | Sign-in attempts per IP address | 20 per 15 minutes | | Owner setup attempts per IP address | 10 per 15 minutes | | Password reset requests per IP address | 20 per 15 minutes | | API requests per IP address | 600 per minute | Requests over a limit get `429` with the code `RATE_LIMITED`. The limits are kept in memory by each panel process. ## Audit log Sign-ins and changes to them are recorded in the [audit log](https://docs.vaultpanel.net/guides/security/audit-log), including `auth.login` (with failures and their reason, and the method for passkeys), `auth.passkey_add`, `auth.passkey_remove`, `auth.logout`, `auth.password_change`, `auth.password_reset_request`, `auth.recovery_codes_regenerate`, `auth.session_revoke`, `user.session_revoke` and `security.two_factor_policy`. --- # Panel access by address URL: https://docs.vaultpanel.net/guides/security/panel-access > Accept panel users only from the IP addresses and networks you trust, without blocking agents, deploy hooks, billing systems or plugins. Panel access by address lets people use the panel only from the addresses you list, such as your office or VPN. Everyone else sees a page saying the panel does not accept their address, and signing in and the browser terminal are refused too. It is off by default. ## Turn it on Open **Security > Authentication** and find **Panel access by address**. It needs `settings.manage` (owners and admins). ### Add your own address first The card shows **Your address, as the panel sees it**. Click **Add it** to put it on the list. ### Add the other addresses Add each IP address or network, with an optional note, for example `203.0.113.7` or `203.0.113.0/24` for an office. IPv4 and IPv6 are both supported, up to 50 entries. ### Choose who it applies to | Scope | Effect | | --- | --- | | **Everyone** | Staff and hosting customers can only use the panel from these addresses | | **Staff only** | Staff can only use the panel from these addresses; hosting customers sign in from anywhere | ### Turn it on and save Tick **Only accept these addresses** and click **Save panel access**. The panel refuses to save a list that leaves out the address of whoever saves it, so you cannot lock yourself out from the page. The change is recorded in the audit log as `security.panel_access`. ## What is never blocked These have their own credentials and keep working from any address: - server agents, - push-to-deploy webhooks, - billing systems using a billing API key, - plugins using their own token, - the panel's own server, over loopback. A request refused by the list gets `IP_NOT_ALLOWED`. ## Behind a reverse proxy The panel must see people's real addresses. Behind a reverse proxy or a CDN such as Cloudflare, everyone appears with the proxy's address unless `VAULTPANEL_TRUST_PROXY` in the panel's `.env` names the proxy. ## Locked out If your address changed and no allowed address is left to you, turn the list off from the panel's server: ### Turn the check off Add `VAULTPANEL_PANEL_ACCESS=off` to the panel's `.env` (`/opt/vaultpanel/.env` on a panel installed with the installer), then restart the panel: ```bash sudo vaultpanel restart ``` While it is set, the card shows that the list is not applied. ### Fix the list Sign in, add your new address under **Panel access by address**, and save. ### Turn the check on again Remove the `VAULTPANEL_PANEL_ACCESS` line from `.env` and restart the panel again. --- # Audit log URL: https://docs.vaultpanel.net/guides/security/audit-log > The append-only record of every sign-in, change, denial and operation in VaultPanel, what each entry holds and how to filter it. The audit log records who did what, to what, from where, and whether it worked. It covers sign-ins, every change made through the panel, the API, the CLI, plugins and the AI assistant, permission denials, and events the panel raises itself, such as alerts firing and servers going offline. Entries cannot be edited, and are removed only after the retention period you choose. ## Read the audit log Open **Security > Audit Log**. It needs `audit.read` (owners and admins by default). Entries are listed newest first; click one to see all its details. Filter the list by: - **Action**: entries whose action starts with the text you type, for example `server.` for everything about servers or `auth.login` for sign-ins. - **Result**: **Success**, **Failure** or **Denied**. The [API](https://docs.vaultpanel.net/api-reference/users-and-roles) also filters by actor, target type and ID, and a time range. ## What an entry holds | Field | What it is | | --- | --- | | When | The time of the action | | Who | The actor: a signed-in user (by email), an agent, a plugin, a billing API key, someone not signed in yet, or the system itself | | Action | What was done, named `area.verb`, such as `website.create` | | Target | What it was done to: a type, an ID and a label | | Result | `success`, `failure` or `denied` | | IP | The address the request came from | | User agent | The browser or client | | Request ID | Links the entry to the panel's server log and to the API response | | Details | Metadata about the change, such as the before and after of a setting | A user acting through an API token is recorded as that user. Actions the AI assistant runs are recorded as the person who asked, labelled `email (assistant)`, and plugin actions as `plugin:`. ## What is recorded | Area | Examples | | --- | --- | | Sign-in | `auth.login` (with the reason for failures), `auth.logout`, `auth.password_change`, `auth.session_revoke`, `auth.setup_owner` | | Access | `authz.denied` for every refused permission, `user.invite`, `user.update`, `api_token.create`, `api_token.revoke`, `security.two_factor_policy`, `security.panel_access` | | Servers | `server.create`, `server.delete`, `server.agent_update`, `server.offline`, `server.online`, `server.terminal.open`, `server.terminal.close` | | Jobs | `job.create`, `job.cancel`, and the server security changes they carry, such as `security.firewall_rule_add` and `security.firewall_enable` | | Monitoring | `alert.fire`, `alert.resolve`, `alert.acknowledge`, `alert_rule.create` | | Hosting | `website.*`, `application.*`, `database.*`, `backup.*`, `cron_job.*`, `dns_zone.*`, `mailbox.*`, `container.*` | | Secrets viewed | `application.env_view`, `database_user.password_view`, `container.env_view`, `website.env_view` | | Business | `customer.*`, `plan.*`, `api_key.create`, `api_key.revoke` | | Extensions | `plugin.*`, `webhook.*`, `assistant.action_approve` | Secrets are not written to the log: passwords, environment variable values and file contents stay out of entries, and are replaced with a redacted marker in a job's stored parameters when the job ends. ## Protection On MariaDB and MySQL, database triggers protect the audit log table: - **No entry can be changed**, with one exception: when a person is [erased](https://docs.vaultpanel.net/guides/security/personal-data#answering-requests), the name or email shown becomes "Erased person" and the IP address and browser are removed. What was done, by which account, when and with what result never changes. - **No entry can be deleted** until it is older than the retention period, and never before it is 90 days old, whatever the panel asks. No API can change entries. `TRUNCATE` and `DROP` bypass triggers, so keep direct access to the panel's database restricted. If writing an entry ever fails, the failure is logged loudly, but it never hides the outcome of the action being audited. ## Retention By default entries are kept forever. Owners and admins can choose a period at the top of the **Audit log** page: 90 days, 6 months, or 1, 2, 5 or 10 years. The background worker then removes older entries, a batch at a time, and the change of period is itself recorded. Pick a period that fits your security and legal needs and state it in your privacy notice; see [Personal data and GDPR](https://docs.vaultpanel.net/guides/security/personal-data). ## Events from the audit log Some entries also become events you can receive elsewhere: an alert firing or resolving, and a server going offline or coming back online, can be sent to [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) and by [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). --- # Personal data and GDPR URL: https://docs.vaultpanel.net/guides/security/personal-data > The personal data a VaultPanel panel keeps, where it goes and for how long, and how to answer access and erasure requests (GDPR and similar laws). This page is for whoever runs a VaultPanel panel: a company managing its own servers, or a hosting provider whose customers sign in to it. It lists the personal data VaultPanel keeps, where it goes, how long it is kept, and how to answer people who ask for their data or for it to be deleted. It describes the software. It is not legal advice: what your obligations are depends on your country, your customers and your contracts. Have them checked by someone qualified. ## Who is responsible VaultPanel is self-hosted. **The VaultPanel project receives nothing from your panel:** no usage statistics, no error reports, and no check-ins. The panel and its agents talk only to each other and to the services you configure (below). So for the personal data in your panel, **you are the controller**. If you host websites, email or apps for customers, you are usually also a **processor** for the personal data inside them (their visitors' data, their mailboxes). For that relationship, see the data processing agreement template that comes with VaultPanel (`legal/dpa-template.md` in the source). ## What the panel stores about people | Data | About whom | Where | How long | | --- | --- | --- | --- | | Name, email, role, language, time zone | Panel users | `users` | Until erased (see [Answering requests](https://docs.vaultpanel.net/guides/security/personal-data#answering-requests)) | | Password, two-factor secret, recovery codes | Panel users | `users`, `user_recovery_codes` | Hashed or encrypted; until erased | | Passkeys: name, the panel address, public key, signature counter, whether synced, when added and last used | Panel users | `passkeys` | Until removed on **Account > Passkeys**. Erasing the person does not delete them, but they can no longer sign in | | Sessions: IP address, browser, times | Panel users | `sessions` | 30 days after they end | | API tokens: name, last use, last IP | Panel users | `api_tokens` | Until revoked and erased | | Audit log: who did what, from which IP and browser | Panel users, hosting customers | `audit_logs` | **Forever by default.** Set a period under **Audit log** (90 days to 10 years) | | Assistant conversations (what was asked and answered) | Panel users | `assistant_messages` | Until the person deletes them, or is erased | | Terminal sessions: who, which server, IP, times; recordings | Panel users | `terminal_sessions`, recording files | 90 days by default (set on the **Terminal** page) | | Emails the panel sent (invites, resets, alerts) | Recipients | `email_messages` | 30 days | | Hosting account: name, company, email | Hosting customers | `customers` | Until the account is removed and the person erased | | Mailboxes: address, display name, password hash, mail | People with email on your servers | Panel database, mail servers | Until the mailbox is deleted | | Mailbox password hashes from a [cPanel move](https://docs.vaultpanel.net/guides/security/personal-data#moving-from-cpanel) | People with email in the backup | `site_migrations`, encrypted | Until the mailboxes are made, or the move fails or is discarded | | SFTP for a website: password hash, public keys | Whoever signs in with them | `websites` | Until SFTP is turned off or the website is deleted | | Web application firewall log: time, client address, host, method, request line, status, rule ids and messages | Visitors of websites with the firewall on | The website's server (`/var/log/vaultpanel-waf/audit.log`, root only) | Rotated daily, 7 days kept | | Website statistics: day totals and top lists (pages, referring sites, browsers, systems, pages not found) | Not personal: no addresses or user agents | `website_stats_daily` | 400 days | | Webhook deliveries (event payloads) | Possibly anyone named in an event | `webhook_deliveries` | 30 days | | Server metrics, jobs, alerts | Not personal on their own; jobs record which account asked | Panel database | Metrics 7 days by default (`VAULTPANEL_METRICS_RETENTION_DAYS`), resolved alerts per `VAULTPANEL_ALERT_HISTORY_DAYS`, jobs kept | | Websites, apps, databases, files, backups | Whatever your customers put in them | Your servers, backup storage | Until deleted; backups per their schedule's "keep" count | Secrets (S3 keys, SFTP keys, backup keys, the AI provider's API key, database passwords) are stored encrypted with the panel's secret key, and job parameters that carry them are removed when the job ends. ### Passkeys The panel keeps only a passkey's public key, never anything that could sign in. It also keeps the name you gave it, the panel address it works on, its signature counter (to spot a copied passkey), whether the device syncs it, and when it was added and last used. Each account gets a random passkey handle, so the passkey does not carry the person's email or account id. Sign-in challenges expire after 5 minutes. ### Web application firewall When the [web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) is on for a website, ModSecurity writes what it catches to one log on that website's server. It keeps the request line (method and address requested, with its query string), the client's IP address, the response status and the rules that matched. It never keeps request headers or bodies, so no cookies, passwords or form fields, and the panel never shows the values a rule matched. The log is readable by root only, rotated daily and kept for 7 days. **What the firewall caught** reads the newest entries for one website when you open it. Like other jobs, that read and its result are kept in the panel's job history. ### Website statistics [Website statistics](https://docs.vaultpanel.net/guides/websites/statistics) are counted on the website's server from its NGINX access logs. Only the day totals and each day's top 20 lists reach the panel: no IP addresses, user agents or query strings. A visitor is counted as a different address and browser on a day; that pairing is kept only in memory while counting. Referring sites are kept as their host name only. Statistics older than 400 days are deleted. The access logs themselves stay on the server, as before. ### Moving from cPanel When you [move websites from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel), the uploaded backup is copied to the chosen server and the panel's copy is deleted once the server has it. On the server, the backup is deleted once the move is done, or when the move is discarded. Mailbox passwords come over as cPanel's SHA512-CRYPT hashes: they are kept out of the job's stored output, kept encrypted until the mailboxes are made, then deleted. The moved websites, databases and mail are then ordinary data on your server. ### SFTP [SFTP](https://docs.vaultpanel.net/guides/websites/sftp) passwords are generated, shown once, and kept as SHA512-CRYPT hashes only. SSH keys are kept as their public key lines. Turning SFTP off or deleting the website removes them. ## Where data goes Only when you turn the feature on: | Feature | Recipient | What is sent | | --- | --- | --- | | Panel email (System > Panel Email) | Your SMTP provider | Recipients' addresses, the message (invite and reset links, alerts) | | AI assistant (System > Assistant Settings) | Anthropic or the OpenAI-compatible provider you configure; nothing with **Free model on this server** | What the person types, and the server details the assistant reads to answer | | Backups to storage | Your S3-compatible bucket or SFTP server | Backups, **encrypted** before they leave the server (agent 0.42.0+); keep each storage's key | | SSL certificates | Let's Encrypt | The domain names, and the contact email you enter | | DNS providers (DNS Zones) | Cloudflare or Namecheap | Domain names and check records | | Webhooks | The URLs you add | Event payloads (which can include names, emails and resource names) | | Billing API / WHMCS | Your billing system | Hosting accounts' names, emails and plans | Each of these is a recipient (and usually a sub-processor) you should name in your own privacy notice and agreements. Check where each one stores data if you transfer it out of the EU/EEA. ## Answering requests **A copy of someone's data (access, portability, GDPR art. 15 and 20).** People download their own under **Account > Download my data**. For someone else, open **Users**, open the person and click **Export personal data**. You get a JSON file with their account, sessions, API tokens, assistant conversations, terminal sessions, hosting account and their entries in the audit log. Passwords, two-factor secrets and token values are never included. Passkeys are not in the export; the person sees theirs on **Account > Passkeys**. Exports are recorded in the audit log. **Deleting someone (erasure, art. 17).** On **Users**: 1. Open the person and untick **Active**, then save. 2. Open them again, click **Erase personal data** and confirm. Their name and email are replaced, and these are deleted: sessions, API tokens, recovery codes, reset links, assistant conversations, preferences, and emails waiting to be sent to them. The audit log keeps what the account did, but not who they were: the name or email shown becomes "Erased person", and the IP addresses and browsers are removed. This keeps the record of what happened useful for security without identifying the person, and cannot be undone. Erasing does not delete the person's passkeys. The account can no longer sign in with them, but if you want them gone, ask the person to remove them on **Account > Passkeys** before you erase the account. For a hosting customer, remove their hosting account on **Customers** first. That deletes their websites, apps, databases and mailboxes. Erasing their panel user then erases their contact details too. Their backups in storage are deleted with the backups (or expire per their schedule). Their data in your own backups of the panel (`vaultpanel backup`) stays until those backups expire; say so in your privacy notice. **Correcting data (art. 16).** People change their language and time zone themselves (**Account > Preferences**); an admin corrects their name on **Users**. An email address cannot be changed: invite the person again with the right address, then erase the old account. ## Retention - Set the audit log period under **Audit log** (owners and admins). The database itself refuses to delete entries younger than the period, and never anything under 90 days, so a compromised panel cannot erase recent history. Unset, entries are kept forever. - Choose a period that fits your security and legal needs (one or two years is common) and state it in your privacy notice. - The other periods are in the table above. ## Security The measures behind "appropriate technical and organisational measures" (art. 32) are described in [Security](https://docs.vaultpanel.net/guides/security). Among them: - HTTPS throughout, with two-factor sign-in and passkeys available and enforceable; - scrypt password hashing; - role-based access, with an append-only audit log; - secrets encrypted at rest; - backups encrypted before they leave the server; - agents run only signed, allowlisted operations. ## Other laws The same tools cover most privacy laws built on the same ideas, such as the UK GDPR, Brazil's LGPD, South Africa's POPIA, Kenya's and Nigeria's data protection acts, and the CCPA/CPRA in California. Their deadlines and wording differ (for example, one month to answer under the GDPR, 45 days under the CCPA). --- # Hosting plans and customers URL: https://docs.vaultpanel.net/guides/hosting-and-billing > Sell hosting from VaultPanel with plans that cap what each customer may create, customer accounts that see only their own resources, suspension and removal. VaultPanel can host other people. A **hosting plan** sets how many websites, apps, databases and cron jobs a customer may have, their disk space and caps on each app. A **customer** is a hosting account on a plan: a sign-in that sees only its own account, on a home server where everything it creates is placed. You manage both under **Hosting** in the sidebar: **Customers**, **Hosting Plans**, **Financial Report** and **Billing API**. Billing systems such as WHMCS or Blesta can do the same through the [billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api). > **Note:** VaultPanel does not take payments. A plan's price is shown to your team and handed to billing systems, which invoice and charge customers and then call VaultPanel. ## Hosting plans ![The Hosting Plans page with one plan card, Serter at NGN 2,000.00 a month, listing 5 websites, 10 subdomains, 2 apps, 5 databases, 5 database users, 10 cron jobs, 10 GB of disk and no CPU or memory cap per app, with 1 customer and Edit and Delete buttons](https://docs.vaultpanel.net/screenshots/hosting-plans-light.png) Open **Hosting > Hosting Plans** and click **New hosting plan**. A plan has: | Field | Description | | --- | --- | | **Name** | Up to 60 characters: letters, numbers, spaces and `. _ - + ( ) &`. Unique. Billing systems can refer to a plan by its name. | | **Servers** | **Any server**, or a server group. New accounts on the plan are placed on a server from that group. | | **Description** | Up to 300 characters. | | **Billed** | **Monthly**, **Every 3 months**, **Yearly** or **Free**. | | **Amount** and **Currency** | The price per billing period and a 3-letter currency code (default `USD`). Empty for no price. | | **Limits per customer** | See below. Leave a limit empty for unlimited. | | **Caps on each app** | See below. Leave a cap empty for no cap. | | **Offered for new accounts** | Inactive plans keep their customers but cannot be picked for new accounts or by billing systems. | ### Limits per customer | Limit | What it counts | | --- | --- | | **Websites** | Websites, not counting the website an app gets for its domains. | | **Subdomains** | Subdomains of the account's own domains, each served as its own site. | | **Apps** | Applications. | | **Databases** | MariaDB databases. | | **Database users** | MariaDB users. | | **Cron jobs** | Scheduled commands. | | **Disk space** | Website and app folders plus databases. Entered in GB in the form, stored in MB. | Counts go up to 10,000 and `0` is allowed. An app and its own website share one folder, which counts once, for the app. ### Caps on each app | Cap | Range | | --- | --- | | **Memory per app (MB)** | 64 to 262,144 | | **CPU per app (%)** | 10 to 6,400 (100% is one CPU core) | Caps become the CPU and memory limits of every app the plan's customers run. An app without a limit, or with one above the cap, gets the cap. Lowering a cap on an existing plan lowers the limits of the apps already there; the new limit shows as a change to apply and takes effect on the app's next deploy or **Apply changes**. ### Changing and deleting plans Changing a plan's limits applies to its customers right away. A plan cannot be deleted while any customer is on it, removed accounts included (`PLAN_IN_USE`). Move them to another plan, or turn off **Offered for new accounts** instead. ## Customers Open **Hosting > Customers** and click **New customer**: | Field | Description | | --- | --- | | **Name** | The customer's name. | | **Email** | They sign in with it. One account per email address across the panel. | | **Company** | Optional. | | **Plan** | Only plans offered for new accounts are listed. | | **Server** | A server, or **Choose for me**. | | **Billing id** | Optional. The id your billing system uses for this account: letters, digits and `. _ : -`, up to 100 characters, unique. | | **Notes** | Only your team sees these. Up to 1,000 characters. | With **Choose for me**, VaultPanel picks a server from the plan's server group (or any server): online servers first, then the one with the fewest customers. Creating an account fails with `NO_SERVER` when no connected server is available. The panel creates the customer's sign-in and shows an **invite link**. Send it to the customer: they choose their password with it, then sign in. The link works for 72 hours. Billing systems can set a password directly instead. ### What customers see Customers have the built-in `customer` role. They sign in at the same address as your team and see only their own account: - **My Hosting**: their plan, usage against each limit, their server's address (where to point their domains), their app ports and, when set up, the name servers to use. - **Websites**, **App Installer**, **Domains**, **Subdomains**, **SSL Certificates**, **Applications**, **Deployments**, **Databases**, **File Manager**, **Backups**, **Cron Jobs**, **Activity** and **API Tokens**. Anything that is not theirs reads as not found, so the ids of other accounts cannot be probed. Everything they create lands on their account's server. Customers cannot install software on a server or change server settings. ### Quotas Before anything new is created for an account, VaultPanel checks that the account is active and below its plan's limit for that kind of resource. Checks for one account run one at a time, so two requests cannot both take the last free slot. Creating a website, subdomain, app or database is also refused once the account uses all of its disk space. A refused create returns `409 QUOTA_REACHED` with the limit and the current count, for example: "The Starter plan allows 3 websites and this account has 3. Delete one or move to a bigger plan." Disk use of website and app folders is measured by the server's agent about every 15 minutes; databases count with their size. ### App ports Each customer has their own app ports on their server, picked from 10000 to 19999: one per app their plan allows (with no app limit, one more than the apps they have). Their apps can only listen on these ports, and no other app, staff's or another customer's, can take them. The ports are listed on the customer's page under **App ports** and on their **My Hosting** page. ### Changing a customer's plan On the customer's page, click **Change plan**. Limits apply right away; CPU and memory caps reach running apps on their next deploy or apply. Nothing is deleted when the account is over the smaller plan's limits: the customer's page shows **Over plan**, and new resources are refused until the account is back under its limits or moves to a bigger plan. ### Moving existing resources into an account **What the account owns** lists the account's websites, apps, databases and database users. Click **Add existing** to give the account a website, app, database or database user your team created; it then counts toward the plan. A resource that belongs to another customer must be taken from that account first. Moving an app moves its website with it, and the app's port becomes one of the account's ports. **Take back** returns a resource to your team: it keeps running where it is, but the customer no longer sees it and it stops counting toward their plan. The website that serves the panel itself on its domain can never belong to a customer. ## Suspending and removing accounts | Action | What happens | | --- | --- | | **Suspend** | The customer is signed out and cannot sign in. Their websites are turned off, apps stopped and cron jobs paused. Nothing is deleted. An optional reason is shown to your team only. | | **Unsuspend** | Turns back on exactly what suspending turned off, and lets the customer sign in again. | | **Remove account** | Deletes every cron job, app, website, database and database user the account owns, with their files, data and backups, and the DNS zones added for it. The sign-in is closed. It cannot be undone. | You confirm **Remove account** by typing the customer's email. A removed account stays in the list (filter by status **Removed**) for your history; only its notes can change. If something could not be deleted the first time, for example because it was busy with another change, **Retry deletion** runs the removal again for what is left. Suspending again likewise catches what was busy the first time. **Password reset link** creates a link the customer uses to choose a new password. It works for 2 hours. ## Name servers for customers On the **DNS Zones** page, each server can tell its customers which name servers to set at their registrar, and add a DNS zone on the server for each new domain a customer gives a website. Customers then see those name servers and their zones on **My Hosting**. See [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones). ## Permissions | Permission | Allows | | --- | --- | | `customers.read` | View customers, plans and the financial report. | | `customers.manage` | Create, change, suspend, unsuspend and remove customers. | | `plans.manage` | Create, change and delete plans. | | `billing.manage` | Create and revoke billing API keys. | See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles) and the [hosting API](https://docs.vaultpanel.net/api-reference/hosting). --- # Billing API URL: https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api > Connect WHMCS, Blesta or your own billing system to VaultPanel with a vpk_ API key that creates, suspends, upgrades and removes hosting accounts. The billing API lets a billing system manage [hosting accounts](https://docs.vaultpanel.net/guides/hosting-and-billing): create one when an order is paid, suspend it when an invoice is overdue, change its plan on an upgrade and remove it when the service is cancelled. It lives under `/api/v1/billing` and authenticates with an **API key** that belongs to the panel rather than to a person. This page explains how keys work and how the account lifecycle maps to API calls. Every endpoint, with its fields and responses, is in the [billing API reference](https://docs.vaultpanel.net/api-reference/billing). For WHMCS, the included [module](https://docs.vaultpanel.net/guides/hosting-and-billing/whmcs) makes these calls for you. ## API keys Billing API keys start with `vpk_` and are different from the personal `vpt_` [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens) people use for scripts: | | Billing API key (`vpk_`) | API token (`vpt_`) | | --- | --- | --- | | Belongs to | The panel | The person who created it | | Reaches | `/api/v1/billing` only | The REST API, as its owner | | Can do | List plans, and create, suspend, unsuspend, change the plan of and remove customer accounts | What its scopes and its owner's permissions allow | | Managed under | **Hosting > Billing API** | **Users & Access > API Tokens** | A key has one scope, **Billing**, which grants exactly `customers.read` and `customers.manage`, whoever created it. A panel can have up to 50 active keys. ### Create a key ### Open the Billing API page In the panel, open **Hosting > Billing API** and click **New API key**. You need the `billing.manage` permission. ### Name it after the system that uses it For example `WHMCS`, so you know what breaks if you revoke it. ### Copy the key The key is shown once. Only a fingerprint of it (its SHA-256) is stored, so it cannot be shown again; make a new one if it is lost. Paste it into your billing system's VaultPanel settings. ### Revoke or rotate a key Click **Revoke key** next to a key on the **Billing API** page. A revoked key stops working at once and stays in the list for your records. To rotate, create a new key, put it in your billing system, then revoke the old one. The list shows when and from which address each key was last used. ## Calling the API Send the key as a Bearer token. No cookie or CSRF token is involved. ```bash curl -X POST https://panel.example.com/api/v1/billing/accounts \ -H "Authorization: Bearer $VAULTPANEL_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"Ada Lovelace","email":"ada@example.com","plan":"Starter","externalId":"whmcs-1042"}' ``` - Replies use the panel's usual envelope, `{ success, data, message, requestId }`, and errors carry a `code` such as `QUOTA_REACHED`. See [API overview](https://docs.vaultpanel.net/api-reference). - The billing API allows 120 requests a minute per address. - Use an address with a certificate your billing system trusts, such as a [panel domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain), so the key is never sent in the clear. > **Warning:** A billing key can set any customer's password and create sign-in links for them. Store it like a password, and revoke it when the billing system no longer needs it. ## Account references Endpoints that act on one account take `{ref}`: the account's VaultPanel id, or the **billing id** (`externalId`) your billing system gave it when it created the account. Giving every account an `externalId` lets the billing system find it again with its own service id. A plan can be given by its id or its exact name. ## The account lifecycle | Billing event | Call | Result | | --- | --- | --- | | Order paid | `POST /billing/accounts` | Creates the account on the plan, with a sign-in for the customer's email. | | Invoice overdue | `POST /billing/accounts/{ref}/suspend` | Signs the customer out and blocks sign-in, turns websites off, stops apps and pauses cron jobs. Optional `reason`. | | Invoice paid | `POST /billing/accounts/{ref}/unsuspend` | Turns back on exactly what suspending turned off. | | Upgrade or downgrade | `POST /billing/accounts/{ref}/plan` | Moves the account to the new plan. | | Password change | `POST /billing/accounts/{ref}/password` | Sets the password and signs the customer out elsewhere; without a password, returns a reset link. | | "Log in" button | `POST /billing/accounts/{ref}/login` | A sign-in link that works once, for two minutes. | | Usage sync | `GET /billing/accounts` | Every account with its usage and limits, a page at a time. | | Cancellation | `DELETE /billing/accounts/{ref}` | Removes the account and deletes everything it owns. | ### Creating accounts safely - **Retries never create two accounts.** Creating an account with an `externalId` that already exists returns `409 EXTERNAL_ID_TAKEN` with the existing account's id in `details.customerId`. Treat it as success after checking that account is not removed. - **One account per email.** An email address that already has an account is refused as a validation error on `email`. - **Passwords are optional.** With a `password`, the customer can sign in right away. Without one, the reply has a one-time `inviteUrl` (valid 72 hours) for the customer to choose a password. - **Servers are picked for you.** Without `serverId`, VaultPanel places the account on a server from the plan's server group (or any server): online servers first, then the one with the fewest customers. Only plans offered for new accounts can be used. ### Plan changes Moving to a smaller plan never deletes anything. The reply lists the limits the account is now over in `over`; new resources are refused with `409 QUOTA_REACHED` until the account is back under its limits. Lower CPU and memory caps reach running apps on their next deploy. ### Single sign-on `POST /billing/accounts/{ref}/login` returns `{ url, expiresAt }`, a link to the panel's `/sso` page that signs the customer in once within two minutes. It skips the customer's two-factor code, like the password the billing key can already set. Suspended accounts get `409 ACCOUNT_SUSPENDED` instead. Invite and password-reset pages never accept a sign-in link's token. ### Suspend, unsuspend and remove These calls return the account and a list of `warnings` for anything that could not be changed, for example a resource busy with another change. Calling suspend or remove again retries what was left. Removal also deletes the account's backups and backup schedules and closes its sign-in; the account record stays, with status `terminated`. ## Audit trail Every billing API call is recorded in the [audit log](https://docs.vaultpanel.net/guides/security/audit-log) with the API key as the actor. Accounts the API created show **Billing API** as **Added by** on the customer's page. --- # WHMCS module URL: https://docs.vaultpanel.net/guides/hosting-and-billing/whmcs > Install the VaultPanel provisioning module for WHMCS to create, suspend, upgrade and remove hosting accounts, with single sign-on and disk usage. The VaultPanel module for WHMCS sells VaultPanel hosting from WHMCS. Each WHMCS service is one VaultPanel [hosting account](https://docs.vaultpanel.net/guides/hosting-and-billing): WHMCS creates it when an order is paid, suspends and unsuspends it with the invoices, changes its plan on upgrades, sets its password, removes it on termination, signs the customer in with **Log in to VaultPanel**, and shows its disk usage. The module works through the [billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api). It is MIT licensed. ## Requirements - WHMCS 8, on PHP 7.4 or newer with the curl extension. - A VaultPanel address with a certificate WHMCS trusts. Set a panel domain under **System > Panel Domain** (for example `cp.example.com`); the self-signed certificate of the panel's own port is refused. See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). - At least one hosting plan, created under **Hosting > Hosting Plans**. ## Install ### Download the module Download [vaultpanel-whmcs.zip](https://installer.vaultpanel.net/downloads/vaultpanel-whmcs.zip) and check it against the published [SHA256SUMS](https://installer.vaultpanel.net/downloads/SHA256SUMS): ```bash curl -sSO https://installer.vaultpanel.net/downloads/vaultpanel-whmcs.zip curl -sSO https://installer.vaultpanel.net/downloads/SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS ``` Unzip it and copy its `modules/servers/vaultpanel` folder into your WHMCS folder, so the module is at `modules/servers/vaultpanel/vaultpanel.php` inside WHMCS. ### Create a billing API key In VaultPanel, open **Hosting > Billing API**, click **New API key**, name it `WHMCS` and copy the key. It starts with `vpk_` and is shown once. ### Add the server in WHMCS In WHMCS, open **System Settings > Servers > Add New Server**: | Field | Value | | --- | --- | | **Hostname** | The panel domain, such as `cp.example.com`. | | **Module** | VaultPanel | | **Password** (or **Access Hash**) | The `vpk_` API key. | | **Secure** | Ticked. Leave the port empty for 443. | Click **Test Connection**, which lists the panel's plans with the key. Save, and put the server in a server group. ### Create a product Open **System Settings > Products/Services** and create a product of type **Hosting Account**. On **Module Settings**: | Setting | Value | | --- | --- | | **Module Name** | VaultPanel, with the server group from the previous step. | | **Plan** | The VaultPanel hosting plan of this product. The list comes from your panel. | | **Server ID** | Optional: the id of the VaultPanel server new accounts go on. Empty lets VaultPanel choose (the plan's server group, then the least busy server). | Choose **Automatically setup the product as soon as the first payment is received**. ## What it does | WHMCS | VaultPanel | | --- | --- | | **Create** | A hosting account on the product's plan with billing id `whmcs-`, named after the client, with the client's email. The service password is used when it has at least 12 characters; otherwise the customer signs in from WHMCS, or sets one with VaultPanel's invite. The service's username becomes the email the customer signs in with. Running Create again for the same service is safe. | | **Suspend** / **Unsuspend** | Turns the account's websites off, stops its apps and pauses its cron jobs, with the suspension reason; and back on. | | **Terminate** | Removes the account and everything it owns: websites, apps, databases and their files and backups. Running it again finishes what was left. | | **Change Package** | Moves the account to the new product's plan. Nothing is deleted when it is over the smaller plan's limits; new resources are refused. | | **Change Password** | Sets the VaultPanel password (at least 12 characters) and signs the customer out elsewhere. | | **Log in to VaultPanel** | A sign-in link that works once, for two minutes. It skips the customer's two-factor code, like the password the billing system can set. Suspended accounts get none. | | **Usage update** (WHMCS cron) | Disk usage and limit in MB for every service on the server (0 means no limit). VaultPanel does not count bandwidth. | | **Client area** | Status, plan, server, usage against the plan's limits, and the sign-in button. | | **Admin service tab** | The VaultPanel account id (linking to it in VaultPanel), status, plan, server and usage. | Every call is recorded in VaultPanel's [audit log](https://docs.vaultpanel.net/guides/security/audit-log) as the API key, and in WHMCS's module log (**System Logs > Module Log**) with the key and passwords hidden. ## Limits - VaultPanel has one hosting account per email address, so a client can have one VaultPanel service. A second service for the same client fails with that reason. - No domain is set up on order: the customer adds websites in VaultPanel. - Moving a service to another server in WHMCS does not move the account between VaultPanel servers. - If a service's VaultPanel account was removed, Create does not bring it back: create a new service for a new account. ## Troubleshooting | Message | Fix | | --- | --- | | Paste a VaultPanel billing API key (it starts with vpk_) into this server's Password or Access Hash. | The server's **Password** or **Access Hash** does not hold a `vpk_` key. Create one under **Hosting > Billing API**. | | VaultPanel offers no hosting plans yet. | Create a plan under **Hosting > Hosting Plans**, and make sure **Offered for new accounts** is on. | | Choose the VaultPanel plan in the product's Module Settings first. | Pick a **Plan** on the product's **Module Settings** tab. | | VaultPanel already has an account for … (the client's email) | The client already has a VaultPanel service, or a staff user or another customer signs in with that email. | | Certificate or connection errors on **Test Connection** | WHMCS must reach the panel over HTTPS with a trusted certificate: use the panel domain, not the IP address and port 8090. | --- # Financial report URL: https://docs.vaultpanel.net/guides/hosting-and-billing/financial-report > See what your hosting accounts are worth at their plans' prices, per plan and month by month, and export the figures as CSV. The financial report shows what your hosting accounts are worth at their plans' prices, and how the accounts changed month by month. Open it under **Hosting > Financial Report**. You need the `customers.read` permission. > **Important:** These are expected amounts from plan prices, not payments received. VaultPanel does not take payments: your billing system invoices and charges customers, so its own reports show what was actually paid. ## Choosing the period Pick **Last 3**, **6**, **12**, **24** or **36 months** at the top of the page (12 by default). The period starts on the first day of the oldest month, in UTC, and ends now. ## Summary | Figure | How it is computed | | --- | --- | | **Expected each month** | For each plan, its monthly price times its active accounts, added up. The caption counts the paying accounts: active accounts on plans with a price above zero. | | **Expected each year** | Expected each month times 12, at today's accounts and prices. | | **On hold (suspended)** | The monthly price of every suspended account, added up. | | **Accounts** | Accounts added and removed during the period, and how many are active now. | A plan's **monthly price** spreads its price over a month: a quarterly price is divided by 3 and a yearly one by 12. Free plans count as 0. Plans without a price are left out of every amount, and the page warns how many active accounts are on such plans. Totals are kept per currency and never converted. When plans use more than one currency, the page lists each currency's monthly total. ## By plan One row per plan with its billing cycle and price, its active and suspended accounts today, what it is expected to bring in each month (monthly price times active accounts) and the amount on hold (monthly price times suspended accounts). Plans not offered for new accounts are marked **Not offered**, and plans without a price **No price**. ## Month by month One row per month of the period: | Column | Meaning | | --- | --- | | **New accounts** | Accounts created in that month. | | **Removed accounts** | Accounts removed in that month. | | **Suspensions** | Successful suspensions recorded in the audit log in that month. | | **Accounts at month end** | Accounts open at the end of the month, suspended ones included. For the current month, accounts open now. | | **Expected per month** | Those accounts priced at their plans' monthly prices, per currency. | Plan changes are not kept per month, so past months use each account's **current** plan. ## Export **Download CSV** saves the report as `vaultpanel-financial-report-.csv` with the by-plan table and the month-by-month table, amounts in the currency's major unit (for example `9.99`). ## Through the API `GET /api/v1/hosting/reports/financial?months=12` returns the same report as JSON, with amounts in cents. See the [hosting API reference](https://docs.vaultpanel.net/api-reference/hosting). --- # AI Assistant URL: https://docs.vaultpanel.net/guides/ai-assistant > Ask VaultPanel's AI assistant why something is not working. It reads status and logs with your permissions and proposes fixes that run only when you approve them. The AI assistant answers questions about your servers, websites and apps. It checks status, logs, ports and recent jobs through the panel, explains what it finds, and proposes fixes as cards you approve or cancel. It never changes anything on its own. It answers with Claude by default, with any OpenAI-compatible service, or with a free model installed on the panel's own server. An owner or admin chooses the provider and turns the assistant on under **System > Assistant Settings**; see [AI providers](https://docs.vaultpanel.net/guides/ai-assistant/providers). ![The Assistant page before it is set up, saying The assistant is not turned on and asking you to choose an AI provider and enter its API key, with a Set up the assistant button](https://docs.vaultpanel.net/screenshots/assistant-light.png) ## Asking a question Open **AI Assistant** in the sidebar and type a question, for example "Why does shop.example.com show a 502?". Press Enter to send, Shift+Enter for a new line. While it works, the assistant shows what it is checking ("Reading the nginx log", "Checking php8.3-fpm"). It leads with the cause, quotes the log lines that matter, then says what to do. Follow-up questions in the same conversation keep the earlier context. Conversations are private: only the person who asked sees them. Each person can ask up to 60 questions an hour. ### From any page You don't have to leave the page you are on. The round **AI Assistant** button at the bottom right of the panel opens the assistant in a panel at the side. It is there on every page for everyone with `assistant.use`, except on the Assistant page and its settings. - Ask, follow the answer and approve or cancel proposed actions there, as on the Assistant page. - A new conversation started there says which panel page it was asked from, such as `/websites/…`, so the assistant knows what you were looking at. - The panel keeps its conversation while you move between pages in the same browser tab. **New** starts another conversation. - **Open full page** (the arrow) continues the conversation on the full Assistant page. - **Close**, Esc or a click outside the panel closes it. Conversations started from the side panel are ordinary conversations: they appear on the Assistant page too. ## What it can read The assistant has a fixed set of tools. Each one runs through the panel's normal services **as the person who asked**, with their permissions, so it can never see more than they can. | Tool | What it reads | | --- | --- | | `list_servers`, `get_server` | Servers, their status, CPU, memory, disk, load, services, installed web software and open alerts. | | `find` | Websites, domains, apps and databases by name or domain. | | `get_website` | A website's type, domains, health check, SSL certificate and expiry, the app it serves and recent jobs. | | `get_application`, `get_deployment` | An app's process state, port, start command, release, last error and deployments. Environment variable values are never shown. | | `read_website_log` | The last lines of a website's NGINX access or error log. | | `read_application_log` | The last lines of an app's output or error log. | | `check_service`, `read_service_log` | A systemd service's state and its journal. | | `read_system_log` | The server's journal, kernel messages, sign-ins or cron, filtered by priority, text and time. | | `list_processes`, `list_listening_ports` | Top processes by CPU or memory, and which programs listen on which TCP ports. | | `list_alerts`, `list_recent_jobs`, `get_job` | Open alerts and recent operations with their results and logs. | | `list_databases` | MariaDB databases with their size and the app they belong to. | Log and status reads on a server run as ordinary routine jobs and wait up to a minute for the agent. A log read returns up to 400 lines (150 by default), and each tool result is cut at 12,000 characters. > **Warning:** Your question and the status and log lines the assistant reads are sent to the AI service you choose. With the [free model on this server](https://docs.vaultpanel.net/guides/ai-assistant/local-model), all of it stays on the panel's server. The assistant is told to treat logs and command output as data, never as instructions, and to write `[hidden]` instead of repeating passwords, keys or tokens it sees. ## Proposed actions When a change would fix the problem, the assistant proposes it. You see a **Proposed action** card with what it will do and why, and choose **Approve and run** or **Cancel**. Only these changes can be proposed: | Action | Needs | | --- | --- | | Restart app, Start app, Stop app, Deploy app again, Roll back app | `applications.deploy` | | Apply saved settings and restart app | `applications.manage` | | Restart service, Start service | `servers.services` | | Turn website on, Retry website setup, Renew SSL certificate | `websites.manage` | | Install server software | `websites.manage` | An approved action runs **as the person who approves it**, through the same operation as the matching button elsewhere in the panel, and is recorded in the job history and the audit log. The card shows its progress until the job finishes. A card without the permission shows what it needs instead. - A proposal can be approved for 60 minutes. After that it expires, because what it was based on may have changed; ask the assistant to check again. - The assistant proposes at most 3 actions per answer. - For fixes the panel has no action for, such as editing code or changing DNS at a registrar, it explains the steps and where to make them. ## How an answer is produced Asking a question saves it and queues the conversation for the panel's **worker**, which answers it: ### The model is called The provider gets a fixed system prompt, the tool definitions and the conversation so far. Each new question carries a short context note: the time, who is asking and their roles, and the outcome of actions proposed earlier in the conversation. ### Tools run When the model asks for tools, each call runs through the panel's services as the person who asked, and the results go back to the model. ### Repeat or answer This repeats for at most 12 rounds. When the model answers without asking for a tool, the answer is shown. After 12 rounds without an answer, the assistant says so; ask it to continue or narrow the question. Every model reply, tool call and result is stored in order, and earlier turns are sent back exactly as stored. In long conversations, the oldest questions are dropped from what is sent, a whole question at a time. > **Important:** The worker must be running, or questions are never answered. An answer still "thinking" after 10 minutes is marked failed with `ASSISTANT_TIMEOUT` (30 minutes with the free model on this server). A failed answer can be retried. ## Who can use it Using the assistant needs the `assistant.use` permission, which the built-in **admin**, **developer** and **viewer** roles have (owners have every permission). Hosting customers cannot use it. Configuring it needs `settings.manage`. ## Audit log | Event | Recorded when | | --- | --- | | `assistant.conversation_start`, `assistant.conversation_delete` | A conversation is started or deleted. | | `assistant.action_propose` | The assistant proposes an action. | | `assistant.action_approve` | Someone approves a proposal (with `failure` when it could not start). | | `assistant.action_cancel` | Someone cancels a proposal. | | `assistant.settings_update` | The provider settings change. API keys are logged only as changed or removed. | Jobs the assistant's tools start, such as log reads, are recorded with the actor shown as `email (assistant)`. Approved actions are recorded as the person who approved them. ## API The assistant is also available through the REST API under `/api/v1/assistant`. See the [assistant API reference](https://docs.vaultpanel.net/api-reference/assistant). --- # AI providers URL: https://docs.vaultpanel.net/guides/ai-assistant/providers > Choose which AI service answers in VaultPanel's assistant — Claude, an OpenAI-compatible API such as Ollama or vLLM, or a free model on the panel's server. The assistant needs an AI provider to write its answers. Choose one under **System > Assistant Settings** (the `settings.manage` permission, which owners and admins have). People with the assistant permission can then use it. | Provider | API key | Where your data goes | | --- | --- | --- | | **Claude (Anthropic)** | Required | The Anthropic API | | **OpenAI-compatible** | Optional | OpenAI, or the service at the address you enter | | **Free model on this server** | None | Nowhere: the model runs on the panel's own server | ## Set up a provider ### Choose the provider Open **System > Assistant Settings** and pick a provider under **AI provider**. The one in use is marked **In use**; a provider with a saved key shows **Key saved**. ### Fill in its settings The model, address and key, as described for each provider below. ### Test it **Test connection** sends a tiny request with the settings in the form (saved or not) and shows which model replied and how long it took. ### Turn the assistant on Tick **Turn the assistant on** and click **Save settings** (or **Save and use** the provider when switching). It cannot be turned on while a required setting is missing. When off, nobody can ask questions; past conversations stay readable. ## Claude (Anthropic) The default and the most capable choice. It needs an API key from [console.anthropic.com](https://console.anthropic.com). | Setting | Description | | --- | --- | | **Model** | **Claude Opus 5.5 (recommended)** (`claude-opus-5-5`), **Claude Sonnet 5.5 (faster, lower cost)** (`claude-sonnet-5-5`) or **Claude Haiku 4.5 (fastest, lowest cost)** (`claude-haiku-4-5`). **Another model…** lets you type any model id. | | **API address (optional)** | Leave empty for `https://api.anthropic.com`. | | **API key** | Required. | Opus answers hard questions best; Sonnet and Haiku are faster and cost less. Requests time out after 2 minutes and are retried twice on network errors. ## OpenAI-compatible OpenAI, or any service with an OpenAI-compatible chat API, such as Ollama or vLLM on your own server. The model must support tool (function) calling: the assistant works entirely through tools. | Setting | Description | | --- | --- | | **Model** | The exact model name your service uses. | | **API address** | Leave empty for `https://api.openai.com/v1`. For your own Ollama elsewhere, its address ending in `/v1`. The panel calls `/chat/completions` under it. | | **API key** | Optional; sent when set. | ## Free model on this server A small open model that the panel installs on its own server with Ollama. It needs no API key and nothing leaves the server; answers are slower and simpler than Claude's. Install a model on the same page first, then choose it as the **Model**. See [Free model on this server](https://docs.vaultpanel.net/guides/ai-assistant/local-model). ## Switching providers Each provider keeps its own settings (since VaultPanel 0.3.0). Switching between Claude, an OpenAI-compatible service and the free model keeps each one's model, address and API key, so switching back needs nothing again. ## API keys - API keys are encrypted in the panel's database with a key derived from `VAULTPANEL_SECRET_KEY`, and never shown again: the form shows only their last four characters. - Leave **API key** empty to keep the saved key, or tick **Remove the saved key** to delete it. - The audit log records only that a key was changed or removed, never the key. > **Note:** If `VAULTPANEL_SECRET_KEY` changes, stored API keys can no longer be decrypted. Enter them again. ## API The same settings are available through `GET` and `PUT /api/v1/assistant/settings` and `POST /api/v1/assistant/settings/test`. See the [assistant API reference](https://docs.vaultpanel.net/api-reference/assistant). --- # Free model on this server URL: https://docs.vaultpanel.net/guides/ai-assistant/local-model > Run the AI assistant on a free open model installed on the panel's own server with Ollama — no API key, nothing leaves the server, reachable only by the panel. The assistant can answer with a small open model that runs on the panel's own server. It needs no API key and nothing leaves the server. Answers are slower and simpler than Claude's: fine for checking status and logs, weaker at harder problems. This needs VaultPanel 0.3.0 and agent 0.41.0 or newer on the panel's own server (**This server**), which must be online. ## Install a model ### Open the provider settings Open **System > Assistant Settings** and choose **Free model on this server**. Under **Models on this server**, the page shows the server's free memory and disk space. ### Pick a model and click Install The model marked **Suggested for this server** is the largest one that leaves about 1.25 GB of memory for the rest of the server. Models the server cannot hold are disabled. The first install also downloads Ollama itself (about 1.6 GB, checked against its known SHA-256), so it takes a few minutes more. The progress shows in a drawer as the job runs. ### Choose it and turn the assistant on Select the installed model as the **Model**, tick **Turn the assistant on** and save. ## Models All models are free to use commercially (Apache 2.0) and can call tools. | Model | Id | Download | Memory | Notes | | --- | --- | --- | --- | --- | | Qwen3.5 2B | `qwen3.5:2b-q4_K_M` | 1.8 GB | 2.5 GB | The smallest and fastest. Simple answers; for servers with 4 GB of memory. | | IBM Granite 4.1 3B | `granite4.1:3b` | 2.0 GB | 3.5 GB | Good at using the panel's tools for its size. Text only. | | Qwen3.5 4B | `qwen3.5:4b` | 3.1 GB | 4.5 GB | Better answers, a little slower. For servers with 8 GB of memory. | | Qwen3.5 9B | `qwen3.5:9b` | 6.1 GB | 8 GB | The best answers here, but slow without a strong CPU. For servers with 16 GB of memory. Never suggested automatically. | Memory is about what the model needs loaded with its context. Installing needs free disk space for the model plus 1 GB to spare, and about 2 GB more the first time for Ollama. Qwen3.5 4B and 9B reason before answering by default; the panel turns that off, because on a CPU it would take minutes per step. ## What gets installed | What | Where | | --- | --- | | Ollama (the CPU build of the release the agent carries) | `/opt/vaultpanel-ai` (`bin/ollama`, `VERSION`) | | Models | `/var/lib/vaultpanel-ai/models`, owned by the `vaultpanel-ai` system account | | The service | `vaultpanel-ai.service`: `ollama serve` as `vaultpanel-ai`, on `127.0.0.1:21434` only | | The firewall rule | `/opt/vaultpanel-ai/guard`, run as root as the service starts and after it stops | The service runs one model and one answer at a time, with an 8,192-token context, at a lower CPU priority than websites, with a read-only system except its data folder and Ollama's cloud features off. Its memory is limited to the server's memory less 1 GB, so a model too big for the server stops itself rather than the panel's database, and it is the first process the kernel stops when the whole server runs out. ## Isolation Ollama has no password, so anything on the server could otherwise use it, including websites' and apps' code. The guard loads an nftables table of its own, `inet vaultpanel_ai`, whose rule resets every connection to port 21434 except from root (the agent) and the panel's own account. - Being its own table, the rule stays when UFW is turned on or off, when Docker rewrites its rules and when iptables chains are flushed. - The service does not start if the rule cannot be loaded, so Ollama never listens without it. `nftables` is installed first when `nft` is missing. - Port 21434 is outside the app ports hosting customers get (10000 to 19999), and the panel refuses it for containers on its own server. ## Remove models or Ollama - **Remove** next to an installed model deletes it and frees its disk space. The model the assistant answers with cannot be removed; choose another first. - **Remove Ollama and all models** deletes Ollama, its service and every model. It cannot be used while the assistant answers with a model on this server, and the page says so: choose another provider above (or turn the assistant off) and save first. Afterwards the agent checks that the service, the program and the models are really gone. If something is left (a folder it could not delete, for example), the job fails and names what is left, instead of reporting success (agent 0.50.2 or later). You can install them again later. ## Troubleshooting | Message | What to do | | --- | --- | | The panel's own server is not connected to the panel | The model can only be installed on the server the panel runs on, connected as **This server**. | | The agent on the panel's own server cannot install the model yet | Update the agent from the server's **Overview** tab. | | Ollama is installed but does not answer | It may still be starting; installing a model again restarts it. Check `journalctl -u vaultpanel-ai` on the server. | | No answer after 30 minutes (`ASSISTANT_TIMEOUT`) | The worker may not be running, or the model is too slow for the server. A smaller model answers faster. | | The model on this server did not answer within 10 minutes | One request took too long. Choose a smaller model, or free memory on the server. | --- # Developer overview URL: https://docs.vaultpanel.net/developers > Build on VaultPanel with its REST API, JavaScript SDK, command-line tool and plugins, and learn how the panel, worker and server agent fit together. VaultPanel is built to be automated and extended. Everything the web interface does goes through the same REST API, permission checks, job queue and audit log that scripts, the command-line tool, billing systems and plugins use. There is no back door: no endpoint runs arbitrary commands, on the panel or on a server. ## Ways to integrate | You want to | Use | | --- | --- | | Script the panel from CI, cron or your own tools | An [API token](https://docs.vaultpanel.net/api-reference/api-tokens) with the [REST API](https://docs.vaultpanel.net/api-reference), the [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk) or the [CLI](https://docs.vaultpanel.net/cli). | | Manage hosting accounts from a billing system | A billing key with the [billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api), or the [WHMCS module](https://docs.vaultpanel.net/guides/hosting-and-billing/whmcs). | | Add a feature or connect an outside service | A [plugin](https://docs.vaultpanel.net/developers/plugins): its own token, signed events and a page inside the panel. | | React to deployments, backups and alerts | [Webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks), or plugin events. | | Deploy on every Git push | [Push-to-deploy](https://docs.vaultpanel.net/guides/applications/deployments) with a signed webhook from your Git host. | - [REST API](https://docs.vaultpanel.net/api-reference) - [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk) - [CLI](https://docs.vaultpanel.net/cli) - [Plugins](https://docs.vaultpanel.net/developers/plugins) - [Architecture](https://docs.vaultpanel.net/developers/architecture) - [Server agent](https://docs.vaultpanel.net/developers/agent) ## How the parts fit ```text Browser, CLI, SDK, plugins, billing systems │ HTTPS: session cookie + CSRF token, or a Bearer token (vpt_, vpp_, vpk_) ▼ Express API ──── MariaDB (users, servers, jobs, audit log…) │ └─── Redis (agent nonces, locks, BullMQ) │ ▲ │ HTTPS, Ed25519-signed │ ▼ │ Agent on each server Worker (maintenance every 15 s, fixed operations, no shell the AI assistant's answers) ``` Read [Architecture](https://docs.vaultpanel.net/developers/architecture) for the layers, the job lifecycle and the background work. ## Building VaultPanel itself The panel is JavaScript: a React and Vite interface, and an Express API with MariaDB through Knex and Redis with BullMQ. The server agent is one program written in Rust. See [Development](https://docs.vaultpanel.net/developers/development) for the local setup and checks, and [Database schema](https://docs.vaultpanel.net/developers/database-schema) for the tables. ## Credentials at a glance | Prefix | Credential | Belongs to | Reaches | | --- | --- | --- | --- | | `vpt_` | API token | A person, narrowed to its scopes | The REST API | | `vpp_` | Plugin token | A plugin, narrowed to its approved scopes | The REST API | | `vpk_` | Billing API key | The panel | `/api/v1/billing` only | | `vpe_` | Enrollment token | One server, once, for 60 minutes by default | Agent registration | | `whsec_` | Plugin signing secret | A plugin | Verifying events and page links | The panel keeps only a SHA-256 of tokens and keys, and the plugin signing secret encrypted, so all of them are shown once. --- # Architecture URL: https://docs.vaultpanel.net/developers/architecture > How VaultPanel's control plane, background worker and server agents fit together, from an API request through the job queue to a command on a server. VaultPanel follows a **control plane and agent** model. The panel (an Express API, a background worker, MariaDB and Redis) holds every record and decides what may happen. A small agent on each server carries out a fixed list of operations that the panel signs. Agents connect out to the panel, so servers need no inbound port. ```text Browser ── React UI (frontend/) │ HTTPS (self-signed on the panel port, or a panel domain), │ session cookie + CSRF token ▼ Express API (backend/src/server.js, as the vaultpanel user) ─── MariaDB (users, servers, jobs, audit log…) │ └── Redis (agent nonces, locks, BullMQ) │ HTTPS, Ed25519-signed requests ▲ ▼ │ Agent on each server (agent/) Worker (backend/src/worker.js) │ fixed commands, no shell maintenance every 15 s ▼ systemd, ps, /proc … ``` ## Components | Component | Path | Role | | --- | --- | --- | | Web interface | `frontend/` | React, Vite and Tailwind. Pages in `src/pages`, a small design system in `src/components/ui`. | | API | `backend/src/server.js` | Express. Routes, validation, authentication, services, the agent endpoints. | | Worker | `backend/src/worker.js` | BullMQ. The maintenance pass and the AI assistant's answers. | | Shared package | `shared/` | Permissions, roles, the operation catalog and validation rules, used by the API and the interface. | | Agent | `agent/` | Rust, one static program for x86-64 and arm64. Heartbeats, jobs, the terminal channel. Versioned on its own (`agent/Cargo.toml`). | | SDK and CLI | `sdk/`, `cli/` | `@vaultpanel/sdk` and the `vaultpanel` command, built on the SDK. | | Migrations | `database/migrations/` | Knex migrations. | ## The panel on its server On a server installed with the [installer](https://docs.vaultpanel.net/getting-started/installation), the API and the worker run as the unprivileged `vaultpanel` user in a systemd sandbox. Only `backend/src/cli/connectLocal.js`, which connects the panel's own server before the API starts, runs as root. - The API serves HTTPS on `VAULTPANEL_PORT` with the certificate in `VAULTPANEL_TLS_CERT` (the installer makes a self-signed one), and plain HTTP on `127.0.0.1:VAULTPANEL_LOOPBACK_PORT` for callers on the same machine: the local agent, the panel domain's NGINX and the `vaultpanel` command. - Agent install commands carry the certificate's public key pin while the panel's address is served by it, so servers can be added safely without a domain. - The panel's files are in `/var/lib/vaultpanel/panel`; `/var/lib/vaultpanel` itself belongs to the agent. - With `VAULTPANEL_UI_DIR` set, the API also serves the built interface, so one port is the whole panel. ## Backend layers Requests flow through the same layers whoever makes them: ```text routes → middleware (request id, rate limits, auth, CSRF, panel access, tenancy, validation) → controllers → services → database ``` - **Controllers** are thin: they read validated input, call one service and send the response. - **Services** (`backend/src/services`) hold all business rules, authorization and audit logging. They take an **actor** (a signed-in user, an API token, a plugin, a billing key, an agent or the system) instead of an HTTP request, so the same code serves the interface, the CLI, automation and the AI assistant. - **Authorization** happens in one place, `services/authorization.js`, which checks a permission and records denials in the audit log. - **Tenancy**: a hosting customer's actor carries its customer id, and every query is limited to that account's records. Anything else reads as not found. ### Authentication order 1. `/api/v1/agent` authenticates by agent signature, `/api/v1/hooks` by the token in the URL and `/api/v1/billing` by a `vpk_` key. 2. Everything else first resolves a Bearer token (`vpt_` API token or `vpp_` plugin token), which skips the cookie and CSRF checks, then the `vp_session` cookie with its CSRF token. 3. Panel access by IP address applies, then `/auth`, then the two-factor policy, then the customer areas, then the resource routes. ### Response envelope Every response has the same shape, and the request id is also in the `X-Request-Id` header: ```json { "success": true, "data": {}, "message": "OK", "requestId": "…" } ``` ```json { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "…", "details": [{ "field": "email", "message": "…" }] }, "requestId": "…" } ``` Errors carry a stable `code` such as `NOT_FOUND`, `QUOTA_REACHED` or `AGENT_OUTDATED`. See [API overview](https://docs.vaultpanel.net/api-reference). ### Rate limits | Limit | Window | Requests | | --- | --- | --- | | API (per address) | 1 minute | 600 | | Sign-in | 15 minutes | 20 | | First-run setup | 15 minutes | 10 | | Password reset | 15 minutes | 20 | | Agent registration | 1 hour | 30 | | Agent install script and package downloads | 1 minute | 60 | | Git push webhooks | 1 minute | 30 | | Billing API | 1 minute | 120 | ## Servers, agents and jobs ### Enrollment An admin adds a server. The panel creates a one-time enrollment token (stored hashed, valid 60 minutes by default) and an install command. ### Registration The install script downloads the agent from the panel, and `vaultpanel-agent register` generates an Ed25519 key pair, sends the public key with the token, and receives its agent id and the panel's job-signing public key, which it pins. ### Signed requests Every later agent request is signed over the method, path, timestamp, nonce and body hash. The panel checks the signature, a 5-minute clock window and that the nonce was not used before. ### Heartbeat and polling The agent sends a heartbeat every 15 seconds (system information, metrics, service states, the operations it supports) and long-polls `GET /api/v1/agent/jobs/next` for work. A server silent for 90 seconds (`VAULTPANEL_AGENT_OFFLINE_SECONDS`) is marked offline. ### Queuing an operation A user, script or service queues an operation. The panel checks that it is in the catalog, the caller's permission, the parameters and that the agent supports it (`AGENT_OUTDATED` otherwise), and refuses a duplicate of an active job. ### Running it When the agent claims the job, the panel sends a signed envelope. The agent verifies the signature, the server id and the expiry, checks the parameters against its own allow-list and local policy, runs fixed commands without a shell, streams log lines and reports the result. ### Job states | State | Meaning | | --- | --- | | `queued` | Waiting for the agent to pick it up. | | `dispatched` | Handed to the agent, not yet started. | | `running` | The agent is running it and streaming logs. | | `succeeded`, `failed`, `timed_out`, `cancelled` | Final. | Jobs are rows in the `jobs` table: the durable record people see and the queue agents pull from. Job results the panel only waits on, such as file listings and log reads, are **routine** jobs, hidden from job lists by default. Passwords, environment values and file contents in job parameters are replaced with `{ redacted: true, length }` when the job ends. ### Records changed by jobs Changes to websites, apps and databases are jobs tied to their record (`jobs.resource_type` and `resource_id`). The record keeps its live settings and a pending action while the job runs. When the job finishes, the service that owns the record applies the result, or the error, before the agent's next poll is answered, so a follow-up job (create an app, then its website, then the first deploy) always sees the result of the one before. Websites follow this model: the panel saves the request (a new site, or a change in `pending_spec`), queues one agent operation that does the whole change (user, folders, PHP-FPM, NGINX, health check), and applies the result to the website row when the job finishes. ## The worker The worker runs two BullMQ queues on Redis. **`vaultpanel-maintenance`** runs a maintenance pass every 15 seconds: - marks silent servers offline, and runs website uptime checks; - sweeps jobs: fails jobs no agent picked up, retries jobs an agent claimed but never started, times out stuck jobs; - advances bulk actions and evaluates alert rules; - rolls raw metrics up into hourly rows and prunes old metrics, alert history and sessions; - takes backups whose schedule is due, then deletes the oldest beyond the schedule's `keepCount`; - asks a server to renew any SSL certificate Certbot has not renewed a day into its renewal window, and raises expiry events; - sends webhook deliveries and panel email, with retries; - deletes expired download copies, uploads and terminal recordings; - fails AI assistant answers stuck too long and expires old proposals; - keeps hosting customers' app ports in line with their plans, and refreshes plugin directories. **`vaultpanel-assistant`** answers AI assistant questions. See [AI Assistant](https://docs.vaultpanel.net/guides/ai-assistant). > **Important:** The worker must run next to the API. Without it, schedules, alerts, webhooks, timeouts and the assistant stop. ## Background flows ### Backups and cron jobs Backups and restores are agent jobs tied to their `backups` row. Cron jobs are installed on the server by a job but run by the server's own cron daemon, so they keep running while the panel is down; the agent reports each run with its next request. ### Webhook events Events come from three places: the backup and cron services, the audit log (alerts, and servers going offline or online) and finished deployment jobs. Each event becomes one `webhook_deliveries` row per webhook that wants it, so a delivery survives a restart. ### Bulk actions A bulk action is one row in `bulk_actions` and one row per server in `bulk_action_targets`; each server's part is an ordinary agent job linked back with `jobs.resource_type = 'bulk_action'`. Progress moves forward from the job finish handler, the agent heartbeat (a server back after a reboot, or with a new agent version) and the maintenance pass. Each step locks the action row, so a rolling action never starts two servers at once. ### Alerts Alerts work like Prometheus rules. When a rule's condition becomes true, an event is `pending`; if it stays true for the rule's duration, it becomes `firing` (audited as `alert.fire`); when the condition clears, it is `resolved`. A pending event whose condition clears is deleted. When a server has no fresh data, metric and service rules are left as they are rather than resolved. ### AI assistant Asking a question saves it and puts the conversation on the `vaultpanel-assistant` queue. The answer is a loop of at most 12 rounds: the provider gets a fixed system prompt and a fixed set of tools, and each tool call runs through the normal services with an actor for the person who asked. The `propose_action` tool only stores a row in `assistant_actions`; it runs when a person approves it, through the same service call as the matching button. ## Frontend React Router pages in `frontend/src/pages`, state in React contexts (`stores/`) and data loading through `hooks/useApi.js`. The design is defined by semantic tokens in `theme/index.css` with light and dark values; type is IBM Plex Sans with JetBrains Mono, bundled with the app (no external font requests). The header holds the Ctrl/Cmd+K command menu, the firing-alerts and running-jobs indicators, the theme switch and the account menu. Navigation groups live in `layouts/navigation.js`. ## Security model - There is no endpoint that runs arbitrary commands, on the panel or the agent. The [terminal](https://docs.vaultpanel.net/guides/servers/terminal) is a separate, owner-only channel. - Every change is a permission check in a service, and every change is audited. - The agent re-validates everything the panel sends, and the server owner's [local policy](https://docs.vaultpanel.net/developers/agent#local-policy) wins over anything the panel asks. See [Security](https://docs.vaultpanel.net/guides/security) for the full list. --- # Server agent URL: https://docs.vaultpanel.net/developers/agent > How the VaultPanel agent works on each server — install paths, the root helper, signed jobs, its local policy in config.json, upgrades and its limits. The agent runs on each managed server as the `vaultpanel-agent` systemd service. It is one static program written in Rust, built for x86-64 and arm64, so the server needs nothing else installed for it: no Node.js. It reports the server's state to the panel and runs the operations the panel signs, from a fixed allow-list, without a shell. To connect a server, see [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). This page is about how the agent works. ## Files and services | Path | What it is | | --- | --- | | `/usr/local/bin/vaultpanel-agent` | The agent's program (`agentBinary`). Everyone can read and run it: the file manager's worker is the same program, run as each site's user. | | `/usr/local/bin/vaultpanel-agent.previous` | The program before the last update from the panel. | | `/etc/vaultpanel-agent/config.json` | Identity and [local policy](https://docs.vaultpanel.net/developers/agent#local-policy). Mode 600, then `root:vaultpanel-agent` mode 640 once the agent runs as its own user. | | `/etc/vaultpanel-agent/agent.key` | The agent's Ed25519 private key. Mode 600, owned by the agent's user once it runs as that user. | | `/etc/vaultpanel-agent/panel-ca.pem` | The panel's certificate, when the panel uses its own self-signed one. | | `/etc/vaultpanel-agent/` (the rest) | Saved cron jobs (`cron/`), DNS providers' credentials for wildcard certificates (`acme-dns/`) and the login message's files. | | `/etc/cron.d/vaultpanel` | One line for each enabled cron job, running `vaultpanel-agent cron-run `. | | `/usr/local/lib/vaultpanel/acme-dns-hook` | Certbot's hook for wildcard certificates; it runs `vaultpanel-agent acme-dns-hook`. | | `/var/lib/vaultpanel` | The agent's state: `agent-mode.json` (the move to its own user), cron results and the ACME challenge folder. | | `/var/backups/vaultpanel` | Website, app and database backups (`backupRoot`, root only). | | `/var/cache/vaultpanel` | Caches: npm, CMS downloads and file manager uploads in progress. | | `/var/lib/vaultpanel-ai` | The assistant's local model, when installed on the panel's own server. | | `/var/lib/vaultpanel/quarantine` | Files moved out of websites by malware scans (`quarantineDir`, root only). | | `/etc/vaultpanel-waf`, `/var/log/vaultpanel-waf` | The web application firewall's settings and its log (`wafDir`, `wafLogDir`). | | `/var/lib/vaultpanel-sftp`, `/etc/vaultpanel-sftp/keys` | The root-owned folders SFTP accounts are locked into, and their keys (`sftpRoot`, `sftpKeysDir`). | | `/etc/vaultpanel-redis` | The Redis object cache's settings and accounts (`redisConfDir`). | | `/var/lib/vaultpanel-migrations` | cPanel backups while they are moved (`migrationDir`, root only). | | `/var/cache/nginx/vaultpanel` | PHP sites' page caches (`pageCacheRoot`). | ```text vaultpanel-agent register|run|status|version|cron-run |helper|acme-dns-hook|panel-pin|set-panel ``` | Command | What it does | | --- | --- | | `register` | Registers with the panel using an enrollment token (the install script runs it). | | `run` | Runs the agent (`vaultpanel-agent.service`). | | `status` | Prints one telemetry snapshot without contacting the panel. | | `version` | Prints the version, such as `0.50.2-rs.1`. | | `cron-run ` | Runs one cron job; started by cron. | | `helper` | Runs the root helper (`vaultpanel-agent-helper.service`). | | `acme-dns-hook` | Adds and removes Let's Encrypt DNS checks; run by Certbot. | | `panel-pin ` | Prints a certificate's public key pin; the install script uses it to check the panel's certificate. | | `set-panel --panel ` | Points the agent at a new panel address, keeping its registration. | ## What it does - **Heartbeat** every 15 seconds: hostname, OS, kernel, architecture, CPU, memory, disk, load, network rates, every real mounted filesystem (up to 20), the state of the services in `watchServices`, and the operations this agent version supports. Every few minutes it adds the web stack (NGINX, PHP-FPM versions, Certbot), the panel's certificates, the server's IP addresses, Git, PM2, Python, Node.js and MariaDB versions, the state of each app's process, database sizes, the time zone and the backup files on disk. - **Self-check** every 5 minutes (agent 0.39.0): what the panel's features need from the server. See [Server self-check](https://docs.vaultpanel.net/guides/servers/self-check). - **Disk use** of each site folder, measured in the background at most every 15 minutes, for hosting plans' disk limits. - **Jobs**: long-polls the panel, runs one job at a time, streams log lines and reports the result. ## Operations The agent runs only operations from its catalog: services, processes and reboots, the web stack and PHP versions, websites, SSL, files, apps and deployments, databases, backups, cron jobs, the firewall, SSH, Fail2ban and updates, DNS, email, containers and the assistant's local model. Agent 0.43.0 to 0.50.1 added: | Operation | What it does | Agent | | --- | --- | --- | | `IMPORT_DATABASE` | Imports a `.sql` or `.sql.gz` file into a database, as that database's own account. | 0.43.0 | | `WORDPRESS_STATUS`, `WORDPRESS_ACTION` | The WordPress tools, run as the site's user. | 0.43.0 | | `SITE_CLONE` | Copies a website into another: clones, staging copies, push to live. | 0.43.0 | | `SITE_CACHE_PURGE` | Empties a PHP site's page cache. | 0.43.0 | | `MALWARE_SCAN`, `MALWARE_QUARANTINE` | ClamAV scans as the site's user; quarantine, restore or delete a file. | 0.43.0 | | `WAF_EVENTS` | What the web application firewall caught for a website. | 0.44.0 | | `MAIL_SPAM` | Turns spam filtering (Rspamd) on or off. | 0.45.0 | | `WEBMAIL_UPDATE` | Checks for and installs a newer Roundcube. | 0.46.0 | | `SFTP_APPLY` | SFTP accounts for websites, locked into their folder. | 0.47.0 | | `MIGRATION_INSPECT`, `MIGRATION_RESTORE`, `MIGRATION_DISCARD` | Reads, moves and deletes a cPanel backup (email from 0.50.0). | 0.48.0 | | `WEBSITE_STATS` | Day totals read from websites' access logs. | 0.49.0 | The page cache, PHP settings, the web application firewall and sign-in protection are settings of `CREATE_NGINX_CONFIG`; Redis, ClamAV and the firewall are installed with `WEB_STACK_INSTALL` and `SECURITY_TOOLS_INSTALL`. The full list, with what each one accepts, is in the [jobs API reference](https://docs.vaultpanel.net/api-reference/jobs). How they run: - Commands run with a fixed argument list, never through a shell, with a timeout. - Configuration files are generated by the agent from checked values. Every NGINX, PHP-FPM or Apache change is written next to the old file, tested (`nginx -t`, `php-fpm -t`, `apache2ctl configtest`) and only then reloaded; if the test fails, the previous files are put back. - App install, build and start commands are split into arguments by the agent; pipes, `;`, `&&`, redirects and `$(…)` are refused. They run as the app's own Linux user. - SQL goes to the `mysql` client on stdin, never the command line, so passwords do not show in the process list. - File manager requests run in a separate process as the site's own user, inside its home folder; symbolic links are listed but never followed. - Containers are created through Docker's Engine API over its socket: unprivileged, `no-new-privileges`, named volumes only, ports bound to `127.0.0.1` unless the panel asks otherwise. ### Refusals that protect the server Whatever the panel asks, the agent refuses what would lock people out or harm the server: - the firewall always keeps the SSH ports and the panel's ports open (`LOCKOUT_REFUSED`); - SSH settings and key removals must leave an administrator account able to sign in; - a process signal is refused when the pid now belongs to a different command (`PROCESS_CHANGED`), is a kernel thread, the agent itself or a protected process (`systemd`, `init`, `sshd`, `systemd-journald`, `systemd-logind`, `systemd-udevd`, `dbus-daemon`); - the agent's own units can never be stopped or restarted through a job, and `ssh`/`sshd` can never be stopped; - containers publishing the panel's database or Redis ports, or labelled `io.vaultpanel.protected`, can be started but never stopped, restarted or removed (`PROTECTED_CONTAINER`). ## Trust - The agent signs every request with its private key; the panel stores only the public key. - The panel signs every job envelope. The agent pinned the panel's key at registration and refuses envelopes that are unsigned, tampered with, addressed to another server, expired or already run. - Removing a server, or registering a new agent for it, revokes the old agent. A revoked agent stops. - With the panel's self-signed certificate, the install command carries the certificate's public key pin. The installer checks it, saves the certificate as `panel-ca.pem`, and the agent trusts that certificate directly, alongside the system's certificate authorities. ## The root helper From agent 0.36.0, an agent that starts as root under systemd from `/usr/local/bin/vaultpanel-agent` (`agentBinary`) moves itself to two services: | Service | Runs as | Does | | --- | --- | --- | | `vaultpanel-agent` | `vaultpanel-agent`, a system user without a shell or home | Talks to the panel: heartbeat, jobs, terminal link. No capabilities, `NoNewPrivileges`, read-only system, no `/home` or `/root`. | | `vaultpanel-agent-helper` | root | Runs jobs and opens terminal shells, reads what the heartbeat needs from root-only files. Has no connection to the panel. | They talk over `/run/vaultpanel-agent-helper/helper.sock` (mode 660, group `vaultpanel-agent`), one JSON message per line. The helper does not take the agent's word for anything that changes the server: it checks every job and terminal request itself against the panel's key in the root-owned `config.json` (signature, server, expiry, not seen before). The agent's user can read `config.json` but not change it. The agent waits for the helper when it starts. If a helper is installed but the agent is not connected to it, jobs are refused with `HELPER_UNAVAILABLE` and the command that fixes it, `sudo systemctl restart vaultpanel-agent-helper vaultpanel-agent` (agent 0.50.1). Older agents that started a moment before the helper ran jobs as their own user, which failed with "Permission denied". If the agent does not reach the panel as its own user within 10 minutes, the helper puts the single root service back (the original unit is kept as `vaultpanel-agent.service.root`) and the server's security checks say why ("Agent privileges"). It does not try again until `/var/lib/vaultpanel/agent-mode.json` is removed and the agent restarted. Set `"runAsRoot": true` in `config.json` to keep one root service. ## Local policy `/etc/vaultpanel-agent/config.json` holds the agent's identity and a local policy. **The server owner's policy wins over anything the panel asks.** Edit the file as root, then restart `vaultpanel-agent`, and `vaultpanel-agent-helper` too when the agent runs as its own user (the helper enforces the policy for jobs). Keys you leave out take their defaults. ### Allow and refuse | Key | Default | Set to `false` to refuse | | --- | --- | --- | | `allowReboot` | `true` | Reboots. | | `allowProcessSignals` | `true` | Stopping or killing processes. | | `allowWebsites` | `true` | Every website, SSL and file operation. | | `allowWebStackInstall` | `true` | Installing packages. | | `allowApplications` | `true` | Every app operation. | | `allowDatabases` | `true` | Every database operation. | | `allowBackups` | `true` | Every backup and restore. | | `allowCron` | `true` | Every cron job operation. | | `allowFirewall`, `allowSshConfig`, `allowFail2ban`, `allowUpdates` | `true` | Firewall, SSH (login message and SFTP accounts too), Fail2ban or update changes. | | `allowSelfUpdate` | `true` | Updates from the panel (use the upgrade command instead). | | `allowContainers` | `true` | Every Docker and container operation. | | `allowTerminal` | `true` | The server terminal; the panel then says it is turned off. | | `allowDns` | `true` | Every DNS operation. | | `allowMail` | `true` | Every email operation. | ### Services | Key | Default | Meaning | | --- | --- | --- | | `allowedServices` | nginx, apache2, php*-fpm, mariadb, mysql, postgresql, redis, docker, cron, ssh, ufw, fail2ban, pm2-* and others | Units that may be restarted or inspected (globs). | | `watchServices` | Common web stack units | Units reported in the heartbeat. | ### Paths and layout | Key | Default | Meaning | | --- | --- | --- | | `diskPath` | `/` | Filesystem reported as disk usage. | | `sitesRoot` | `/var/www` | Where site home folders are created. | | `nginxSitesAvailable`, `nginxSitesEnabled`, `nginxConfD`, `nginxLogDir` | Debian and Ubuntu paths | NGINX layout. | | `acmeWebroot` | `/var/lib/vaultpanel/acme` | Shared folder for Let's Encrypt HTTP challenges. | | `letsencryptDir`, `phpConfRoot`, `phpRunDir`, `webServerUser` | `/etc/letsencrypt`, `/etc/php`, `/run/php`, `www-data` | Certbot, PHP-FPM and web server layout. | | `systemdUnitDir` | `/etc/systemd/system` | Where the `pm2-` units are written. | | `nodeBinDir` | A Node.js in `/usr/local/bin` or `/usr/bin` | Node.js used to run apps and PM2. The agent itself does not use Node.js. | | `npmCacheDir` | `/var/cache/vaultpanel/npm` | npm's cache when installing PM2. | | `mysqlDefaultsFile` | none | A MySQL options file with root credentials, when root cannot use the unix socket. | | `deployEnv` | `{}` | Extra environment for git, npm and pip during deployments, for example `HTTPS_PROXY`. | | `backupRoot` | `/var/backups/vaultpanel` | Where backups are kept (root only). | | `backupMinFreeBytes` | 512 MiB | Backups are refused when less than this is free in `backupRoot`. | | `maxExtractBytes` | 20 GB | The largest archive the file manager extracts. | | `cronFile`, `cronSpecDir`, `cronStateDir` | `/etc/cron.d/vaultpanel`, `/etc/vaultpanel-agent/cron`, `/var/lib/vaultpanel/cron` | Cron layout. | | `agentBinary` | `/usr/local/bin/vaultpanel-agent` | The agent's program. Updates from the panel only run when the agent runs from here. | | `dockerSocket` | `/var/run/docker.sock` or `/run/docker.sock` | Docker's API socket. | | `terminalHostNamespace` | `true` | Start terminal shells in the host's mount namespace, outside the service's sandbox. | | `runAsRoot` | `false` | Keep one root service instead of its own user plus the root helper. | | `bindConfDir` | `/etc/bind` | BIND's configuration folder; zones go in its `vaultpanel/` folder. | | `acmeDnsDir` | `/etc/vaultpanel-agent/acme-dns` | DNS providers' credentials for wildcard certificates. | | `mailRoot` | `/var/mail/vhosts` | Where mailboxes are kept. | ## Upgrading Agents report the operations they support. Operations added after an agent was installed are refused with `AGENT_OUTDATED`, and the server page shows how to upgrade. Versions look like `0.50.2-rs.1`. The release numbers carry on from the old Node.js agent's 0.42.0, so a version requirement such as "agent 0.38.0 or newer" is met; `-rs.N` tells the panel that this agent updates with a program for its CPU type. **From the panel** (agent 0.7.0 and newer): **Update agent** on the server page, or a [bulk action](https://docs.vaultpanel.net/guides/servers/server-groups). The signed job names the version, size and SHA-256 of the program the panel serves for the server's CPU type. The agent downloads it from `/api/v1/agent/package-rs/`, refuses it if anything differs, runs the new program once to check its version, swaps it into `/usr/local/bin/vaultpanel-agent` and keeps the old one as `vaultpanel-agent.previous`. The panel offers the update only when it has the program for that server's CPU type. To go back, move `.previous` into place and restart the service. Servers still on the old Node.js agent cannot be updated this way: they move once with the upgrade command below. See [Moving from the Node.js agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent). **From the server**, with the command the server page shows: ```bash curl -fsSL https://panel.example.com/api/v1/agent/install.sh \ | sudo bash -s -- --upgrade --panel https://panel.example.com ``` `--upgrade` replaces the program, keeps `/etc/vaultpanel-agent` (identity and policy) and restarts the service. On a server with the old Node.js agent it also moves it to the current one and removes `/opt/vaultpanel-agent`. With a self-signed panel certificate, the command also carries `--panel-pin` and the pinned `curl` options. The panel's own server is updated automatically when the panel starts. ## Limits - Website, app, database and security operations target Debian and Ubuntu (apt, UFW, `www-data`, `/etc/php//fpm`). - Whatever the panel signs runs as root in the helper: a panel that is broken into can still do everything the operations allow. They are allow-listed and checked, and the terminal is for owners only. Use the local policy to turn off what a server should never do. - The agent runs on 64-bit Linux on x86-64 and arm64 only. --- # Plugins URL: https://docs.vaultpanel.net/developers/plugins > Extend VaultPanel with plugins — separate programs that call the API with their own token, receive signed events and add a page to the panel's sidebar. A plugin adds a feature to VaultPanel or connects it to an outside service (a status page, a chat bot, an inventory, a billing or ticketing system) without changing the panel's code. A plugin is a **separate program**, run wherever its author likes: on the panel's server, on another server or as a hosted service. It works with the panel in three ways, and only these: 1. It **calls the REST API** with its own token (`vpp_…`), limited to the permissions an owner or admin approved when installing it. 2. It **receives panel events** (deployments, alerts, backups, servers going offline) at its `webhookUrl`, signed with its own secret. 3. It can **show a page inside the panel**, listed in the sidebar and opened with a signed link that tells the plugin who is looking. A plugin never runs inside the panel's process, never adds agent operations and never runs commands on a server itself. Anything it changes goes through the same API, permission checks, job queue and audit log as a person using the panel. ## Installing a plugin Open **Plugins** (under **System**) and click **Install plugin**, or pick one on the **Directory** tab. Give the plugin's manifest URL (the panel fetches it) or paste the manifest as JSON. The panel explains what the plugin asks for in words: each permission scope, the events, its page, and warnings (plain `http`, server operations, customer management). Approving installs it and shows the plugin's **token** and **signing secret** once; give both to the plugin. The panel keeps only the token's SHA-256 and an encrypted copy of the secret. Installing, updating and making new credentials need `plugins.manage` (owners and admins) and a person signed in to the panel: they are refused for API tokens and for plugins. Listing, turning a plugin on or off, removing it and its events also work with a `full` API token. A panel can have up to 50 plugins. | On the plugin's page | Does | | --- | --- | | Turn off / on | Off: its token is refused (401), it receives no events and its page is hidden. On again restores it. | | **Events** | Every event sent to it, with the response; **Send test event**; **Send again**. | | **Settings > Update** | Reads the manifest URL again (or a pasted manifest), shows what changed and asks for approval again. | | **Settings > Make new credentials** | A new token and secret; the old ones stop working at once. | | **Settings > Remove** | Deletes the plugin, its token and its events. What it already did in the panel stays. | ## The manifest ```json { "manifestVersion": 1, "id": "status-board", "name": "Status Board", "version": "1.0.0", "description": "Every server at a glance, with the latest deployments and alerts.", "author": "Example Ltd", "homepage": "https://example.com/status-board", "permissions": ["read"], "events": ["server.offline", "server.online", "deployment.failed"], "webhookUrl": "https://status.example.com/events", "page": { "title": "Status board", "url": "https://status.example.com/", "icon": "activity" } } ``` | Field | Rules | | --- | --- | | `manifestVersion` | `1` | | `id` | 3 to 64 lowercase letters, digits and dashes, starting with a letter and not ending with a dash. Unique per panel; an update must keep it. | | `name` | Up to 100 characters. | | `version` | Up to 32 characters. | | `description` | Optional, up to 500 characters. | | `author` | Optional, up to 100 characters. | | `homepage` | Optional URL. | | `permissions` | Scopes, as for [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens): `read`, `logs`, `deploy`, `manage`, `servers`, `customers`. Not `full`: a plugin can never manage users, roles, panel settings or plugins. | | `events` | Any of the [events](https://docs.vaultpanel.net/developers/plugins#events). Needs `webhookUrl`. | | `webhookUrl` | Where events are POSTed. | | `page` | Optional. `title` (up to 60 characters), `url`, and `icon`: one of `plug`, `activity`, `gauge`, `bell`, `server`, `globe`, `app`, `database`, `shield`, `card`, `briefcase`, `users`, `logs`, `zap`, `sparkles`, `package`, `layers`, `containers`, `automation`. | Unknown fields are refused, so a misspelt permission is an error rather than silently ignored. A manifest fetched by URL may be up to 64 KB. ## Calling the API Send the token as a Bearer token, exactly like an API token. With the [SDK](https://docs.vaultpanel.net/developers/sdk): ```js import { VaultPanel } from '@vaultpanel/sdk'; const panel = new VaultPanel({ baseUrl: 'https://panel.example.com', token: process.env.VAULTPANEL_PLUGIN_TOKEN, }); const { items } = await panel.servers.list(); ``` - `GET /api/v1/auth/me` returns `{ user: null, plugin: { id, slug, name, scopes }, permissions }`. - Every call is audited with the actor `plugin:`; a refused call is audited as `authz.denied`. Jobs it starts show as queued by the plugin. - A plugin cannot use the rest of `/auth`, create API tokens, or read or change plugins. ## Events Each event needs a permission the plugin's scopes include, so a plugin never hears about something it could not read through the API. All of them are covered by `read`. | Events | Need | | --- | --- | | `server.offline`, `server.online` | `servers.read` | | `alert.firing`, `alert.resolved` | `alerts.read` | | `deployment.succeeded`, `deployment.failed` | `applications.read` | | `backup.succeeded`, `backup.failed`, `restore.succeeded`, `restore.failed` | `backups.read` | | `cron.failed` | `cron.read` | | `ssl.expiring`, `ssl.expired`, `ssl.renew_failed` | `websites.read` | ### Receiving events Each event is a `POST` to `webhookUrl` with a JSON body: ```json { "id": "delivery id", "event": "server.offline", "occurredAt": "2026-10-05T18:00:00.000Z", "data": { "server": { "id": "…", "name": "web-1" } } } ``` | Header | Value | | --- | --- | | `X-VaultPanel-Event` | The event. | | `X-VaultPanel-Delivery` | The delivery id, the same on every retry. | | `X-VaultPanel-Timestamp` | Unix seconds. | | `X-VaultPanel-Signature` | `sha256=` followed by the hex HMAC-SHA256 of `.` with the signing secret. | | `X-VaultPanel-Plugin` | The plugin's id. | Answer with any 2xx. Anything else, or no answer within 10 seconds, is tried again after 1, 5 and 30 minutes. **Send test event** sends `webhook.test`. ### Verifying the signature Check the signature before trusting an event. Pass the **raw** request body, before parsing it: **SDK** ```js import { verifyEvent } from '@vaultpanel/sdk'; const event = verifyEvent({ body: rawBody, headers: req.headers, secret: process.env.VAULTPANEL_PLUGIN_SECRET }); if (!event) return res.writeHead(401).end(); // event: { id, event, occurredAt, data } ``` **Node.js** ```js import { createHmac, timingSafeEqual } from 'node:crypto'; function verify(rawBody, headers, secret) { const timestamp = headers['x-vaultpanel-timestamp']; const signature = headers['x-vaultpanel-signature'] ?? ''; if (!/^\d+$/.test(timestamp ?? '') || !signature.startsWith('sha256=')) return null; // Refuse old timestamps so a captured request cannot be replayed. if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return null; const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex'); const given = Buffer.from(signature.slice('sha256='.length)); if (given.length !== expected.length || !timingSafeEqual(given, Buffer.from(expected))) return null; return JSON.parse(rawBody); } ``` `verifyEvent` refuses a timestamp more than 5 minutes away (`toleranceSeconds`, 300 by default). ## The plugin's page A plugin's page is listed in the sidebar for people who may do **everything the plugin may do** (in practice, a plugin with `read` shows to owners and admins), so nobody gains anything by going through a plugin's page. Hosting customers never see plugin pages. The panel shows the page in a sandboxed frame at `/plugin-pages/`, and opens it with these query parameters added to the page URL: | Parameter | Value | | --- | --- | | `vp_plugin` | The plugin's id. | | `vp_user`, `vp_email`, `vp_roles` | Who is looking (roles comma-separated). | | `vp_panel` | The panel's public URL. | | `vp_theme` | `light` or `dark`, to match the panel. | | `vp_ts` | Unix seconds. | | `vp_sig` | Hex HMAC-SHA256, with the signing secret, of every `vp_` parameter but `vp_sig`, sorted by name, as `key=value` joined by `&`. | ```js import { verifyLaunch } from '@vaultpanel/sdk'; const viewer = verifyLaunch(req.url, process.env.VAULTPANEL_PLUGIN_SECRET); if (!viewer) return res.writeHead(403).end('Open this page from VaultPanel'); // viewer: { plugin, user: { id, email, roles }, panelUrl, theme, issuedAt } ``` A link is good for 5 minutes; a page that stays open should start its own session once it has checked the link. The frame may run scripts, forms, pop-ups and downloads. A page on the panel's own address is shown without same-origin access, so it cannot reach the panel's session; host plugin pages on their own address. ## Addresses the panel calls The panel fetches manifests and sends events only to public addresses. The address is checked after DNS resolution, and the request goes to that same address. | Setting | Default | Allows | | --- | --- | --- | | `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE` | `false` on new installs | Private networks such as `10.x` and `192.168.x`. Panels installed before 0.2.0 keep `true`. | | `VAULTPANEL_PLUGIN_ALLOW_LOCAL` | `false` | Loopback (`127.0.0.1`), for a plugin on the panel's own server. | Link-local and cloud metadata addresses are always refused. The page URL is opened by people's browsers, so it must be an address they can reach. ## Example: Status Board The repository's `examples/status-board-plugin/server.js` is a complete plugin with no dependencies beyond the SDK. It serves its manifest at `/manifest.json` and a one-plugin directory at `/directory.json`, checks and keeps the latest events, and shows every server's state and those events on its page. ### Start it ```bash PLUGIN_PUBLIC_URL=http://203.0.113.10:4100 node examples/status-board-plugin/server.js ``` ### Install it Install it in the panel with the manifest URL it prints, and copy the token and secret. ### Restart it with the credentials ```bash VAULTPANEL_PLUGIN_TOKEN=vpp_… VAULTPANEL_PLUGIN_SECRET=whsec_… \ PLUGIN_PUBLIC_URL=http://203.0.113.10:4100 node examples/status-board-plugin/server.js ``` | Variable | Default | Meaning | | --- | --- | --- | | `VAULTPANEL_URL` | `http://127.0.0.1:4000` | The panel's API, by default a development backend on the same machine. | | `PORT` | `4100` | The port the plugin listens on. | | `HOST` | `0.0.0.0` | The address the plugin listens on. | | `PLUGIN_PUBLIC_URL` | `http://127.0.0.1:` | The address the panel and browsers reach the plugin at. | | `PLUGIN_EVENTS_URL` | `PLUGIN_PUBLIC_URL` | When the panel cannot reach the public address: for example `http://127.0.0.1:4100`, used for the manifest and events while the page keeps the public address. Needs `VAULTPANEL_PLUGIN_ALLOW_LOCAL=true` in the panel's `.env`. | | `PLUGIN_VERSION` | `1.0.0` | The version it reports, to try updates through its directory. | ## Plugin directories A directory is a list of plugins published as JSON at a URL by whoever maintains it: a plugin author, a hosting company, a team. **Plugins > Directory > Add directory** takes its URL. The panel reads it at once (nothing is saved if it cannot), then again every 12 hours, and keeps the last good copy. Up to 10 directories; none is built in. The **Directory** tab lists every directory's plugins with search and categories. **Install** on a hosted plugin reads its manifest URL and opens the usual review; for a self-hosted plugin it links to how to run it and asks for the manifest URL of your copy. A directory only suggests: what is approved is always the plugin's own manifest, and the review warns when it asks for more than the directory listed. When a directory lists a newer version of an installed plugin, the plugin shows an update as available; **Settings > Update** reads the plugin's own manifest again. Removing a directory leaves the plugins installed from it installed. ```json { "directoryVersion": 1, "name": "Example Ltd plugins", "description": "Plugins we maintain for our customers.", "homepage": "https://example.com/plugins", "plugins": [ { "id": "status-board", "name": "Status Board", "version": "1.1.0", "description": "Every server at a glance.", "author": "Example Ltd", "hosting": "hosted", "manifestUrl": "https://status.example.com/manifest.json", "permissions": ["read"], "events": ["server.offline", "server.online"], "icon": "activity", "categories": ["monitoring"] }, { "id": "ticket-bridge", "name": "Ticket Bridge", "version": "0.3.0", "hosting": "self-hosted", "setupUrl": "https://example.com/plugins/ticket-bridge#run-it", "permissions": ["read", "logs"] } ] } ``` | Field | Rules | | --- | --- | | `directoryVersion` | `1` | | `name` | Up to 100 characters. `description` (up to 500) and `homepage` are optional. | | `plugins` | Up to 500 entries. | | `plugins[].id`, `name`, `version` | As in the manifest. One entry per `id`; a repeat is left out. | | `plugins[].hosting` | `hosted` (its author runs it; needs `manifestUrl`) or `self-hosted` (you run it; needs `setupUrl` or `homepage`). Default `hosted`. | | `plugins[].permissions`, `events` | What it asks for, as in its manifest. | | `plugins[].icon` | One of the page icons. Default `plug`. | | `plugins[].categories` | Up to 5 short words. | The file may be up to 1 MB and is fetched with the same address rules as manifests. An entry that breaks these rules is left out and shown, with the reason, under its directory. Other fields are ignored, so newer directories still work. ## API Plugins are managed under `/api/v1/plugins`. See the [plugins API reference](https://docs.vaultpanel.net/api-reference/plugins). --- # JavaScript SDK URL: https://docs.vaultpanel.net/developers/sdk > Use @vaultpanel/sdk to call the VaultPanel REST API from Node.js — client options, every resource method, pagination, waiting for jobs and error handling. `@vaultpanel/sdk` is the JavaScript client for the [REST API](https://docs.vaultpanel.net/api-reference): one small class over `fetch`, with no dependencies and a method for each thing the panel manages. The [CLI](https://docs.vaultpanel.net/cli) is built on it. It is MIT licensed. ## Install ```bash npm install @vaultpanel/sdk ``` It needs Node.js 22 or newer and an [API token](https://docs.vaultpanel.net/api-reference/api-tokens), created under **Users & Access > API Tokens**. The token acts as the person who made it, narrowed to its scopes, so the SDK can never do more than that person can. ## Quick start ```js import { VaultPanel } from '@vaultpanel/sdk'; const panel = new VaultPanel({ baseUrl: 'https://panel.example.com', // or VAULTPANEL_URL token: process.env.VAULTPANEL_TOKEN, // an API token (vpt_…) }); const { items } = await panel.servers.list(); const { job } = await panel.applications.deploy(appId); const { job: done } = await panel.jobs.wait(job.id); console.log(done.status); // succeeded, failed, timed_out or cancelled ``` ## Options | Option | Default | Description | | --- | --- | --- | | `baseUrl` | `VAULTPANEL_URL` | The panel's address, with or without `/api/v1` and a trailing slash. `https://` is added when no scheme is given. | | `token` | `VAULTPANEL_TOKEN` | An API token, or a plugin's `vpp_` token. Sent as `Authorization: Bearer`. | | `timeoutMs` | `30000` | Per request. | | `retries` | `2` | Retries for GET requests on 429, 502, 503 and 504, network errors and timeouts, with backoff (honouring `retryAfterSeconds` when the panel sends it). Other methods are never retried. | | `userAgent` | `vaultpanel-sdk` | | | `fetch` | `globalThis.fetch` | Your own `fetch`, for tests or proxies. | | `onRequest` | | Called with `{ method, url }` before each request. | The environment defaults apply only where there is an environment (Node.js, Deno, Bun); in a browser, pass both. `isApiToken(value)` checks that a string looks like an API token before any call, catching a pasted password or a truncated copy. ## Return values Every method returns the `data` of the reply envelope. For anything not wrapped, or to get the message and request id: ```js // Any endpoint (paths are relative to /api/v1). await panel.request('POST', `/servers/${id}/jobs`, { body: { type: 'SERVICE_RESTART', params: { service: 'nginx' } } }); // The whole envelope: { success, data, message, requestId } const envelope = await panel.raw('GET', '/websites'); ``` `request(method, path, options)` takes `query`, `body`, `headers`, `timeoutMs` and `idempotent` (allow retries for a non-GET call). ## Resources | Resource | Methods | | --- | --- | | `panel.servers` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)`, `metrics(id, query)`, `enrollmentToken(id)`, `updateAgent(id)`, `runOperation(id, body)` | | `panel.servers.groups` | `list()`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)` | | `panel.bulkActions` | `list(query)`, `get(id)`, `create(body)`, `cancel(id)` | | `panel.websites` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id, query)`, `enable(id)`, `disable(id)`, `retry(id)`, `issueSsl(id, body)`, `renewSsl(id, body)`, `disableSsl(id)`, `logs(id, body)`, `checkDns(id)`, `files(id, action, body)` | | `panel.domains` | `list(query)` | | `panel.subdomains` | `parents()`, `create(body)` | | `panel.certificates` | `list(query)` | | `panel.dns` | `zones(query)`, `zone(id)`, `createZone(body)`, `updateZone(id, body)`, `removeZone(id)`, `apply(id)`, `check(id)`, `addRecord(zoneId, body)`, `updateRecord(zoneId, recordId, body)`, `removeRecord(zoneId, recordId)` | | `panel.mail` | `servers()`, `setupServer(body)`, `domains(query)`, `domain(id)`, `createDomain(body)`, `removeDomain(id, query)`, `checkDns(id)`, `createMailbox(domainId, body)`, `updateMailbox(domainId, id, body)`, `removeMailbox(domainId, id, query)`, `createForwarder(domainId, body)`, `removeForwarder(domainId, id)` | | `panel.cms` | `catalog()`, `installs(query)`, `install(body)`, `get(id)`, `remove(id, query)` | | `panel.applications` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id, query)`, `environment(id)`, `setEnvironment(id, body)`, `deploy(id)`, `rollback(id, body)`, `apply(id)`, `scale(id, instances)`, `refreshStatus(id)`, `logs(id, body)`, `start(id)`, `stop(id)`, `restart(id)` | | `panel.deployments` | `list(query)`, `get(id)` | | `panel.databases` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)` | | `panel.databases.users` | `list(query)`, `create(body)`, `update(id, body)`, `remove(id)`, `password(id)` | | `panel.containers` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id, query)`, `environment(id)`, `redeploy(id, body)`, `start(id)`, `stop(id)`, `restart(id)`, `servers()` | | `panel.containers.onServer` | `docker(serverId)`, `installDocker(serverId)`, `list(serverId)`, `logs(serverId, ref, body)`, `inspect(serverId, ref)`, `act(serverId, ref, action)`, `images(serverId)`, `pullImage(serverId, body)` | | `panel.backups` | `list(query)`, `get(id)`, `create(body)`, `remove(id)`, `restore(id, body)` | | `panel.backups.storage` | `list()`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)`, `test(id, body)` | | `panel.backups.schedules` | `list(query)`, `save(body)`, `remove(id)` | | `panel.cronJobs` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)`, `run(id)`, `runs(id, query)` | | `panel.webhooks` | `list(query)`, `get(id)`, `create(body)`, `update(id, body)`, `remove(id)`, `test(id)`, `deliveries(id, query)` | | `panel.alerts` | `summary()`, `events(query)`, `acknowledge(id)`, `rules()`, `createRule(body)`, `updateRule(id, body)`, `removeRule(id)` | | `panel.monitoring` | `overview()`, `services(query)` | | `panel.security` | `overview()`, `server(serverId)`, `setFirewall(serverId, body)`, `addFirewallRule(serverId, body)`, `removeFirewallRule(serverId, body)`, `installUpdates(serverId)` | | `panel.jobs` | `list(query)`, `get(id, query)`, `operations()`, `cancel(id)`, `wait(id, options)` | | `panel.users` | `list(query)`, `get(id)`, `invite(body)`, `update(id, body)`, `roles()` | | `panel.auditLog` | `list(query)` | | `panel.apiTokens` | `list(query)`, `scopes()`, `create(body)`, `revoke(id)` | | `panel.hosting` | `plans()`, `createPlan(body)`, `updatePlan(id, body)`, `removePlan(id)`, `customers(query)`, `customer(id)`, `createCustomer(body)`, `updateCustomer(id, body)`, `changePlan(id, planId)`, `suspend(id, reason)`, `unsuspend(id)`, `terminate(id)`, `me()` | | `panel.plugins` | `list()`, `get(id)`, `pages()`, `preview(body)`, `enable(id)`, `disable(id)`, `remove(id)`, `deliveries(id, query)`, `test(id)`, `directory()`, `refreshDirectories()`, `refreshDirectory(directoryId)`, `removeDirectory(directoryId)` | | `panel` | `me()`, `dashboard()`, `health()`, `request()`, `raw()`, `paginate()`, `listAll()`, `waitForJob()` | Request bodies and query parameters are those of the matching endpoint in the [API reference](https://docs.vaultpanel.net/api-reference). Creating API tokens, installing plugins and adding plugin directories are refused for tokens: they are done in the panel while signed in. ## Lists List endpoints return `{ items, pagination }`, with `page`, `pageSize` (up to 100), `sort`, `order` and per-endpoint filters. To walk every page: ```js for await (const site of panel.paginate('/websites', { pageSize: 50 })) { console.log(site.name); } const servers = await panel.listAll('/servers'); ``` ## Jobs Long operations (deployments, website changes, backups) answer with a job, and the real outcome arrives later. `jobs.wait` polls until the job reaches a final state and returns `{ job, logs }`. It throws `JOB_WAIT_TIMEOUT` rather than letting a script carry on as if the work had succeeded; it does not throw when the job itself failed, so check the status. ```js const { job, logs } = await panel.jobs.wait(id, { timeoutMs: 600_000, // default 10 minutes intervalMs: 2_000, // default 2 seconds onProgress: (job, lines) => lines.forEach((line) => console.log(line.message)), }); if (job.status !== 'succeeded') throw new Error(job.error ?? job.status); ``` `jobs.wait` also accepts a reply that contains a job, such as `{ job }`. ## Errors Every failure throws a `VaultPanelError` carrying what the panel said: ```js import { VaultPanelError } from '@vaultpanel/sdk'; try { await panel.websites.create({ name: '', serverId }); } catch (err) { if (err instanceof VaultPanelError) { err.status; // 422 err.code; // 'VALIDATION_ERROR' err.fieldErrors; // { name: 'Required' } err.details; // the error's details, as the panel sent them err.requestId; // quote this when reporting a problem err.isAuthError; // 401 or 403: the token is gone, or its scopes are too narrow err.isValidationError; // 422 } } ``` | `code` | Meaning | | --- | --- | | The panel's own code | Such as `NOT_FOUND`, `FORBIDDEN`, `QUOTA_REACHED`. See [errors](https://docs.vaultpanel.net/api-reference). | | `NETWORK` | The panel could not be reached. | | `TIMEOUT` | The panel did not answer within `timeoutMs`. | | `BAD_RESPONSE` | Something that is not the API answered, usually the wrong URL. | | `JOB_WAIT_TIMEOUT` | `jobs.wait` gave up before the job finished. | | `CONFIG` | A missing `baseUrl`, no `fetch`, or nothing to wait for. | ## For plugin authors A [plugin](https://docs.vaultpanel.net/developers/plugins) calls the API with `new VaultPanel({ token: 'vpp_…' })`, and checks what the panel signs with two helpers: | Function | Returns | | --- | --- | | `verifyEvent({ body, headers, secret, toleranceSeconds })` | The event `{ id, event, occurredAt, data }`, or `null`. Pass the raw body. | | `verifyLaunch(url, secret, { maxAgeSeconds })` | `{ plugin, user: { id, email, roles }, panelUrl, theme, issuedAt }`, or `null`. | | `launchSigningString(params)` | The string the panel signs for a page link. | Both checks run in constant time and refuse signatures older than 5 minutes. --- # Development URL: https://docs.vaultpanel.net/developers/development > Run VaultPanel from source for development — MariaDB and Redis in Docker, the API, worker and interface in watch mode, the checks CI runs and the code conventions. This page is for working on VaultPanel itself. To run the panel on a server, use the [installer](https://docs.vaultpanel.net/getting-started/installation). ## Requirements - Node.js 22 or newer, for the panel. - MariaDB 10.6 or newer (or MySQL 8) and Redis 6.2 or newer. Docker can provide both. - To work on the agent, or to connect a server to a panel run from a checkout: Rust, on the toolchain CI uses (`RUST_VERSION` in `.github/workflows/agent.yml`), and a C compiler for the TLS crates (`build-essential` on Debian and Ubuntu). The agent builds and runs on Linux only. ## Set up ### Start MariaDB and Redis ```bash docker compose -f docker/compose.yml up -d ``` This starts MariaDB on `127.0.0.1:3307` (creating the `vaultpanel` and `vaultpanel_test` databases) and Redis on `127.0.0.1:6379`. The containers restart after a reboot as long as Docker starts at boot. ### Configure ```bash cp .env.example .env ``` Set `VAULTPANEL_SECRET_KEY` to 32 random bytes: ```bash openssl rand -hex 32 ``` ### Install and migrate ```bash npm install npm run db:migrate ``` `db:migrate` applies the migrations, then syncs the built-in roles and permissions from `shared/src/permissions.js`. ### Run the API, the worker and the interface In three terminals: ```bash npm run dev:backend # API on http://127.0.0.1:4000 (prints the setup token) npm run dev:worker # background maintenance and the AI assistant npm run dev:frontend # UI on http://localhost:5173, proxies /api to the backend ``` ### Create the owner Open `http://localhost:5173/setup` and create the owner account with the setup token from the API log. ### HTTPS locally To try the panel with HTTPS as the installer runs it, make a certificate and set `VAULTPANEL_TLS_CERT`, `VAULTPANEL_TLS_KEY` (and optionally `VAULTPANEL_LOOPBACK_PORT`) in `.env`. The end-to-end test script `e2e/scripts/start-panel.js https` shows the whole setup. ## The agent The agent is written in Rust, in `agent/`. Build and check it there: ```bash cd agent cargo build --release # target/release/vaultpanel-agent cargo test cargo fmt --check cargo clippy --release --all-targets -- -D warnings ``` `./agent/scripts/dev-build.sh` builds it without downloading crates, with `rustc` alone, into `agent/build/vaultpanel-agent` (it needs `libssl-dev`). That build has no TLS, so it only reaches a panel over loopback HTTP: it is for development, never for servers. From the repository root, `npm run test:conformance` checks the agent against the protocol (`docs/agent-protocol.md` in the repository). It uses the release build, else the development build; `AGENT_CMD` names another. `agent/README.md` has the rest: the static release builds, the layout of the sources and how this agent differs from the Node.js one it replaced. > **Note:** Started as root on Linux with systemd, `npm run dev:backend` connects the machine it runs on as a server and installs the agent as a service from `agent/dist`, so put a build there first: ```bash mkdir -p agent/dist && cp agent/target/release/vaultpanel-agent agent/dist/vaultpanel-agent-x64 # or -arm64 ``` Set `VAULTPANEL_LOCAL_AGENT=false` in `.env` to stop the automatic connection. ### Running an agent by hand To run an agent without installing a service, add a server in the interface, then register and run it from the checkout: ```bash agent/build/vaultpanel-agent register --panel http://localhost:5173 --token vpe_… --config ./tmp/agent.json --insecure-http agent/build/vaultpanel-agent run --config ./tmp/agent.json ``` `--insecure-http` is for local development only; the panel must also allow it with `VAULTPANEL_ALLOW_INSECURE_AGENTS=true` (the default in `.env.example`). ## Repository layout `install.sh` and `scripts/` hold the installer, the agent installer and the `vaultpanel` server command. Tests live next to each package (`backend/test`, `shared/test`, `frontend/src/**/*.test.js`), so each package runs its own suite. The agent's tests are Rust unit tests next to its code (`cargo test`), and `conformance/` checks it against the protocol from the outside. ## Checks ```bash npm run lint npm test # needs MariaDB and Redis npm run build npm run test:coverage # the same tests, with a coverage summary per package npm run test:e2e # end-to-end smoke tests in a browser npm run test:conformance # the agent against the protocol (build it first) ``` `npm test` runs the tests of the npm workspaces; the agent is not one of them. Its checks are the `cargo` commands [above](https://docs.vaultpanel.net/developers/development#the-agent). > **Warning:** `npm test` uses `.env.test` (database `vaultpanel_test`, Redis database 15), and the backend suite rebuilds `vaultpanel_test` from scratch. Never point `.env.test` at real data. The end-to-end tests use their own databases, `vaultpanel_e2e` and `vaultpanel_e2e_tls`. ## npm scripts | Script | Does | | --- | --- | | `dev:backend` | The API in watch mode. | | `dev:worker` | The worker in watch mode. | | `dev:frontend` | The Vite development server. | | `build` | Builds the interface into `frontend/dist`. | | `lint` | ESLint over the repository. | | `test` | Every workspace's tests. | | `db:migrate`, `db:rollback` | Applies or rolls back migrations. | | `connect-local` | Connects the machine the panel runs on as a server (run as root). | | `cli` | Runs the `vaultpanel` CLI from the checkout. | | `test:e2e`, `test:coverage` | End-to-end tests; tests with coverage. | | `test:conformance` | Checks the agent against the protocol. | ## Conventions - **JavaScript** (ES modules) for the panel, **Rust** for the agent. - **Business rules live in services**, not controllers. Services take an actor, check permissions through `services/authorization.js` and record audit entries. - **Every response uses the envelope** `{ success, data, message, requestId }`, and every error an `AppError` with an HTTP status and a stable code. - **The panel's development MariaDB is on port 3307**, not 3306, so a MariaDB installed for apps on the same machine can use the standard port. ### Adding an agent operation A new operation is added in three places, and a backend test fails if the panel offers an operation the agent does not implement: 1. The catalog, `shared/src/operations.js`: its name, label, permission, parameters, whether it is dangerous or retryable, and its timeout. 2. The agent, `OPERATIONS` in `agent/src/ops/mod.rs`, with the implementation in `agent/src/ops/`: fixed commands and no shell. 3. A test. A rule the agent checks again (a pattern in `shared/`) also goes into `agent/src/ops/rules.rs`; `conformance/rules.test.js` fails when the two disagree. Agents report the operations they support, so older agents answer `AGENT_OUTDATED` for the new one until they are [upgraded](https://docs.vaultpanel.net/developers/agent#upgrading). --- # Database schema URL: https://docs.vaultpanel.net/developers/database-schema > The tables in VaultPanel's MariaDB database by area, the migrations that add them, how secrets are stored at rest and how the audit log is protected. The panel keeps its state in MariaDB 10.6 or newer (or MySQL 8) through Knex. Migrations are in `database/migrations`; `npm run db:migrate` applies them and then syncs the built-in roles and permissions from `shared/src/permissions.js`. On an installed panel, `vaultpanel update` runs them for you. - IDs are UUIDs generated by the application, except the high-volume append tables (`audit_logs`, `server_metrics`, `job_logs`), which use auto-increment integers. - All timestamps are UTC with millisecond precision. - PostgreSQL is not supported. This is the panel's own database, separate from the MariaDB the panel installs on servers for websites and apps. On an installed panel it runs in Docker on `127.0.0.1:3307`. ## Accounts and access | Table | Purpose | | --- | --- | | `users` | Accounts: password hash (scrypt), encrypted TOTP secret, lockout counters, soft delete. `webauthn_handle` is the random id passkeys know the account by (not its email or id); `passkey_count` counts its passkeys. | | `passkeys` | Passkeys (WebAuthn): the user, the panel address it was made on (`rp_id`), credential id, public key (PEM) and algorithm, signature counter, name, AAGUID, whether it is synced (`backed_up`), when it was added and last used. | | `passkey_challenges` | Passkey sign-in and registration challenges: purpose (`signin` or `register`), the address and origin they are for, expiry (5 minutes) and when they were used. Each works once. | | `roles`, `permissions`, `role_permissions` | Built-in roles and their permissions, synced from code. | | `user_roles` | Role assignments (the interface assigns one role per user). | | `teams`, `team_members` | Schema only, for later features. | | `sessions` | Browser sessions; only a SHA-256 of the cookie value is stored. | | `password_reset_tokens` | Invite and reset links: hashed, single use, expiring. | | `user_recovery_codes` | Two-factor recovery codes. | | `api_tokens` | API tokens: owner, scopes, expiry; only the token's SHA-256. | | `audit_logs` | The append-only audit trail. | | `settings` | Panel settings; secrets in it are stored encrypted. | | `email_messages` | Email the panel sends itself (invites, resets, alerts, tests), kept for retries; the body is encrypted. | ## Servers, monitoring and jobs | Table | Purpose | | --- | --- | | `servers` | Managed servers with their latest system information, service and filesystem snapshots, web stack, Docker summary, security summary and self-check report. Soft delete. | | `server_enrollment_tokens` | One-time agent enrollment tokens (hashed). | | `server_agents` | Registered agents and their Ed25519 public keys; revocation. | | `server_metrics` | Telemetry samples, kept 7 days by default (`VAULTPANEL_METRICS_RETENTION_DAYS`). | | `server_metrics_hourly` | Hourly averages (and CPU maximum) rolled up from `server_metrics`, kept 90 days by default. | | `alert_rules` | Thresholds: metric, threshold, how long it must hold, severity, optional server or service. | | `alert_events` | One row per alert: pending, firing, resolved, acknowledgement. A unique key allows one open event per rule, server and subject. Resolved alerts are kept 90 days by default (`VAULTPANEL_ALERT_HISTORY_DAYS`). | | `jobs` | Operations requested for servers: type, status, attempts, timeouts, output, error, and the record they belong to (`resource_type`, `resource_id`). | | `job_logs` | Log lines streamed by agents and the panel for each job. | | `server_groups`, `server_group_members` | Server groups. | | `bulk_actions`, `bulk_action_targets` | One action across a group, and one row per server. | | `terminal_sessions` | Terminal sessions owners opened; recordings are asciicast files in the panel's data folder. | The monitoring migration seeds five alert rules (CPU, memory, disk, server offline, service down); later migrations add **Website down** and **Server self-check failed**. All can be edited or deleted. ## Websites, DNS and email | Table | Purpose | | --- | --- | | `websites` | Websites: type, server, settings, pending changes, Git deploy settings, uptime status, disk use. The firewall (`waf`: mode and rules turned off, or null for off) and sign-in limit (`login_limit`). SFTP: `sftp_enabled`, `sftp_password_hash` (SHA512-CRYPT), `sftp_keys` (public key lines), and the last `SFTP_APPLY` job and its error. Statistics: when they were last checked and collected, the last `WEBSITE_STATS` job and its error. | | `website_stats_daily` | Website statistics, one row per website and day (the server's own day): requests, page views, visitors, bytes, bots, status classes and the day's top 20 pages, referrers, browsers, systems and pages not found (`tops`). Kept 400 days. | | `website_domains` | Each website's domains, with the primary one. | | `ssl_certificates` | Certificates: issuer, expiry, renewal settings, the DNS provider a wildcard was checked through. | | `website_deployments` | Deployments of static websites from Git. | | `website_environment_variables` | Environment variables for those deployments' build commands, encrypted. | | `website_checks`, `website_incidents` | Uptime checks and stretches of downtime, kept 30 days by default (`VAULTPANEL_UPTIME_HISTORY_DAYS`). | | `cms_installs` | Apps put in a website by the app installer (WordPress, Joomla, Drupal, Laravel, Roundcube), with their database. For Roundcube updates: the newest version found (`latest_version`), when it was checked and `auto_update`. | | `site_migrations` | Moves from a cPanel full backup: server, file name and size, status (`uploading`, `inspecting`, `ready`, `creating`, `restoring`, `done`, `failed`, `discarded`), what the server read in it, the plan picked, the result and the last job and error. The restore's parameters with database passwords (`pending_params_encrypted`) and the mailboxes' password hashes (`mail_secrets_encrypted`) are encrypted and cleared once used. | | `file_uploads`, `file_downloads` | Large file-manager uploads and downloads passed through the panel in pieces. An upload can also belong to a cPanel move (`migration_id`). | | `dns_zones`, `dns_records` | DNS zones served by BIND on the panel's servers, and their records. | | `dns_providers` | Cloudflare and Namecheap accounts used for wildcard certificates; the secret is encrypted. | | `mail_servers`, `mail_domains`, `mailboxes`, `mail_forwarders` | Email hosting: the mail server on each server, its domains, mailboxes and forwarders. `mail_servers.spam_filter` is the spam filter as the server last applied it (`enabled`, `junkScore`, `rejectScore`), or null if never turned on. | ## Apps, databases and containers | Table | Purpose | | --- | --- | | `applications` | Apps: runtime, repository, commands, port, copies, CPU and memory limits, the current release, process state. | | `environment_variables` | Each app's environment variables, encrypted. | | `deployments` | Each deployment of an app: trigger, commit, stage, status, log. | | `databases` | MariaDB databases on the servers, with their size and the app or website they belong to. | | `database_users`, `database_user_grants` | Database users, with encrypted passwords, and their access to databases. | | `containers` | Docker containers deployed by the panel, with their settings; environment values are encrypted. | ## Backups, cron and webhooks | Table | Purpose | | --- | --- | | `backups` | Backups of websites, apps and databases: status, size, SHA-256, where they are kept. | | `backup_schedules` | Backup schedules with how many to keep. | | `backup_restores` | Restores and their safety backups. | | `backup_storages` | Off-server destinations: S3-compatible buckets and SFTP servers. | | `cron_jobs`, `cron_runs` | Cron jobs and the result of each run. | | `webhooks`, `webhook_deliveries` | Webhooks and each delivery, with retries. URLs and signing secrets are encrypted. | ## Hosting, assistant and plugins | Table | Purpose | | --- | --- | | `hosting_plans` | Plans: limits, app caps, price, billing cycle, server group. | | `customers` | Hosting accounts: plan, server, billing id, status, what suspending turned off. | | `customer_ports` | Each customer's own app ports per server. | | `api_keys` | Billing API keys; only the key's SHA-256. | | `assistant_conversations`, `assistant_messages`, `assistant_actions` | AI assistant conversations, every model reply, tool call and result, and proposed actions. | | `plugins` | Installed plugins: manifest, approved scopes, the token's SHA-256 and the encrypted signing secret. | | `plugin_directories` | Plugin directories and the last copy read. | ## Migrations | Migration | Adds | | --- | --- | | `20261003000001_foundation` | Accounts, servers, agents, metrics, jobs, the audit log, settings. | | `20261004000001_monitoring` | Hourly metrics, alert rules and events. | | `20261004000002_websites` | Websites, domains, SSL certificates. | | `20261004000003_applications_databases` | Apps, environment variables, deployments, databases and users. | | `20261004000004_backups_cron_webhooks` | Backups, schedules, restores, cron jobs, webhooks. | | `20261004000005_local_server` | Marks the panel's own server. | | `20261004000006_security` | The servers' security summary, two-factor recovery codes, app CPU and memory limits. | | `20261005000001_multi_server` | Server groups and bulk actions. | | `20261005000002_hosting` | Plans, customers, billing API keys. | | `20261005000003_assistant` | The AI assistant. | | `20261005000004_containers` | Containers. | | `20261005000005_api_tokens` | API tokens. | | `20261005000006_plugins` | Plugins. | | `20261006000001_customer_ports` | Customer app ports. | | `20261006000002_backup_storage` | Off-server backup storage. | | `20261006000003_app_instances` | Several copies of an app. | | `20261007000001_dns_zones` | DNS zones and records. | | `20261007000002_mail` | Email hosting. | | `20261007000003_custom_nginx` | Custom NGINX rules for websites. | | `20261008000001_cms_installs` | The app installer. | | `20261008000002_panel_email` | Panel email. | | `20261012000001_site_git_deploy` | Static website Git deploy. | | `20261012000002_website_environment` | Website environment variables. | | `20261012000003_ssl_renewal` | SSL renewal settings. | | `20261012000004_customer_dns` | Name servers and DNS zones for customers. | | `20261012000005_file_uploads` | Large uploads. | | `20261013000010_file_downloads` | Large downloads. | | `20261013000101_terminal_recordings` | Terminal sessions and recordings. | | `20261013000140_plugin_directories` | Plugin directories. | | `20261019000001_website_spa` | Single-page app websites. | | `20261019000101_signed_git_webhooks` | Signed push-to-deploy webhooks. | | `20261019000102_app_zero_downtime` | Zero-downtime reloads. | | `20261031000001_dns_providers` | DNS providers for wildcard certificates. | | `20261031000002_website_uptime` | Website uptime monitoring. | | `20261031000003_server_self_check` | The server self-check report. | | `20261101000001_database_website_link` | Linking a database to a website. | | `20261113000001_backup_encryption` | Encrypted backup copies: `backup_storages.encryption_key_encrypted` and `encryption_key_exported_at`, `backups.storage_encrypted`. | | `20261113000002_user_locale` | `users.locale` and `users.time_zone`. | | `20261113000003_audit_retention` | Audit log privacy: entries older than `audit.retention_days` (never under 90 days) may be deleted, and an erased person's name, IP address and browser removed; nothing else can change. | | `20261117000001_website_php_settings` | `websites.php_settings`. | | `20261117000002_database_imports` | Database imports: `file_uploads.database_id`, and `file_uploads.website_id` may be empty. | | `20261117000003_site_clones` | `site_clones` (staging copies and clones), and `websites.staging_of`. | | `20261117000004_website_page_cache` | `websites.page_cache_minutes`. | | `20261117000005_malware` | `malware_scans`, `malware_findings`, and `servers.malware_weekly`. | | `20261117000006_website_firewall` | `websites.waf` and `websites.login_limit`. | | `20261117000007_mail_spam_filter` | `mail_servers.spam_filter`. | | `20261117000008_webmail_updates` | Roundcube updates: `cms_installs.latest_version`, `update_checked_at`, `auto_update`. | | `20261117000009_website_sftp` | SFTP for websites: the `sftp_*` columns on `websites`. | | `20261117000010_passkeys` | `passkeys`, `passkey_challenges`, `users.webauthn_handle` and `users.passkey_count`. | | `20261117000011_site_migrations` | `site_migrations`, and `file_uploads.migration_id`. | | `20261118000012_website_stats` | `website_stats_daily`, and the `stats_*` columns on `websites`. | | `20261118000013_migration_mail` | `site_migrations.mail_secrets_encrypted`. | ## Secrets at rest - Passwords are scrypt hashes. SFTP passwords are SHA512-CRYPT hashes, and passkeys are kept as public keys only. - Session, enrollment and reset tokens, API tokens, plugin tokens, push-to-deploy tokens and billing API keys are stored as SHA-256 hashes, so they are shown once. - TOTP secrets, the job-signing private key, app and website environment variables, database user passwords, container environment variables, webhook URLs and signing secrets, plugin signing secrets, DNS provider secrets, the assistant's API keys, panel email bodies and a cPanel move's database passwords and mailbox password hashes are encrypted with AES-256-GCM, with keys derived from `VAULTPANEL_SECRET_KEY`. - Passwords sent to the agent are removed from the stored job when it finishes. > **Warning:** Losing `VAULTPANEL_SECRET_KEY` means users must set up two-factor sign-in again, agents must be registered again, environment variables must be entered again and database passwords reset. The [panel backup](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) includes it. ## Audit log protection On MariaDB and MySQL, triggers reject every `UPDATE` and `DELETE` on `audit_logs`. `TRUNCATE` and `DROP` bypass triggers, so run the panel with a database user that lacks `DROP` where you can. --- # API overview URL: https://docs.vaultpanel.net/api-reference > The VaultPanel REST API at a glance, covering base URL, authentication, the response envelope, errors, pagination, rate limits and background jobs. Everything the panel's interface does goes through one JSON REST API, and so do the [command-line tool](https://docs.vaultpanel.net/cli), the [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk) and [plugins](https://docs.vaultpanel.net/developers/plugins). This page covers the conventions every endpoint shares. The pages in this section document each endpoint. ## Base URL ```text https://panel.example.com/api/v1 ``` Use the address you open the panel at: its domain when it has one, or `https://203.0.113.10:8090` on a new install. There is one version of the API, `v1`, in the path. > **Note:** A new install serves the panel with a self-signed certificate (in `/etc/vaultpanel/tls/` on the panel's server). Give the panel a domain with a trusted certificate before you script against it, or point your client at that certificate, for example with `curl --cacert`. See [HTTPS and the panel domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). ## Quick start ### Create an API token In the panel, open **Users & Access > API Tokens** and create a token with the scopes your script needs. The token (`vpt_…`) is shown once. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens). ### Call the API **cURL** ```bash export VAULTPANEL_TOKEN=vpt_… curl https://panel.example.com/api/v1/auth/me \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js import { VaultPanel } from '@vaultpanel/sdk'; const panel = new VaultPanel({ baseUrl: 'https://panel.example.com', token: process.env.VAULTPANEL_TOKEN, }); const me = await panel.me(); console.log(me.user.email, me.apiToken.scopes); ``` The JavaScript examples in this reference use the `panel` client above. SDK methods return the envelope's `data` and throw a `VaultPanelError` (with `status`, `code`, `details` and `requestId`) for every error. See [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk). ## Authentication | Caller | Credential | Where | | --- | --- | --- | | Scripts, the CLI and the SDK | `Authorization: Bearer vpt_…` (an API token) | Every endpoint except most of `/auth` | | The panel in a browser | The `vp_session` cookie, plus `X-CSRF-Token` on changes | Every endpoint | | Plugins | `Authorization: Bearer vpp_…` (the plugin's own token) | What the owner approved | | Billing systems | `vpk_…` billing API keys | `/billing` only | | Server agents | Ed25519-signed requests | `/agent` only | | Git hosts | A secret token in the URL, plus a signature | `/hooks/deploy/:token` only | A token acts as the person who created it, narrowed to its scopes, and every call it makes is in the audit log under that person. See [Authentication](https://docs.vaultpanel.net/api-reference/authentication). Each endpoint in this reference names the **permission** the panel checks and the **token scope** that grants it. A request without the permission answers `403 FORBIDDEN`, and the denial is written to the audit log. ## Requests - Send JSON with `Content-Type: application/json`. Bodies are limited to 4 MB (the file upload endpoint, which takes raw bytes, is the exception). - IDs are UUIDs. Timestamps are ISO 8601 strings in UTC. - Query parameters are strings and are converted where the endpoint expects numbers or booleans (`true` or `false`). ## The response envelope Every response, success or error, has the same shape: ```json { "success": true, "data": { "status": "ok" }, "message": "OK", "requestId": "6f1c2a4e-1b7d-4c55-9a0e-3d2f8b7c9e10" } ``` ```json { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Some fields are invalid", "details": [{ "field": "email", "message": "Enter a valid email address" }] }, "requestId": "6f1c2a4e-1b7d-4c55-9a0e-3d2f8b7c9e10" } ``` `message` is a human-readable summary of what happened, such as `Website saved. The agent is creating it on the server.` ### Request IDs Every response carries a request id in `requestId` and in the `X-Request-Id` header. It also appears in the panel's logs and in the audit log. Send your own `X-Request-Id` (8 to 64 letters, digits, `.`, `_` or `-`) and the panel uses it instead of generating one. Quote the request id when you report a problem. ## Errors Errors carry a stable machine-readable `code`. Branch on the code, not on the message. | Status | Code | Meaning | | --- | --- | --- | | 400 | `BAD_REQUEST` | The request cannot be carried out as sent. | | 400 | `BAD_JSON` | The body is not valid JSON. | | 401 | `UNAUTHENTICATED` | No valid session or token. A revoked or expired token also answers this. | | 403 | `FORBIDDEN` | Signed in, but without the permission (or CSRF token) this needs. | | 403 | `IP_NOT_ALLOWED` | The panel only accepts approved addresses, and yours is not one. | | 403 | `TWO_FACTOR_SETUP_REQUIRED` | Your account must turn on two-factor sign-in before it can use anything but `/auth`. | | 404 | `NOT_FOUND` | No such record, or one you cannot see. Unknown routes also answer this. | | 409 | `CONFLICT` and specific codes | The current state does not allow it. Most 409s have their own code, such as `WEBSITE_BUSY` or `AGENT_OUTDATED`. | | 413 | `PAYLOAD_TOO_LARGE` | The body is over the size limit. | | 422 | `VALIDATION_ERROR` | One or more fields are invalid. `details` lists them. | | 429 | `RATE_LIMITED` | Too many requests. | | 500 | `INTERNAL_ERROR` | Something failed on the panel. The message never contains internals. | | 503 | `DEGRADED` | Only from `GET /health`, when the database or Redis is down. | ### Validation errors `details` lists one entry per problem. `field` is the path of the field, with dots for nested fields and array positions (`env.2.key`, `params.service`). ```json { "code": "VALIDATION_ERROR", "message": "Some fields are invalid", "details": [ { "field": "name", "message": "Use 3 to 32 lowercase letters, digits and dashes, starting with a letter" }, { "field": "domains", "message": "Add at least one domain" } ] } ``` Some `409` errors carry `details` too, such as the `jobId` of the job that is already running. ## Lists and pagination List endpoints share these query parameters: | Name | Type | Default | Description | | --- | --- | --- | --- | | `page` | integer | `1` | Page number, from 1. | | `pageSize` | integer | `25` | Items per page, 1 to 100. | | `sort` | string | per endpoint | A column the endpoint allows, such as `createdAt` or `name`. | | `order` | string | per endpoint | `asc` or `desc`. | Endpoints add their own filters (`search`, `serverId`, `status` and so on). Lists answer with: ```json { "items": [], "pagination": { "page": 1, "pageSize": 25, "total": 0, "totalPages": 1 } } ``` The SDK walks every page for you: ```js for await (const site of panel.paginate('/websites', { serverId })) { console.log(site.primaryDomain); } ``` ## Rate limits Limits apply per client IP address, in each panel process. A limited request answers `429 RATE_LIMITED`. Responses carry the `RateLimit-Policy` and `RateLimit` headers (IETF draft 8), so a client can see how much is left. | Applies to | Limit | | --- | --- | | Every endpoint under `/api/v1` except `/health`, `/agent`, `/hooks` and `/billing` | 600 requests a minute | | Sign-in, the second sign-in step, single sign-on, password changes and two-factor changes | 20 requests in 15 minutes | | `POST /auth/setup` | 10 requests in 15 minutes | | Password reset requests and links | 20 requests in 15 minutes | | `POST /hooks/deploy/:token` | 30 requests a minute | | `/billing` | 120 requests a minute | | Agent registration | 30 requests an hour | | Agent install script and package downloads | 60 requests a minute | The SDK retries `GET` requests answered with `429`, `502`, `503` or `504` twice, with backoff. ## Jobs: the asynchronous model Anything that changes a server (creating a website, deploying an app, restarting a service) is carried out by the agent on that server. The API saves the request, queues a **job** and answers `202 Accepted` with the job. The record the job acts on shows what is running in its `status` and `pendingAction`, and keeps its current settings until the job succeeds. ```json { "success": true, "data": { "website": { "id": "0b8e…", "status": "creating", "pendingAction": "create" }, "job": { "id": "a1d3…", "type": "CREATE_SITE", "status": "queued" } }, "message": "Website saved. The agent is creating it on the server.", "requestId": "…" } ``` Follow the job with `GET /api/v1/jobs/:id` until its `status` is `succeeded`, `failed`, `timed_out` or `cancelled`. The SDK does this for you: ```js const { job } = await panel.applications.deploy(appId); const { job: done, logs } = await panel.jobs.wait(job.id); // throws if it does not finish in time ``` Reads that need the server, such as file listings and log lines, are jobs too. Their result arrives in the job's `output`. See [Jobs](https://docs.vaultpanel.net/api-reference/jobs). ## Health `GET /api/v1/health` — Auth: public Whether the panel can reach its database and Redis. No authentication and no rate limit, for load balancers and uptime checks. ```bash curl https://panel.example.com/api/v1/health ``` ```json { "success": true, "data": { "status": "ok", "checks": { "database": "ok", "redis": "ok" } }, "message": "OK", "requestId": "…" } ``` When either is down it answers `503` with code `DEGRADED`, and `details` holds the same `checks` object (`ok` or `unavailable` for each). ## Hosting customers A hosting customer signs in to the same API. They reach only their own websites, subdomains, domains, certificates, apps, deployments, databases, backups, cron jobs and jobs, and the `/auth`, `/api-tokens` and `/hosting` areas. Every other area answers `403 FORBIDDEN`, and a record of another account answers `404 NOT_FOUND`. Creating something beyond their plan answers `409 QUOTA_REACHED`. See [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing). ## Endpoint reference - [Authentication](https://docs.vaultpanel.net/api-reference/authentication) - [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens) - [Users and roles](https://docs.vaultpanel.net/api-reference/users-and-roles) - [Settings](https://docs.vaultpanel.net/api-reference/settings) - [Servers](https://docs.vaultpanel.net/api-reference/servers) - [Jobs](https://docs.vaultpanel.net/api-reference/jobs) - [Server groups](https://docs.vaultpanel.net/api-reference/server-groups) - [Monitoring and alerts](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts) - [Security](https://docs.vaultpanel.net/api-reference/security) - [Websites](https://docs.vaultpanel.net/api-reference/websites) - [Applications](https://docs.vaultpanel.net/api-reference/applications) - [Databases](https://docs.vaultpanel.net/api-reference/databases) - [Containers](https://docs.vaultpanel.net/api-reference/containers) - [DNS](https://docs.vaultpanel.net/api-reference/dns) - [Mail](https://docs.vaultpanel.net/api-reference/mail) - [Backups](https://docs.vaultpanel.net/api-reference/backups) - [Cron jobs](https://docs.vaultpanel.net/api-reference/cron-jobs) - [Webhooks](https://docs.vaultpanel.net/api-reference/webhooks) - [Assistant](https://docs.vaultpanel.net/api-reference/assistant) - [Hosting](https://docs.vaultpanel.net/api-reference/hosting) - [Billing](https://docs.vaultpanel.net/api-reference/billing) - [Plugins](https://docs.vaultpanel.net/api-reference/plugins) - [Agent](https://docs.vaultpanel.net/api-reference/agent) --- # Authentication URL: https://docs.vaultpanel.net/api-reference/authentication > How callers authenticate to the VaultPanel API, and the /auth endpoints for setup, sign-in, two-factor codes, passkeys, sessions and password resets. The API accepts several kinds of credentials, one per kind of caller. Scripts send an API token. The panel's own interface uses a session cookie, which is what the `/auth` endpoints on this page create and manage. ## Credentials | Credential | Header | Used by | Details | | --- | --- | --- | --- | | API token | `Authorization: Bearer vpt_…` | Scripts, the CLI, the SDK | Acts as its owner, narrowed to its scopes. No CSRF token needed. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens). | | Session cookie | `Cookie: vp_session=…` and `X-CSRF-Token` | The panel in a browser | Created by sign-in. HttpOnly, `SameSite=Strict`, and `Secure` on HTTPS. | | Plugin token | `Authorization: Bearer vpp_…` | Plugins | What the owner approved for the plugin. See [Plugins](https://docs.vaultpanel.net/api-reference/plugins). | | Billing API key | `vpk_…` | Billing systems | Only on `/billing`. See [Billing](https://docs.vaultpanel.net/api-reference/billing). | | Agent signature | Signed headers | Server agents | Only on `/agent`. See [Agent](https://docs.vaultpanel.net/api-reference/agent). | | Webhook token | In the URL | Git hosts | Only on `/hooks/deploy/:token`. See [Git push hooks](https://docs.vaultpanel.net/api-reference/applications#git-push-hook). | When a request carries an API token, the token wins and any session cookie is ignored. ### API tokens and `/auth` Signing in and out, passwords, two-factor settings, passkeys and sessions stay interactive. An API token may call `GET /auth/me` and nothing else under `/auth`. The other signed-in endpoints on this page answer `403 FORBIDDEN` to a token. ### Sessions and CSRF A browser session lasts 12 hours by default (`VAULTPANEL_SESSION_TTL_HOURS`). Every state-changing request made with the session cookie (anything but `GET`, `HEAD` and `OPTIONS`) must send the session's CSRF token in the `X-CSRF-Token` header. Sign-in and `GET /auth/me` return it as `csrfToken`. A missing or wrong token answers `403 FORBIDDEN`. Requests made with an API token carry no cookie, so they need no CSRF token. ### Two-factor policy An owner or admin can require two-factor sign-in for some roles (see [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor)). A covered account without it can still sign in, but every endpoint outside `/auth` answers `403 TWO_FACTOR_SETUP_REQUIRED` until it turns two-factor sign-in on or adds a passkey (a passkey counts as two-factor sign-in). Sign-in responses say so in `twoFactorSetupRequired`. ### Address restrictions When the panel only accepts approved addresses, requests from other addresses answer `403 IP_NOT_ALLOWED`, including sign-in. See [Panel access](https://docs.vaultpanel.net/guides/security/panel-access). ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/auth/setup` | [Get setup status](https://docs.vaultpanel.net/api-reference/authentication#get-setup-status) | | POST | `/api/v1/auth/setup` | [Create the owner account](https://docs.vaultpanel.net/api-reference/authentication#create-the-owner-account) | | POST | `/api/v1/auth/login` | [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in) | | POST | `/api/v1/auth/login/2fa` | [Complete two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#complete-two-factor-sign-in) | | POST | `/api/v1/auth/sso` | [Sign in with a billing link](https://docs.vaultpanel.net/api-reference/authentication#sign-in-with-a-billing-link) | | POST | `/api/v1/auth/passkeys/login/options` | [Start a passkey sign-in](https://docs.vaultpanel.net/api-reference/authentication#start-a-passkey-sign-in) | | POST | `/api/v1/auth/passkeys/login` | [Sign in with a passkey](https://docs.vaultpanel.net/api-reference/authentication#sign-in-with-a-passkey) | | GET | `/api/v1/auth/me` | [Get the current identity](https://docs.vaultpanel.net/api-reference/authentication#get-the-current-identity) | | POST | `/api/v1/auth/logout` | [Sign out](https://docs.vaultpanel.net/api-reference/authentication#sign-out) | | POST | `/api/v1/auth/password` | [Change your password](https://docs.vaultpanel.net/api-reference/authentication#change-your-password) | | POST | `/api/v1/auth/2fa/setup` | [Start two-factor setup](https://docs.vaultpanel.net/api-reference/authentication#start-two-factor-setup) | | POST | `/api/v1/auth/2fa/enable` | [Turn on two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#turn-on-two-factor-sign-in) | | POST | `/api/v1/auth/2fa/disable` | [Turn off two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#turn-off-two-factor-sign-in) | | POST | `/api/v1/auth/2fa/recovery-codes` | [Replace recovery codes](https://docs.vaultpanel.net/api-reference/authentication#replace-recovery-codes) | | GET | `/api/v1/auth/passkeys` | [List your passkeys](https://docs.vaultpanel.net/api-reference/authentication#list-your-passkeys) | | POST | `/api/v1/auth/passkeys/register/options` | [Start adding a passkey](https://docs.vaultpanel.net/api-reference/authentication#start-adding-a-passkey) | | POST | `/api/v1/auth/passkeys` | [Add a passkey](https://docs.vaultpanel.net/api-reference/authentication#add-a-passkey) | | DELETE | `/api/v1/auth/passkeys/:id` | [Remove a passkey](https://docs.vaultpanel.net/api-reference/authentication#remove-a-passkey) | | GET | `/api/v1/auth/sessions` | [List your sessions](https://docs.vaultpanel.net/api-reference/authentication#list-your-sessions) | | POST | `/api/v1/auth/sessions/sign-out-others` | [Sign out other sessions](https://docs.vaultpanel.net/api-reference/authentication#sign-out-other-sessions) | | DELETE | `/api/v1/auth/sessions/:id` | [Sign out a session](https://docs.vaultpanel.net/api-reference/authentication#sign-out-a-session) | | POST | `/api/v1/auth/password-reset/request` | [Request a password reset](https://docs.vaultpanel.net/api-reference/authentication#request-a-password-reset) | | POST | `/api/v1/auth/password-reset/inspect` | [Inspect a reset or invite link](https://docs.vaultpanel.net/api-reference/authentication#inspect-a-reset-or-invite-link) | | POST | `/api/v1/auth/password-reset/complete` | [Set a password from a link](https://docs.vaultpanel.net/api-reference/authentication#set-a-password-from-a-link) | The examples for session endpoints use a cURL cookie jar (`-c` saves the cookie, `-b` sends it) and `fetch` from a page served by the panel. ## Get setup status `GET /api/v1/auth/setup` — Auth: public Whether the panel still needs its first owner, and whether the sign-in page can offer "Forgot password?" (true when [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) is set up). **Example request** ```bash curl https://panel.example.com/api/v1/auth/setup ``` **Response** `200 OK` ```json { "success": true, "data": { "needsSetup": false, "passwordResetByEmail": true }, "message": "OK", "requestId": "…" } ``` ## Create the owner account `POST /api/v1/auth/setup` — Auth: public Creates the first owner with the setup token the installer printed (`sudo vaultpanel setup-token` shows it again) and signs them in. Works once: after the first owner exists it answers `409`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `setupToken` | string | Yes | The panel's setup token. | | `name` | string | Yes | 1 to 120 characters. | | `email` | string | Yes | A valid email address. | | `password` | string | Yes | 12 to 256 characters. | **Example request** ```bash curl https://panel.example.com/api/v1/auth/setup -c cookies.txt \ -H "Content-Type: application/json" \ -d '{"setupToken":"15d59a807f148df64628dd4ca0abd16c","name":"Ada Lovelace","email":"ada@example.com","password":"correct-horse-battery"}' ``` **Response** `201 Created`. Sets the `vp_session` cookie and returns the same data as [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in). **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `INVALID_SETUP_TOKEN` | The setup token is wrong. | | 409 | `ALREADY_SET_UP` | The panel already has an owner. | | 422 | `VALIDATION_ERROR` | A field is invalid, such as a password under 12 characters. | | 429 | `RATE_LIMITED` | More than 10 attempts in 15 minutes. | ## Sign in `POST /api/v1/auth/login` — Auth: public Checks an email and password. Without two-factor sign-in it starts a session, sets the `vp_session` cookie and returns the signed-in user. With two-factor sign-in on, it returns a challenge instead: send it with a code to [Complete two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#complete-two-factor-sign-in). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | The account's email address. | | `password` | string | Yes | The account's password. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/auth/login -c cookies.txt \ -H "Content-Type: application/json" \ -d '{"email":"ada@example.com","password":"correct-horse-battery"}' ``` **JavaScript** ```js const res = await fetch('/api/v1/auth/login', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'ada@example.com', password: 'correct-horse-battery' }), }); const { data } = await res.json(); const csrfToken = data.csrfToken; // send as X-CSRF-Token on later changes ``` **Response** `200 OK`, signed in ```json { "success": true, "data": { "user": { "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "email": "ada@example.com", "name": "Ada Lovelace", "isActive": true, "twoFactorEnabled": false, "passkeyCount": 0, "roles": ["owner"], "lastLoginAt": "2026-11-10T09:14:03.000Z", "createdAt": "2026-10-20T08:00:00.000Z", "updatedAt": "2026-11-10T09:14:03.000Z" }, "permissions": ["dashboard.view", "users.read", "users.manage", "…"], "csrfToken": "…", "customer": null, "twoFactorSetupRequired": false }, "message": "Signed in", "requestId": "…" } ``` `customer` is set for a hosting customer's account and `null` for staff. **Response** `200 OK`, two-factor code needed ```json { "success": true, "data": { "twoFactorRequired": true, "challengeToken": "…" }, "message": "Enter your two-factor code", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `INVALID_CREDENTIALS` | The email or password is wrong, or the account is deactivated. | | 403 | `ACCOUNT_SUSPENDED` | A hosting customer's account is suspended or closed (said only after the right password). | | 403 | `IP_NOT_ALLOWED` | The panel does not accept sign-ins from this address. | | 429 | `ACCOUNT_LOCKED` | Five failed attempts in a row lock the account for 15 minutes. | | 429 | `RATE_LIMITED` | More than 20 attempts from this address in 15 minutes. | ## Complete two-factor sign-in `POST /api/v1/auth/login/2fa` — Auth: public The second step of sign-in. Send the challenge from [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in) with either a 6-digit code from the authenticator app or one of the account's recovery codes. The challenge is valid for 5 minutes. Each recovery code works once. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `challengeToken` | string | Yes | From the sign-in response. | | `code` | string | One of the two | The current 6-digit code. | | `recoveryCode` | string | One of the two | A recovery code such as `abcde-12345`. | **Example request** ```bash curl https://panel.example.com/api/v1/auth/login/2fa -c cookies.txt \ -H "Content-Type: application/json" \ -d '{"challengeToken":"…","code":"492817"}' ``` **Response** `200 OK`. Sets the `vp_session` cookie and returns the same data as [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in). After a recovery code it also returns `recoveryCodesLeft`. **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `UNAUTHENTICATED` | The challenge expired. Sign in again. | | 401 | `INVALID_CODE` | The code is wrong, or the recovery code was already used. | | 403 | `ACCOUNT_SUSPENDED`, `IP_NOT_ALLOWED` | As for [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in). | | 422 | `VALIDATION_ERROR` | Neither or both of `code` and `recoveryCode` were sent. | | 429 | `ACCOUNT_LOCKED` | Too many failed attempts. | ## Sign in with a billing link `POST /api/v1/auth/sso` — Auth: public Exchanges a one-time sign-in link made by a billing system (the panel opens it as `/sso#token=…`) for a session. A link is valid for 2 minutes and works once. See [Billing](https://docs.vaultpanel.net/api-reference/billing). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | The token from the link. | **Response** `200 OK`. Sets the `vp_session` cookie and returns the same data as [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in). **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `LOGIN_LINK_INVALID` | The link expired, was already used, or its account is deactivated. | ## Passkeys Passkeys (WebAuthn) are made and used by the browser's `navigator.credentials`; these endpoints give it the options and check what it sends back. Binary values are base64url strings. A passkey is tied to the host the browser is on, which must be the host the request reached, over HTTPS (or `http://localhost`), and a domain name, not an IP address. The browser's `Origin` header must be sent. Each challenge works once and for 5 minutes. See [Passkeys](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor#passkeys). These errors can come from any passkey endpoint: | Status | Code | When | | --- | --- | --- | | 400 | `PASSKEY_ORIGIN` | No `Origin`, or it is not the host the request reached. | | 400 | `PASSKEY_HTTPS` | The panel was not opened over HTTPS. | | 400 | `PASSKEY_IP` | The panel was opened on an IP address. | | 400 | `PASSKEY_EXPIRED` | The challenge expired or was already used. | | 429 | `RATE_LIMITED` | Over the sign-in limit (20 attempts from an address in 15 minutes). | ## Start a passkey sign-in `POST /api/v1/auth/passkeys/login/options` — Auth: public A challenge for any passkey the browser has for this address. Takes no body. Pass `publicKey` to `navigator.credentials.get()` (after turning `challenge` into bytes). **Response** `200 OK` ```json { "success": true, "data": { "challengeId": "b1f4c2d8-…", "publicKey": { "challenge": "…", "rpId": "panel.example.com", "timeout": 120000, "userVerification": "required", "allowCredentials": [] } }, "message": "OK", "requestId": "…" } ``` ## Sign in with a passkey `POST /api/v1/auth/passkeys/login` — Auth: public Checks the browser's signed answer and starts a session. A passkey is a whole sign-in: no email, password or two-factor code is asked. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `challengeId` | string | Yes | From [Start a passkey sign-in](https://docs.vaultpanel.net/api-reference/authentication#start-a-passkey-sign-in). | | `credential.id` | string | Yes | The credential id. | | `credential.rawId` | string | No | The credential id, base64url. | | `credential.type` | string | Yes | `public-key`. | | `credential.response.clientDataJSON` | string | Yes | Base64url. | | `credential.response.authenticatorData` | string | Yes | Base64url. | | `credential.response.signature` | string | Yes | Base64url. | | `credential.response.userHandle` | string | No | Base64url. | **Response** `200 OK`. Sets the `vp_session` cookie and returns the same data as [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in), with the message `Signed in with a passkey`. **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `PASSKEY_REFUSED` | The passkey is unknown, for another address, for a deactivated account, or its signature, user check or counter is wrong. A bad signature counts as a failed sign-in. | | 403 | `ACCOUNT_SUSPENDED`, `IP_NOT_ALLOWED` | As for [Sign in](https://docs.vaultpanel.net/api-reference/authentication#sign-in). | | 429 | `ACCOUNT_LOCKED` | Too many failed attempts. | ## Get the current identity `GET /api/v1/auth/me` Who the session or token belongs to and what it may do. This is the only `/auth` endpoint an API token may call, which makes it the CLI's `whoami`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/auth/me \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const me = await panel.me(); ``` **Response** `200 OK` ```json { "success": true, "data": { "user": { "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "email": "ada@example.com", "name": "Ada Lovelace", "isActive": true, "twoFactorEnabled": true, "roles": ["owner"], "lastLoginAt": "…", "createdAt": "…", "updatedAt": "…" }, "permissions": ["dashboard.view", "servers.read", "websites.read", "…"], "customer": null, "csrfToken": null, "apiToken": { "id": "9a7e2c1d-…", "name": "deploy script", "scopes": ["read", "deploy"] }, "twoFactorSetupRequired": false, "recoveryCodesLeft": 9 }, "message": "OK", "requestId": "…" } ``` - With a token, `permissions` are the overlap of the token's scopes and its owner's permissions, `apiToken` names the token and `csrfToken` is `null`. - With a session, `csrfToken` is the token to send as `X-CSRF-Token` and `apiToken` is `null`. - With a plugin token, `user` is `null` and `plugin` names the plugin and its scopes. - `recoveryCodesLeft` is `null` when two-factor sign-in is off. **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `UNAUTHENTICATED` | No valid session or token. | ## Sign out `POST /api/v1/auth/logout` — Auth: session Ends the current session and clears the cookie. **Example request** ```bash curl -X POST https://panel.example.com/api/v1/auth/logout -b cookies.txt \ -H "X-CSRF-Token: $CSRF_TOKEN" ``` **Response** `200 OK` with `data: null` and the message `Signed out`. ## Change your password `POST /api/v1/auth/password` — Auth: session Changes the signed-in person's password and signs out their other sessions. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `currentPassword` | string | Yes | The password in use now. | | `newPassword` | string | Yes | 12 to 256 characters. | **Example request** ```bash curl https://panel.example.com/api/v1/auth/password -b cookies.txt \ -H "X-CSRF-Token: $CSRF_TOKEN" -H "Content-Type: application/json" \ -d '{"currentPassword":"correct-horse-battery","newPassword":"a-longer-passphrase-2026"}' ``` **Response** `200 OK` with `data: null`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | `currentPassword` is incorrect, or `newPassword` is too short. | ## Start two-factor setup `POST /api/v1/auth/2fa/setup` — Auth: session Creates a new TOTP secret for the signed-in person. Show `otpauthUrl` as a QR code (or the secret as text) in an authenticator app, then confirm it with [Turn on two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#turn-on-two-factor-sign-in). **Response** `200 OK` ```json { "success": true, "data": { "secret": "JBSWY3DPEHPK3PXP…", "otpauthUrl": "otpauth://totp/…" }, "message": "Scan the code, then confirm it", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `TWO_FACTOR_ALREADY_ENABLED` | Two-factor sign-in is already on. | ## Turn on two-factor sign-in `POST /api/v1/auth/2fa/enable` — Auth: session Confirms the secret from setup with a current code, turns two-factor sign-in on and returns 10 recovery codes. They are shown once: keep them somewhere safe. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `code` | string | Yes | The current 6-digit code. | **Response** `200 OK` ```json { "success": true, "data": { "recoveryCodes": ["k7m2p-x9q4r", "…"] }, "message": "Two-factor sign-in is on. Save your recovery codes.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | Setup was not started. | | 409 | `TWO_FACTOR_ALREADY_ENABLED` | Two-factor sign-in is already on. | | 422 | `VALIDATION_ERROR` | The code is not valid. | ## Turn off two-factor sign-in `POST /api/v1/auth/2fa/disable` — Auth: session Turns two-factor sign-in off for the signed-in person and deletes their recovery codes. Needs the password and a current code. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | Yes | The account's password. | | `code` | string | Yes | The current 6-digit code. | **Response** `200 OK` with `data: null`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | Two-factor sign-in is not on. | | 422 | `VALIDATION_ERROR` | The password or code is incorrect (`details` names which). | ## Replace recovery codes `POST /api/v1/auth/2fa/recovery-codes` — Auth: session Makes 10 new recovery codes. The old ones stop working. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | Yes | The account's password. | | `code` | string | Yes | The current 6-digit code. | **Response** `200 OK` with `data.recoveryCodes`, as for [Turn on two-factor sign-in](https://docs.vaultpanel.net/api-reference/authentication#turn-on-two-factor-sign-in). **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | Two-factor sign-in is not on. | | 422 | `VALIDATION_ERROR` | The password or code is incorrect. | ## List your passkeys `GET /api/v1/auth/passkeys` — Auth: session The signed-in person's passkeys, oldest first. **Response** `200 OK` ```json { "success": true, "data": { "passkeys": [ { "id": "7d3a9e10-…", "name": "Mac · Safari", "address": "panel.example.com", "synced": true, "createdAt": "2026-11-17T10:02:11.000Z", "lastUsedAt": "2026-11-18T08:41:57.000Z" } ] }, "message": "OK", "requestId": "…" } ``` `address` is the panel address the passkey works on. `synced` is true when the device says the passkey is backed up (for example to a password manager or cloud account). ## Start adding a passkey `POST /api/v1/auth/passkeys/register/options` — Auth: session Checks the account's password and returns the options for `navigator.credentials.create()`. The passkey must check the user (`userVerification: "required"`) and be discoverable; no attestation is asked for. Passkeys the account already has on this address are listed in `excludeCredentials`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | Yes | The account's password. | **Response** `200 OK` ```json { "success": true, "data": { "challengeId": "c8e2f7a4-…", "publicKey": { "challenge": "…", "rp": { "id": "panel.example.com", "name": "VaultPanel" }, "user": { "id": "…", "name": "ada@example.com", "displayName": "Ada Lovelace" }, "pubKeyCredParams": [{ "type": "public-key", "alg": -7 }, { "type": "public-key", "alg": -8 }, { "type": "public-key", "alg": -257 }], "timeout": 120000, "attestation": "none", "authenticatorSelection": { "residentKey": "required", "requireResidentKey": true, "userVerification": "required" }, "excludeCredentials": [] } }, "message": "OK", "requestId": "…" } ``` `user.id` is a random handle the panel makes for the account, not its email or id. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `PASSKEY_LIMIT` | The account already has 20 passkeys. | | 422 | `VALIDATION_ERROR` | The password is incorrect. | ## Add a passkey `POST /api/v1/auth/passkeys` — Auth: session Checks the new passkey and keeps its public key. Accepts ES256 (-7), EdDSA (-8) and RS256 (-257) keys. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `challengeId` | string | Yes | From [Start adding a passkey](https://docs.vaultpanel.net/api-reference/authentication#start-adding-a-passkey). | | `name` | string | No | Up to 100 characters. Defaults to `Passkey`. | | `credential.id` | string | Yes | The credential id. | | `credential.rawId` | string | No | The credential id, base64url. | | `credential.type` | string | Yes | `public-key`. | | `credential.response.clientDataJSON` | string | Yes | Base64url. | | `credential.response.attestationObject` | string | Yes | Base64url. | **Response** `201 Created` with the account's passkeys, as for [List your passkeys](https://docs.vaultpanel.net/api-reference/authentication#list-your-passkeys), and the message `Passkey added`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `PASSKEY_INVALID` | The browser's answer does not check out (wrong challenge, address, user check or key type). | | 409 | `PASSKEY_EXISTS` | This passkey is already added. | ## Remove a passkey `DELETE /api/v1/auth/passkeys/:id` — Auth: session Removes one of the signed-in person's passkeys. **Response** `200 OK` with the remaining passkeys, as for [List your passkeys](https://docs.vaultpanel.net/api-reference/authentication#list-your-passkeys), and the message `Passkey removed`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such passkey of yours. | ## List your sessions `GET /api/v1/auth/sessions` — Auth: session The signed-in person's active sessions, most recently used first (up to 200). **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "5e2b8c71-…", "ip": "198.51.100.24", "userAgent": "Mozilla/5.0 …", "createdAt": "2026-11-10T09:14:03.000Z", "lastSeenAt": "2026-11-10T11:02:40.000Z", "expiresAt": "2026-11-10T21:14:03.000Z", "current": true } ] }, "message": "OK", "requestId": "…" } ``` ## Sign out other sessions `POST /api/v1/auth/sessions/sign-out-others` — Auth: session Ends every session of the signed-in person except the current one. **Response** `200 OK` ```json { "success": true, "data": { "count": 2 }, "message": "Signed out 2 other sessions", "requestId": "…" } ``` ## Sign out a session `DELETE /api/v1/auth/sessions/:id` — Auth: session Ends one of the signed-in person's other sessions. **Response** `200 OK` with `data: null`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | It is the current session. Use [Sign out](https://docs.vaultpanel.net/api-reference/authentication#sign-out). | | 404 | `NOT_FOUND` | No such active session of yours. | ## Request a password reset `POST /api/v1/auth/password-reset/request` — Auth: public The "Forgot password?" request. Answers the same way whether or not the address has an account, then emails a reset link when it has one. Each account gets at most one email every 5 minutes. Needs [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | The account's email address. | **Response** `202 Accepted` ```json { "success": true, "data": null, "message": "If this address has an account, a reset link is on its way.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `EMAIL_OFF` | The panel cannot send email. An administrator can [issue a reset link](https://docs.vaultpanel.net/api-reference/users-and-roles#issue-a-password-reset-link) instead. | | 429 | `RATE_LIMITED` | More than 20 requests from this address in 15 minutes. | ## Inspect a reset or invite link `POST /api/v1/auth/password-reset/inspect` — Auth: public Says whose link a token is and what it is for, before the person chooses a password. Reset links are valid for 2 hours and invite links for 72 hours. The token is the part after `#token=` in the link. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | The token from the link. | **Response** `200 OK` ```json { "success": true, "data": { "email": "grace@example.com", "name": "Grace Hopper", "purpose": "invite" }, "message": "OK", "requestId": "…" } ``` `purpose` is `invite` or `reset`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `INVALID_RESET_TOKEN` | The link is invalid or has expired. | ## Set a password from a link `POST /api/v1/auth/password-reset/complete` — Auth: public Sets the account's password from an invite or reset link and signs out its existing sessions. The link stops working. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | The token from the link. | | `password` | string | Yes | 12 to 256 characters. | **Response** `200 OK` ```json { "success": true, "data": null, "message": "Password set. You can sign in now.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `INVALID_RESET_TOKEN` | The link is invalid, expired or already used. | | 422 | `VALIDATION_ERROR` | The password is too short. | --- # API tokens URL: https://docs.vaultpanel.net/api-reference/api-tokens > Create, list and revoke VaultPanel API tokens, and the scopes that decide which permissions a token carries on behalf of its owner. API tokens let scripts, the [CLI](https://docs.vaultpanel.net/cli) and the [SDK](https://docs.vaultpanel.net/developers/sdk) call the API without a browser session. A token belongs to the person who created it and always acts as them. What it may do is the **overlap of its scopes and its owner's permissions**, so a token never does more than its owner, and narrowing the owner's role narrows their tokens at once. Send it as a bearer token: ```http Authorization: Bearer vpt_3J9cX0r… ``` ## How tokens work - **Format.** `vpt_` followed by 43 URL-safe characters. Only the token's SHA-256 is stored; the token itself is shown once, when it is created. - **Owner.** Everyone manages their own tokens. People with `users.manage` can also list and revoke everyone's. - **Limits.** Up to 25 active tokens per person. A token can expire after 1 to 3650 days, or never (until it is revoked). - **Revocation.** Revoking takes effect immediately. A token also stops working when its owner is deactivated or, for a hosting customer, suspended or removed. A revoked or expired token answers `401 UNAUTHENTICATED`. - **Interactive actions.** A token cannot create or revoke tokens, sign in, change passwords or two-factor settings, or open the server terminal. Under `/auth` it may only call [`GET /auth/me`](https://docs.vaultpanel.net/api-reference/authentication#get-the-current-identity). - **Audit.** Every call is audited as the owner, with the token named in the actor label (`ada@example.com (token: deploy script)`). The token's last use, address and use count are recorded. ## Scopes Scopes are groups of permissions. Give a token only what its script needs, and combine scopes freely. The `manage`, `deploy` and `servers` scopes change things but grant few read permissions, so most scripts pair them with `read`. | Scope | Label | What it allows | Permissions | | --- | --- | --- | --- | | `read` | Read | View servers, websites, DNS zones, email, apps, databases, containers, backups, cron jobs, alerts and jobs | `dashboard.view`, `servers.read`, `websites.read`, `dns.read`, `mail.read`, `applications.read`, `databases.read`, `containers.read`, `backups.read`, `cron.read`, `alerts.read`, `jobs.read`, `security.read`, `users.read`, `roles.read`, `customers.read` | | `logs` | Logs | Read website, app, container and server logs | `websites.logs`, `applications.logs`, `containers.logs`, `servers.logs`, `audit.read` | | `deploy` | Deploy | Deploy, roll back, start, stop and restart apps and containers, and run cron jobs now | `applications.deploy`, `containers.operate`, `cron.run`, `jobs.read`, `applications.read`, `containers.read` | | `manage` | Manage hosting | Create, change and delete websites, DNS zones, email, apps, databases, containers, backups and cron jobs | `websites.manage`, `dns.manage`, `mail.manage`, `files.read`, `files.write`, `applications.manage`, `databases.manage`, `containers.manage`, `backups.create`, `backups.manage`, `cron.manage`, `webhooks.manage`, `alerts.manage`, `alerts.acknowledge`, `jobs.cancel` | | `servers` | Servers | Run server operations: services, processes, security settings and reboots | `servers.manage`, `servers.services`, `servers.processes`, `servers.signal`, `servers.reboot`, `servers.bulk`, `security.manage` | | `customers` | Customers | Create, change, suspend and remove hosting customers and plans | `customers.manage`, `plans.manage` | | `full` | Everything | Everything the owner may do, including panel settings and users | Every permission except `servers.terminal` | The terminal (`servers.terminal`) is never available to a token: it opens only from the panel in a browser. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/api-tokens` | [List tokens](https://docs.vaultpanel.net/api-reference/api-tokens#list-tokens) | | GET | `/api/v1/api-tokens/scopes` | [List scopes](https://docs.vaultpanel.net/api-reference/api-tokens#list-scopes) | | POST | `/api/v1/api-tokens` | [Create a token](https://docs.vaultpanel.net/api-reference/api-tokens#create-a-token) | | POST | `/api/v1/api-tokens/:id/revoke` | [Revoke a token](https://docs.vaultpanel.net/api-reference/api-tokens#revoke-a-token) | ## List tokens `GET /api/v1/api-tokens` Your tokens, active ones first, newest first. Never includes the token itself. Any signed-in person may list their own; listing everyone's needs `users.manage`. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `all` | boolean | No | `true` lists every person's tokens. Needs `users.manage`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/api-tokens \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, canSeeAll } = await panel.apiTokens.list(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "9a7e2c1d-4f60-4b2e-8d1a-6c3b5e7f9a20", "name": "deploy script", "prefix": "vpt_3J9cX0r", "scopes": ["read", "deploy"], "user": { "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "email": "ada@example.com", "name": "Ada Lovelace" }, "expiresAt": "2027-11-10T09:30:00.000Z", "expired": false, "lastUsedAt": "2026-11-10T11:05:12.000Z", "lastUsedIp": "198.51.100.24", "useCount": 418, "revokedAt": null, "createdAt": "2026-11-10T09:30:00.000Z" } ], "canSeeAll": true }, "message": "OK", "requestId": "…" } ``` `prefix` is the first 12 characters of the token, to recognize it. `canSeeAll` says whether you may use `all=true`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | `all=true` without `users.manage`. | ## List scopes `GET /api/v1/api-tokens/scopes` The scopes this panel offers. Tools installed separately (such as the CLI from npm) use it to describe the panel they talk to. `permissions` is the number of permissions in each scope. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/api-tokens/scopes \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.apiTokens.scopes(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "key": "read", "label": "Read", "description": "View servers, websites, DNS zones, email, apps, databases, containers, backups, cron jobs, alerts and jobs", "permissions": 16 }, { "key": "logs", "label": "Logs", "description": "Read website, app, container and server logs", "permissions": 5 } ] }, "message": "OK", "requestId": "…" } ``` ## Create a token `POST /api/v1/api-tokens` — Auth: session Creates a token for the signed-in person. This is the only time the token is returned: store it in your secret manager. It can only be called from a browser session, which is what **Users & Access > API Tokens** in the panel does. Scopes that cover permissions the owner does not have are kept on the token but grant nothing. A token whose scopes cover none of the owner's permissions is refused. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | 1 to 100 characters, to recognize the token later. | | `scopes` | string[] | Yes | At least one of `read`, `logs`, `deploy`, `manage`, `servers`, `customers`, `full`. | | `expiresInDays` | integer or null | No | 1 to 3650. Left out or `null`, the token does not expire. | **Example request** ```bash curl https://panel.example.com/api/v1/api-tokens -b cookies.txt \ -H "X-CSRF-Token: $CSRF_TOKEN" -H "Content-Type: application/json" \ -d '{"name":"deploy script","scopes":["read","deploy"],"expiresInDays":365}' ``` **Response** `201 Created` ```json { "success": true, "data": { "apiToken": { "id": "9a7e2c1d-4f60-4b2e-8d1a-6c3b5e7f9a20", "name": "deploy script", "prefix": "vpt_3J9cX0r", "scopes": ["read", "deploy"], "expiresAt": "2027-11-10T09:30:00.000Z", "lastUsedAt": null, "useCount": 0, "revokedAt": null, "createdAt": "2026-11-10T09:30:00.000Z" }, "token": "vpt_3J9cX0rQ…" }, "message": "API token created. Copy it now: it is not shown again.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Called with an API token, or the scopes cover none of your permissions. | | 409 | `TOO_MANY_TOKENS` | You already have 25 active tokens. | | 422 | `VALIDATION_ERROR` | No scopes, an unknown scope, or `expiresInDays` out of range. | ## Revoke a token `POST /api/v1/api-tokens/:id/revoke` — Auth: session Revokes a token immediately. You can revoke your own tokens; revoking someone else's needs `users.manage`. Revoking a revoked token changes nothing. Like creating, this is done from a browser session. **Example request** ```bash curl -X POST https://panel.example.com/api/v1/api-tokens/9a7e2c1d-4f60-4b2e-8d1a-6c3b5e7f9a20/revoke \ -b cookies.txt -H "X-CSRF-Token: $CSRF_TOKEN" ``` **Response** `200 OK` with the token, now with `revokedAt` set. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Called with an API token, or the token is someone else's and you lack `users.manage`. | | 404 | `NOT_FOUND` | No such token. | --- # Users and roles URL: https://docs.vaultpanel.net/api-reference/users-and-roles > API reference for panel users (invite, update, deactivate, reset links and two-factor resets), the built-in roles and the audit log. Staff accounts are managed under `/users`, roles are read from `/roles` and the audit log from `/audit-logs`. Hosting customers are accounts too, but they are created and managed under [Hosting](https://docs.vaultpanel.net/api-reference/hosting); `/users` leaves them out unless you filter by the `customer` role. ## Roles and rank Every user has one role. Routes check permissions, never role names. A role's **rank** decides who may manage whom: you can only assign roles at or below your own rank, and you cannot manage a user whose role ranks above yours. | Role | Rank | What it is for | | --- | --- | --- | | `owner` | 40 | Full control of the panel, including other owners and the server terminal | | `admin` | 30 | Manage servers, users (except owners) and settings | | `developer` | 20 | View most things, deploy and restart apps and containers, back up, run cron jobs and routine operations, work on website files, and ask the AI assistant | | `viewer` | 10 | Read-only access, and the AI assistant | | `customer` | 5 | A hosting customer, limited to their own account. Given only by creating a customer | [`GET /roles`](https://docs.vaultpanel.net/api-reference/users-and-roles#list-roles) returns each role's exact permissions. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles) for the full permission list. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/users` | [List users](https://docs.vaultpanel.net/api-reference/users-and-roles#list-users) | | POST | `/api/v1/users` | [Invite a user](https://docs.vaultpanel.net/api-reference/users-and-roles#invite-a-user) | | GET | `/api/v1/users/:id` | [Get a user](https://docs.vaultpanel.net/api-reference/users-and-roles#get-a-user) | | PATCH | `/api/v1/users/:id` | [Update a user](https://docs.vaultpanel.net/api-reference/users-and-roles#update-a-user) | | POST | `/api/v1/users/:id/password-reset` | [Issue a password reset link](https://docs.vaultpanel.net/api-reference/users-and-roles#issue-a-password-reset-link) | | POST | `/api/v1/users/:id/2fa/reset` | [Reset two-factor sign-in](https://docs.vaultpanel.net/api-reference/users-and-roles#reset-two-factor-sign-in) | | GET | `/api/v1/roles` | [List roles](https://docs.vaultpanel.net/api-reference/users-and-roles#list-roles) | | GET | `/api/v1/audit-logs` | [List audit log entries](https://docs.vaultpanel.net/api-reference/users-and-roles#list-audit-log-entries) | ## The user object ```json { "id": "7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94", "email": "grace@example.com", "name": "Grace Hopper", "isActive": true, "twoFactorEnabled": false, "roles": ["developer"], "lastLoginAt": "2026-11-09T16:20:11.000Z", "createdAt": "2026-10-21T10:00:00.000Z", "updatedAt": "2026-11-09T16:20:11.000Z" } ``` ## List users `GET /api/v1/users` — Permission: users.read — Token scope: read Staff accounts, newest first. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches email or name. | | `status` | string | No | `active` or `inactive`. | | `role` | string | No | `owner`, `admin`, `developer`, `viewer` or `customer`. Without it, customers are left out. | | `sort` | string | No | `createdAt` (default), `email`, `name` or `lastLoginAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/users?status=active&role=developer" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, pagination } = await panel.users.list({ status: 'active', role: 'developer' }); ``` **Response** `200 OK`: `{ items: [user], pagination }`. ## Invite a user `POST /api/v1/users` — Permission: users.manage — Token scope: full Creates an account with no usable password and returns a one-time invite link, valid for 72 hours, where the person chooses their password. When [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email) is set up the link is also emailed; it is returned either way, to hand over if the email does not arrive. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Must not belong to another user. | | `name` | string | Yes | 1 to 120 characters. | | `role` | string | Yes | `owner`, `admin`, `developer` or `viewer`, at or below your own role. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/users \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"email":"grace@example.com","name":"Grace Hopper","role":"developer"}' ``` **JavaScript** ```js const { user, inviteUrl, email } = await panel.users.invite({ email: 'grace@example.com', name: 'Grace Hopper', role: 'developer', }); ``` **Response** `201 Created` ```json { "success": true, "data": { "user": { "id": "7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94", "email": "grace@example.com", "name": "Grace Hopper", "isActive": true, "twoFactorEnabled": false, "roles": ["developer"], "lastLoginAt": null, "createdAt": "…", "updatedAt": "…" }, "inviteUrl": "https://panel.example.com/reset-password#token=…", "inviteExpiresAt": "2026-11-13T09:30:00.000Z", "email": { "to": "grace@example.com", "sent": true } }, "message": "User created. The invite link was emailed to grace@example.com.", "requestId": "…" } ``` `email` is `null` when panel email is not set up, or `{ to, sent: false, error }` when sending failed. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | You lack `users.manage`, the role ranks above yours, or the role is `customer`. | | 409 | `CONFLICT` | A user with this email already exists. | | 422 | `VALIDATION_ERROR` | A field is invalid. | ## Get a user `GET /api/v1/users/:id` — Permission: users.read — Token scope: read **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/users/7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const user = await panel.users.get(userId); ``` **Response** `200 OK` with the user object. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such user. | ## Update a user `PATCH /api/v1/users/:id` — Permission: users.manage — Token scope: full Renames a user, changes their role, or deactivates or reactivates them. Changing the role or deactivating signs the user out of every session at once, so the change applies immediately. Send at least one field. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | 1 to 120 characters. | | `role` | string | No | `owner`, `admin`, `developer` or `viewer`, at or below your own role. | | `isActive` | boolean | No | `false` deactivates the account. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/users/7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"isActive":false}' ``` **JavaScript** ```js const user = await panel.users.update(userId, { isActive: false }); ``` **Response** `200 OK` with the updated user object. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | The user's role ranks above yours, the new role does, or you tried to change your own role or deactivate yourself. | | 404 | `NOT_FOUND` | No such user. | | 409 | `CUSTOMER_ACCOUNT` | It is a hosting customer. Manage it under [Hosting](https://docs.vaultpanel.net/api-reference/hosting). | | 409 | `LAST_OWNER` | The change would leave the panel without an active owner. | | 422 | `VALIDATION_ERROR` | No fields, or an invalid one. | ## Issue a password reset link `POST /api/v1/users/:id/password-reset` — Permission: users.manage — Token scope: full Makes a one-time reset link for a user, valid for 2 hours, and emails it when panel email is set up. Use it when someone forgot their password and the panel cannot send email. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/users/7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94/password-reset \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { resetUrl, expiresAt } = await panel.request('POST', `/users/${userId}/password-reset`); ``` **Response** `200 OK` ```json { "success": true, "data": { "resetUrl": "https://panel.example.com/reset-password#token=…", "expiresAt": "2026-11-10T11:30:00.000Z", "email": null }, "message": "Reset link created. Send them the link.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | The user's role ranks above yours. | | 404 | `NOT_FOUND` | No such user. | ## Reset two-factor sign-in `POST /api/v1/users/:id/2fa/reset` — Permission: users.manage — Token scope: full For someone who lost their authenticator and their recovery codes. Turns two-factor sign-in off for the user, deletes their recovery codes and signs them out everywhere. They sign in with their password alone and can set it up again. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/users/7b1e4d2a-9c3f-4e8b-a5d6-0f2c8e1b3a94/2fa/reset \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const user = await panel.request('POST', `/users/${userId}/2fa/reset`); ``` **Response** `200 OK` with the user object, `twoFactorEnabled: false`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | It is your own account. Turn it off on your account page instead. | | 403 | `FORBIDDEN` | The user's role ranks above yours. | | 404 | `NOT_FOUND` | No such user. | | 409 | `TWO_FACTOR_OFF` | Two-factor sign-in is already off for this user. | ## List roles `GET /api/v1/roles` — Permission: roles.read — Token scope: read Every role with its permissions and how many users have it, plus the description of every permission. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/roles \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { roles, permissions } = await panel.users.roles(); ``` **Response** `200 OK` ```json { "success": true, "data": { "roles": [ { "name": "viewer", "description": "Read-only access to servers, websites, DNS zones, email, apps, containers, databases, backups, cron jobs and jobs, and the AI assistant", "rank": 10, "isSystem": true, "userCount": 3, "permissions": ["alerts.read", "applications.read", "assistant.use", "backups.read", "containers.read", "cron.read", "dashboard.view", "databases.read", "dns.read", "jobs.read", "mail.read", "servers.read", "websites.read"] } ], "permissions": [ { "key": "dashboard.view", "description": "View the dashboard" }, { "key": "users.read", "description": "View users and their roles" } ] }, "message": "OK", "requestId": "…" } ``` Roles are listed by rank, highest first. ## List audit log entries `GET /api/v1/audit-logs` — Permission: audit.read — Token scope: logs The audit log, newest first. Every change, sign-in, permission denial and API token call is recorded with who did it, from where and with which request id. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `action` | string | No | An action or its prefix: `website.` matches `website.create`, `website.delete` and so on. | | `actorId` | string | No | The id of the user (or other actor) who acted. | | `targetType` | string | No | Such as `website`, `server` or `user`. | | `targetId` | string | No | The id of the record acted on. | | `result` | string | No | `success`, `failure` or `denied`. | | `from`, `to` | string | No | ISO 8601 date-times bounding `occurredAt`. | | `sort` | string | No | `occurredAt` (default) or `action`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/audit-logs?action=auth.&result=failure&from=2026-11-01T00:00:00Z" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.auditLog.list({ action: 'auth.', result: 'failure', from: '2026-11-01T00:00:00Z' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": 18342, "occurredAt": "2026-11-10T08:41:09.000Z", "actor": { "type": "anonymous", "id": null, "label": "ada@example.com" }, "action": "auth.login", "target": { "type": "user", "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "label": "ada@example.com" }, "result": "failure", "ip": "198.51.100.24", "userAgent": "Mozilla/5.0 …", "requestId": "6f1c2a4e-1b7d-4c55-9a0e-3d2f8b7c9e10", "metadata": { "reason": "bad_password" } } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` `target` is `null` for actions without one. `metadata` holds details that depend on the action; passwords, environment values and file contents never appear in it. See [Audit log](https://docs.vaultpanel.net/guides/security/audit-log). --- # Panel settings URL: https://docs.vaultpanel.net/api-reference/settings > API reference for the panel's own settings - putting the panel on a domain, its address, and the email it sends for invites, password resets and alerts. `/settings` holds the settings of the panel itself: the domain it is served on and the email it sends. Everything here needs `settings.manage` (owners and admins); with an API token, only the `full` scope grants it. Other panel-wide settings live with their feature: [panel access, the two-factor policy and sessions](https://docs.vaultpanel.net/api-reference/security), [backup storage](https://docs.vaultpanel.net/api-reference/backups) and [the AI assistant](https://docs.vaultpanel.net/api-reference/assistant). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/settings/panel-domain` | [Get the panel domain](https://docs.vaultpanel.net/api-reference/settings#get-the-panel-domain) | | PUT | `/api/v1/settings/panel-domain` | [Put the panel on a domain](https://docs.vaultpanel.net/api-reference/settings#put-the-panel-on-a-domain) | | PUT | `/api/v1/settings/panel-domain/address` | [Use the domain as the panel's address](https://docs.vaultpanel.net/api-reference/settings#use-the-domain-as-the-panels-address) | | DELETE | `/api/v1/settings/panel-domain` | [Take the panel off its domain](https://docs.vaultpanel.net/api-reference/settings#take-the-panel-off-its-domain) | | GET | `/api/v1/settings/email` | [Get the email settings](https://docs.vaultpanel.net/api-reference/settings#get-the-email-settings) | | PUT | `/api/v1/settings/email` | [Save the email settings](https://docs.vaultpanel.net/api-reference/settings#save-the-email-settings) | | POST | `/api/v1/settings/email/test` | [Send a test email](https://docs.vaultpanel.net/api-reference/settings#send-a-test-email) | | GET | `/api/v1/settings/email/messages` | [List sent email](https://docs.vaultpanel.net/api-reference/settings#list-sent-email) | ## Get the panel domain `GET /api/v1/settings/panel-domain` — Permission: settings.manage — Token scope: full The panel is put on a domain by a reverse-proxy website on **This server**, the server the panel runs on, which sends the domain's requests to the panel's port (its plain HTTP loopback port when the panel serves HTTPS itself). This returns that state: | Field | Description | | --- | --- | | `domain` | The panel's domain, or `null`. | | `removing` | Taking it off the domain was asked and is not finished (or failed). | | `website` | The website that serves the domain, with its certificate under `ssl`. Certificates are managed through [Websites](https://docs.vaultpanel.net/api-reference/websites). | | `server` | **This server**: `{ id, name, status, publicIp, ipAddresses, webStack }`, or `null` when it is not connected. | | `defaultPort` | The port the website proxies to unless another is given. | | `address` | `{ current, environment, usesDomain, canUseDomain }`: the panel's address now, the one in its `.env`, whether the domain is the address, and whether it can be (the website is active with a trusted, non-staging certificate). | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/panel-domain \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const state = await panel.request('GET', '/settings/panel-domain'); ``` **Response** `200 OK` ```json { "success": true, "data": { "domain": "cp.example.com", "removing": false, "website": { "id": "5d6e7f8a-…", "type": "proxy", "primaryDomain": "cp.example.com", "proxyPort": 8091, "status": "active" }, "server": { "id": "9b2e7c1a-…", "name": "This server", "status": "online", "publicIp": "203.0.113.10", "ipAddresses": ["203.0.113.10"], "webStack": {} }, "defaultPort": 8091, "address": { "current": "https://203.0.113.10:8090", "environment": "https://203.0.113.10:8090", "usesDomain": false, "canUseDomain": true } }, "message": "OK", "requestId": "…" } ``` ## Put the panel on a domain `PUT /api/v1/settings/panel-domain` — Permission: settings.manage — Token scope: full Creates the panel's website on **This server** for the domain, or moves it to another domain or port. Point the domain's DNS at the server first, and install the web stack (NGINX and Certbot) on it. Moving to another domain sets the panel's address back to the one in `.env` until the new domain has a certificate. Then issue a certificate for the website and [use the domain as the address](https://docs.vaultpanel.net/api-reference/settings#use-the-domain-as-the-panels-address). See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `domain` | string | Yes | Such as `cp.example.com`. | | `proxyPort` | integer | No | 1 to 65535. Default `defaultPort`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/panel-domain \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "domain": "cp.example.com" }' ``` **JavaScript** ```js const { job } = await panel.request('PUT', '/settings/panel-domain', { body: { domain: 'cp.example.com' } }); if (job) await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` with the state and the website's `job` (message `The agent is putting the panel on the domain`), or `200 OK` with `job: null` when nothing changed (message `Nothing to change`). **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `NO_LOCAL_SERVER` | The panel's own server is not connected as **This server**. | | 409 | `PANEL_WEBSITE_FAILED` | Setting up the current domain failed: send the same domain to try again, or remove it first. | | 422 | `VALIDATION_ERROR` | An invalid domain or port, or the website could not be created with them. | ## Use the domain as the panel's address `PUT /api/v1/settings/panel-domain/address` — Permission: settings.manage — Token scope: full Makes `https://` the panel's address, so agent install commands, password reset links and deploy webhooks use it; or goes back to the address in `.env`. The IP address keeps working either way. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `use` | boolean | Yes | `true` uses the domain; `false` goes back to the `.env` address. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/panel-domain/address \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "use": true }' ``` **JavaScript** ```js await panel.request('PUT', '/settings/panel-domain/address', { body: { use: true } }); ``` **Response** `200 OK`: the state, message `The panel's address is now …`. **Errors**: `409 PANEL_DOMAIN_NOT_READY` when the domain has no trusted certificate yet (a staging one does not count: agents on other servers refuse untrusted certificates). ## Take the panel off its domain `DELETE /api/v1/settings/panel-domain` — Permission: settings.manage — Token scope: full Removes the panel's website (its NGINX configuration and certificate) from **This server** and sets the address back to the one in `.env`. The IP address keeps working. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/panel-domain \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('DELETE', '/settings/panel-domain'); ``` **Response** `200 OK`: the state with `removing: true` and the website's `job`, message `The panel is being taken off its domain`. ## Get the email settings `GET /api/v1/settings/email` — Permission: settings.manage — Token scope: full The SMTP server the panel sends its own email through: invites, password reset links and alert emails. The password is never returned (`hasPassword`). `missing` says what is still needed, and `ready` whether email is on and complete. See [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/email \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const settings = await panel.request('GET', '/settings/email'); ``` **Response** `200 OK` ```json { "success": true, "data": { "enabled": true, "host": "smtp.example.com", "port": 587, "security": "starttls", "username": "panel@example.com", "hasPassword": true, "fromAddress": "panel@example.com", "fromName": "VaultPanel", "alerts": { "events": ["backup.failed", "restore.failed", "cron.failed", "deployment.failed", "alert.firing", "server.offline"], "toAdmins": true, "extra": [] }, "missing": null, "ready": true, "updatedAt": "2026-11-08T10:00:00.000Z" }, "message": "OK", "requestId": "…" } ``` ## Save the email settings `PUT /api/v1/settings/email` — Permission: settings.manage — Token scope: full Saves any of the fields; the rest keep their values. Changing the host forgets the saved password unless a new one is given. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | No | Send email. Needs a host, port and from address (and a password with a username). | | `host` | string | No | The SMTP host name or IP address, without scheme or port. | | `port` | integer | No | 1 to 65535. | | `security` | string | No | `tls` (encrypted from the start, usually 465), `starttls` (required upgrade, usually 587) or `none` (only for a mail server on the same machine or network). | | `username` | string or null | No | Up to 254 characters. | | `password` | string or null | No | Sets the password; `null` or empty removes it; leaving it out keeps it. | | `fromAddress` | string | No | The address emails come from. | | `fromName` | string | No | Up to 100 characters. Default `VaultPanel`. | | `alerts` | object | No | `events` (the [webhook events](https://docs.vaultpanel.net/api-reference/webhooks#events) to email), `toAdmins` (send them to owners and admins) and `extra` (up to 10 more addresses). | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/email \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "host": "smtp.example.com", "port": 587, "security": "starttls", "username": "panel@example.com", "password": "'"$SMTP_PASSWORD"'", "fromAddress": "panel@example.com" }' ``` **JavaScript** ```js await panel.request('PUT', '/settings/email', { body: { alerts: { events: ['backup.failed', 'server.offline'], extra: ['oncall@example.com'] } }, }); ``` **Response** `200 OK`: the settings, message `Email settings saved`. **Errors**: `422 VALIDATION_ERROR` when turning email on with a setting missing, or an invalid field. ## Send a test email `POST /api/v1/settings/email/test` — Permission: settings.manage — Token scope: full Sends a test email now, with the saved settings or with settings being edited (merged over the saved ones, not saved). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `to` | string | Yes | Who receives it. | | `settings` | object | No | Any of `host`, `port`, `security`, `username`, `password`, `fromAddress` and `fromName` to try. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/settings/email/test \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "to": "owner@example.com" }' ``` **JavaScript** ```js const { message } = await panel.request('POST', '/settings/email/test', { body: { to: 'owner@example.com' } }); ``` **Response** `200 OK`: `{ message }`, the sent email (as in [List sent email](https://docs.vaultpanel.net/api-reference/settings#list-sent-email)), message `Test email sent to owner@example.com`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `EMAIL_NOT_SET_UP` | A setting is missing; the message says which. | | 502 | `EMAIL_SEND_FAILED` | The mail server refused it or could not be reached; the message explains why. | ## List sent email `GET /api/v1/settings/email/messages` — Permission: settings.manage — Token scope: full The most recent email the panel sent or is trying to send, newest first. Messages that fail are retried after 1, 5 and 30 minutes, and are kept for 30 days. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `limit` | integer | No | 1 to 200. Default 50. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/settings/email/messages?limit=20" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/settings/email/messages', { query: { limit: 20 } }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "f1e2d3c4-…", "to": "ada@example.org", "subject": "Your VaultPanel account", "purpose": "invite", "event": null, "status": "sent", "attempts": 1, "error": null, "nextAttemptAt": null, "sentAt": "2026-11-10T12:00:03.000Z", "createdAt": "2026-11-10T12:00:02.000Z" } ] }, "message": "OK", "requestId": "…" } ``` --- # Servers URL: https://docs.vaultpanel.net/api-reference/servers > API reference for servers, enrollment tokens and agent install commands, metrics history, agent updates, terminal sessions and the dashboard summary. A server is a machine the panel manages through its agent. Adding one creates a record in `pending` state and a one-time enrollment token; the server becomes `online` once its agent registers and reports in. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). Operations on a server (restarting a service, rebooting, listing processes) are queued as jobs with [`POST /servers/:id/jobs`](https://docs.vaultpanel.net/api-reference/jobs#queue-an-operation). ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/servers` | [List servers](https://docs.vaultpanel.net/api-reference/servers#list-servers) | | POST | `/api/v1/servers` | [Add a server](https://docs.vaultpanel.net/api-reference/servers#add-a-server) | | GET | `/api/v1/servers/:id` | [Get a server](https://docs.vaultpanel.net/api-reference/servers#get-a-server) | | PATCH | `/api/v1/servers/:id` | [Rename a server](https://docs.vaultpanel.net/api-reference/servers#rename-a-server) | | DELETE | `/api/v1/servers/:id` | [Remove a server](https://docs.vaultpanel.net/api-reference/servers#remove-a-server) | | POST | `/api/v1/servers/:id/enrollment-tokens` | [Create an enrollment token](https://docs.vaultpanel.net/api-reference/servers#create-an-enrollment-token) | | GET | `/api/v1/servers/:id/metrics` | [Get metrics history](https://docs.vaultpanel.net/api-reference/servers#get-metrics-history) | | POST | `/api/v1/servers/:id/jobs` | [Queue an operation](https://docs.vaultpanel.net/api-reference/jobs#queue-an-operation) (on the Jobs page) | | PUT | `/api/v1/servers/:id/groups` | [Set a server's groups](https://docs.vaultpanel.net/api-reference/servers#set-a-servers-groups) | | POST | `/api/v1/servers/:id/agent-update` | [Update the agent](https://docs.vaultpanel.net/api-reference/servers#update-the-agent) | | POST | `/api/v1/servers/:id/terminal` | [Open a terminal](https://docs.vaultpanel.net/api-reference/servers#open-a-terminal) | | GET | `/api/v1/terminal-sessions` | [List terminal sessions](https://docs.vaultpanel.net/api-reference/servers#list-terminal-sessions) | | GET | `/api/v1/terminal-sessions/:id` | [Get a terminal session](https://docs.vaultpanel.net/api-reference/servers#get-a-terminal-session) | | GET | `/api/v1/terminal-sessions/:id/recording` | [Download a recording](https://docs.vaultpanel.net/api-reference/servers#download-a-recording) | | DELETE | `/api/v1/terminal-sessions/:id` | [Delete a recording](https://docs.vaultpanel.net/api-reference/servers#delete-a-recording) | | GET | `/api/v1/terminal-sessions/settings` | [Get recording settings](https://docs.vaultpanel.net/api-reference/servers#get-recording-settings) | | PUT | `/api/v1/terminal-sessions/settings` | [Change recording settings](https://docs.vaultpanel.net/api-reference/servers#change-recording-settings) | | GET | `/api/v1/dashboard` | [Get the dashboard summary](https://docs.vaultpanel.net/api-reference/servers#get-the-dashboard-summary) | ## The server object ```json { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "status": "online", "isLocal": false, "hostname": "web-1", "publicIp": "203.0.113.10", "os": { "name": "Ubuntu", "version": "24.04", "kernel": "6.8.0-48-generic", "architecture": "x64" }, "cpuCores": 4, "memoryTotalBytes": 8336568320, "diskTotalBytes": 168488570880, "uptimeSeconds": 1209600, "timezone": "Etc/UTC", "agentVersion": "0.41.0", "lastSeenAt": "2026-11-10T11:05:30.000Z", "services": [ { "name": "nginx", "loadState": "loaded", "active": "active", "sub": "running", "enabled": "enabled", "description": "A high performance web server and a reverse proxy server" } ], "filesystems": [{ "mount": "/", "device": "/dev/sda1", "fsType": "ext4", "totalBytes": 168488570880, "usedBytes": 41203298304 }], "agentOperations": ["SERVICE_STATUS", "SERVICE_RESTART", "PROCESS_LIST", "SERVER_REBOOT"], "webStack": { "nginx": true, "certbot": true, "git": true, "mariadb": true, "phpVersions": ["8.3"] }, "selfCheck": null, "ipAddresses": ["203.0.113.10"], "customerDns": { "nameservers": [], "autoZones": false }, "createdAt": "2026-10-20T08:10:00.000Z", "updatedAt": "2026-11-10T11:05:30.000Z" } ``` | Field | Description | | --- | --- | | `status` | `pending` (no agent yet), `online`, `offline` (the agent stopped reporting) or `disabled`. | | `isLocal` | The server the panel itself runs on, connected automatically. | | `services`, `filesystems` | The agent's latest snapshot, sent with every heartbeat. | | `agentOperations` | The operations this agent reports it supports. Queuing anything else answers `409 AGENT_OUTDATED`. | | `webStack` | What the agent found installed, such as NGINX, Certbot, Git, MariaDB and the PHP versions. The example shows some of its fields. `null` until reported. | | `selfCheck` | The agent's last [self-check](https://docs.vaultpanel.net/guides/servers/self-check) report (agent 0.39.0 and later), or `null`. | | `timezone` | The server's own time zone, which cron jobs run in. | | `customerDns` | The name servers hosting customers on this server are shown, and whether their domains get DNS zones automatically. | ## List servers `GET /api/v1/servers` — Permission: servers.read — Token scope: read Servers, newest first, each with its latest metrics, its groups and whether a newer agent is available. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches name, host name or public IP. | | `status` | string | No | `pending`, `online`, `offline` or `disabled`. | | `groupId` | string | No | Only servers in this [group](https://docs.vaultpanel.net/api-reference/server-groups). | | `sort` | string | No | `createdAt` (default), `name` or `lastSeenAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/servers?status=online" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.servers.list({ status: 'online' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "status": "online", "latestMetrics": { "collectedAt": "2026-11-10T11:05:30.000Z", "cpuPercent": 12.4, "load": [0.42, 0.38, 0.35], "memoryUsedBytes": 3221225472, "memoryTotalBytes": 8336568320, "swapUsedBytes": 0, "swapTotalBytes": 2147483648, "diskUsedBytes": 41203298304, "diskTotalBytes": 168488570880, "netRxBytesPerSec": 18234, "netTxBytesPerSec": 9120, "processCount": 187, "uptimeSeconds": 1209600 }, "groups": [{ "id": "c2d4…", "name": "Production", "color": "green" }], "agentUpdateAvailable": false } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` Each item carries every field of [the server object](https://docs.vaultpanel.net/api-reference/servers#the-server-object); the example shows only the fields lists add. ## Add a server `POST /api/v1/servers` — Permission: servers.manage — Token scope: servers Creates a server record and its first enrollment token. Run the returned install command on the server, as root, to install and register the agent. The token is valid for 60 minutes by default (`VAULTPANEL_ENROLLMENT_TTL_MINUTES`) and only once. When the panel serves its own self-signed certificate, the command carries the certificate's public key pin, so the agent trusts exactly that certificate. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | 1 to 100 letters, numbers, spaces and `. _ - ( )`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/servers \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"name":"web-2"}' ``` **JavaScript** ```js const { server, enrollment } = await panel.servers.create({ name: 'web-2' }); console.log(enrollment.installCommand); ``` **Response** `201 Created` ```json { "success": true, "data": { "server": { "id": "4d8e2f1a-6b3c-4a5d-8e9f-1a2b3c4d5e6f", "name": "web-2", "status": "pending", "agentVersion": null, "createdAt": "…" }, "enrollment": { "token": "vpe_…", "expiresAt": "2026-11-10T12:10:00.000Z", "installCommand": "curl -fsSL --pinnedpubkey 'sha256//…' -k https://panel.example.com/api/v1/agent/install.sh | sudo bash -s -- --panel https://panel.example.com --token vpe_… --panel-pin 'sha256//…'" } }, "message": "Server added. Run the install command on it to connect the agent.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | You lack `servers.manage`. | | 422 | `VALIDATION_ERROR` | The name is missing or has characters that are not allowed. | ## Get a server `GET /api/v1/servers/:id` — Permission: servers.read — Token scope: read The server with its latest metrics, groups, registered agent, any unused enrollment token and agent update information. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const server = await panel.servers.get(serverId); ``` **Response** `200 OK`. [The server object](https://docs.vaultpanel.net/api-reference/servers#the-server-object) plus: ```json { "latestMetrics": { "collectedAt": "…", "cpuPercent": 12.4 }, "groups": [{ "id": "c2d4…", "name": "Production", "color": "green" }], "agent": { "id": "b7c8…", "keyFingerprint": "SHA256:…", "version": "0.40.0", "registeredAt": "2026-10-20T08:12:44.000Z", "registeredIp": "203.0.113.10", "lastSeenAt": "2026-11-10T11:05:30.000Z" }, "pendingEnrollment": null, "agentUpdate": { "currentVersion": "0.40.0", "latestVersion": "0.41.0", "fromPanel": true, "command": "curl -fsSL … | sudo bash -s -- --upgrade --panel https://panel.example.com …" } } ``` `agentUpdate` is `null` when the agent is current. `fromPanel` says whether [Update the agent](https://docs.vaultpanel.net/api-reference/servers#update-the-agent) can do it; otherwise run `command` on the server. `pendingEnrollment` holds the expiry of an unused token. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | ## Rename a server `PATCH /api/v1/servers/:id` — Permission: servers.manage — Token scope: servers **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | 1 to 100 letters, numbers, spaces and `. _ - ( )`. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"name":"web-1 (Frankfurt)"}' ``` **JavaScript** ```js const server = await panel.servers.update(serverId, { name: 'web-1 (Frankfurt)' }); ``` **Response** `200 OK` with the server, as from [Get a server](https://docs.vaultpanel.net/api-reference/servers#get-a-server). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | | 422 | `VALIDATION_ERROR` | The name is invalid. | ## Remove a server `DELETE /api/v1/servers/:id` — Permission: servers.manage — Token scope: servers Removes the server from the panel, revokes its agent, invalidates its enrollment tokens and cancels its queued jobs. Nothing on the server itself is touched; the agent stops working once revoked. **Example request** **cURL** ```bash curl -X DELETE https://panel.example.com/api/v1/servers/4d8e2f1a-6b3c-4a5d-8e9f-1a2b3c4d5e6f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.servers.remove(serverId); ``` **Response** `200 OK` ```json { "success": true, "data": null, "message": "Server removed and its agent revoked", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | ## Create an enrollment token `POST /api/v1/servers/:id/enrollment-tokens` — Permission: servers.manage — Token scope: servers Issues a new enrollment token and install command for a server, for example when the first one expired. Only the newest token works: older unused ones stop working. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/servers/4d8e2f1a-6b3c-4a5d-8e9f-1a2b3c4d5e6f/enrollment-tokens \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { token, expiresAt, installCommand } = await panel.servers.enrollmentToken(serverId); ``` **Response** `201 Created` ```json { "success": true, "data": { "token": "vpe_…", "expiresAt": "2026-11-10T12:20:00.000Z", "installCommand": "curl -fsSL … | sudo bash -s -- --panel https://panel.example.com --token vpe_…" }, "message": "New enrollment token created; older ones no longer work", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | ## Get metrics history `GET /api/v1/servers/:id/metrics` — Permission: servers.read — Token scope: read CPU, memory, swap, disk, network and process history. Short ranges return the agent's raw 15-second samples, averaged down to at most 240 points. Long ranges return hourly rollups, which add the hour's highest CPU and the number of samples. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `range` | string | No | `1h` (default), `6h`, `24h` (raw), or `7d`, `30d`, `90d` (hourly). | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b/metrics?range=7d" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { resolution, points } = await panel.servers.metrics(serverId, { range: '7d' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "range": "7d", "resolution": "hour", "points": [ { "collectedAt": "2026-11-03T12:00:00.000Z", "cpuPercent": 9.8, "cpuPercentMax": 41.2, "samples": 240, "load": [0.31, 0.29, 0.27], "memoryUsedBytes": 3105423360, "memoryTotalBytes": 8336568320, "swapUsedBytes": 0, "swapTotalBytes": 2147483648, "diskUsedBytes": 40961949696, "diskTotalBytes": 168488570880, "netRxBytesPerSec": 15022, "netTxBytesPerSec": 8411, "processCount": 184, "uptimeSeconds": null } ] }, "message": "OK", "requestId": "…" } ``` `resolution` is `raw` for `1h`, `6h` and `24h`, and `hour` otherwise. Raw points have no `cpuPercentMax` or `samples`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | | 422 | `VALIDATION_ERROR` | `range` is not one of the values above. | ## Set a server's groups `PUT /api/v1/servers/:id/groups` — Permission: servers.manage — Token scope: servers Replaces the list of [groups](https://docs.vaultpanel.net/api-reference/server-groups) a server is in. An empty list takes it out of every group. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `groupIds` | string[] | Yes | Up to 50 group ids. | **Example request** **cURL** ```bash curl -X PUT https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b/groups \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"groupIds":["c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e"]}' ``` **JavaScript** ```js const groups = await panel.request('PUT', `/servers/${serverId}/groups`, { body: { groupIds: [groupId] } }); ``` **Response** `200 OK` ```json { "success": true, "data": [{ "id": "c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e", "name": "Production", "color": "green" }], "message": "Groups saved", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | One of the groups was not found. | | 422 | `VALIDATION_ERROR` | The server was not found, or an id is not a UUID. | ## Update the agent `POST /api/v1/servers/:id/agent-update` — Permission: servers.manage — Token scope: servers Queues an `AGENT_UPDATE` job that installs the agent version this panel serves, checked against its SHA-256. Agents 0.7.0 and later can update themselves this way; older agents need the `agentUpdate.command` from [Get a server](https://docs.vaultpanel.net/api-reference/servers#get-a-server) run on the server. To update many servers at once, use a [bulk action](https://docs.vaultpanel.net/api-reference/server-groups#start-a-bulk-action). **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b/agent-update \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.servers.updateAgent(serverId); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` with the [job](https://docs.vaultpanel.net/api-reference/jobs#the-job-object), message `Agent update queued`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such server. | | 409 | `AGENT_CURRENT` | The agent is already on the newest version. | | 409 | `AGENT_OUTDATED` | The agent is too old to update itself. Run the upgrade command on the server. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `DUPLICATE_OPERATION` | An update is already queued or running (`details.jobId`). | ## Open a terminal `POST /api/v1/servers/:id/terminal` — Auth: session — Permission: servers.terminal Issues a one-time ticket for a root terminal on the server. The browser then opens a WebSocket at the returned `path` within 30 seconds. Only owners have `servers.terminal`, and the terminal opens only from a browser session: API tokens, plugins and the AI assistant are always refused. Every session is audited and, by default, recorded. Needs agent 0.11.0 or later. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `cols` | integer | No | Terminal width, 2 to 1000. Default 80. | | `rows` | integer | No | Terminal height, 2 to 500. Default 24. | **Example request** ```js const res = await fetch(`/api/v1/servers/${serverId}/terminal`, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': csrfToken }, body: JSON.stringify({ cols: 120, rows: 32 }), }); const { data } = await res.json(); const socket = new WebSocket(`wss://${location.host}${data.path}`); ``` **Response** `201 Created` ```json { "success": true, "data": { "ticket": "…", "path": "/api/v1/terminal/connect?ticket=…", "expiresInSeconds": 30 }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | You are not an owner, or the request did not come from a browser session. | | 404 | `NOT_FOUND` | No such server. | | 409 | `SERVER_OFFLINE` | The server is not online. | | 409 | `AGENT_TOO_OLD` | The agent is older than 0.11.0. | | 409 | `TERMINAL_NOT_CONNECTED` | The agent has not connected its terminal channel yet. Try again in a few seconds. | | 409 | `TERMINAL_DISABLED` | The terminal is turned off on this server. | | 429 | `TOO_MANY_TERMINALS` | 5 terminals are open on this server, or 10 are open for you. | ## Terminal sessions Past terminal sessions and their recordings, in [asciicast](https://docs.asciinema.org/manual/asciicast/v2/) format. Like the terminal itself these need `servers.terminal`, so in practice an owner's browser session. See [Terminal](https://docs.vaultpanel.net/guides/servers/terminal). ### The session object ```json { "id": "e3f1a2b4-…", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "userId": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "userLabel": "ada@example.com", "ip": "198.51.100.24", "cols": 120, "rows": 32, "startedAt": "2026-11-10T10:00:02.000Z", "endedAt": "2026-11-10T10:12:47.000Z", "seconds": 765, "exitCode": 0, "endReason": "exit", "outputBytes": 48211, "recording": "output", "recordingBytes": 51002, "recordingTruncated": false } ``` `recording` is `off`, `output` or `output_input` (keystrokes too). ## List terminal sessions `GET /api/v1/terminal-sessions` — Auth: session — Permission: servers.terminal **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `page`, `pageSize` | integer | No | Paging, as for other lists. | | `serverId` | string | No | Sessions on one server. | | `userId` | string | No | Sessions of one person. | **Response** `200 OK`: `{ items: [session], pagination }`. ## Get a terminal session `GET /api/v1/terminal-sessions/:id` — Auth: session — Permission: servers.terminal **Response** `200 OK` with the session object. `404 NOT_FOUND` when there is no such session. ## Download a recording `GET /api/v1/terminal-sessions/:id/recording` — Auth: session — Permission: servers.terminal Streams the recording as `application/x-asciicast`. Add `?download=1` to receive it as an attachment named after the server and start time. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such session, it was not recorded, or the file was removed after the retention period. | ## Delete a recording `DELETE /api/v1/terminal-sessions/:id` — Auth: session — Permission: servers.terminal Deletes a closed session's recording. **Response** `200 OK` with `data: null`, message `Recording deleted`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such session. | | 409 | `SESSION_OPEN` | The session is still open. | ## Get recording settings `GET /api/v1/terminal-sessions/settings` — Auth: session — Permission: servers.terminal **Response** `200 OK` ```json { "success": true, "data": { "enabled": true, "recordInput": false, "retentionDays": 90, "maxSizeMb": 50 }, "message": "OK", "requestId": "…" } ``` The values shown are the defaults. ## Change recording settings `PUT /api/v1/terminal-sessions/settings` — Auth: session — Permission: servers.terminal **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | Record new sessions. | | `recordInput` | boolean | Yes | Also record what is typed (passwords typed at prompts included). | | `retentionDays` | integer | Yes | 1 to 3650. Older recordings are deleted. | | `maxSizeMb` | integer | Yes | 1 to 1024. A longer session's recording is truncated. | **Response** `200 OK` with the saved settings, message `Terminal recording settings saved`. ## Get the dashboard summary `GET /api/v1/dashboard` — Permission: dashboard.view — Token scope: read Counts for the panel's dashboard. Each section is filled only when you have the permission to see it, and is `null` otherwise. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dashboard \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const summary = await panel.dashboard(); ``` **Response** `200 OK` ```json { "success": true, "data": { "servers": { "total": 3, "byStatus": { "pending": 0, "online": 3, "offline": 0, "disabled": 0 } }, "websites": { "total": 6, "byStatus": { "active": 6 }, "sslExpiring": 0 }, "applications": { "total": 2, "busy": 0, "byProcess": { "running": 2 }, "deployments24h": { "succeeded": 3 } }, "databases": { "total": 4, "byStatus": { "active": 4 }, "users": 4 }, "backups": { "byStatus": { "succeeded": 28 }, "failedLastDay": 0, "schedules": 3, "totalBytes": 1873420288 }, "cron": { "jobs": 5, "failedLastDay": 0 }, "jobs": { "last24h": { "succeeded": 41, "failed": 1 } }, "recentJobs": [], "recentActivity": [], "users": { "active": 5 }, "alerts": { "firing": 0, "unacknowledged": 0, "bySeverity": {} } }, "message": "OK", "requestId": "…" } ``` | Section | Needs | | --- | --- | | `servers` | `servers.read` | | `websites`, `applications`, `databases`, `backups`, `cron` | The matching `.read` permission | | `jobs`, `recentJobs` | `jobs.read` (the 6 most recent jobs, routine ones left out) | | `recentActivity` | `audit.read` (the 8 most recent audit log entries) | | `alerts` | `alerts.read` | | `users` | `users.read` | --- # Jobs URL: https://docs.vaultpanel.net/api-reference/jobs > API reference for jobs, the asynchronous record of every change an agent makes, and the catalog of operations you can queue on a server. A **job** is one operation an agent carries out on a server: creating a website, deploying an app, restarting a service. The panel never runs commands itself and there is no endpoint that runs arbitrary commands. Each job names an operation from a fixed catalog, the agent re-checks its parameters against its own allow-list, and runs fixed commands without a shell. See [How it works](https://docs.vaultpanel.net/getting-started/how-it-works). Most jobs are started by the endpoint for the thing they change (`POST /websites` queues `CREATE_SITE`). A small set of server operations is queued directly with [Queue an operation](https://docs.vaultpanel.net/api-reference/jobs#queue-an-operation). ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/jobs` | [List jobs](https://docs.vaultpanel.net/api-reference/jobs#list-jobs) | | GET | `/api/v1/jobs/:id` | [Get a job and its logs](https://docs.vaultpanel.net/api-reference/jobs#get-a-job-and-its-logs) | | POST | `/api/v1/jobs/:id/cancel` | [Cancel a job](https://docs.vaultpanel.net/api-reference/jobs#cancel-a-job) | | GET | `/api/v1/jobs/operations` | [List operations](https://docs.vaultpanel.net/api-reference/jobs#list-operations) | | POST | `/api/v1/servers/:id/jobs` | [Queue an operation](https://docs.vaultpanel.net/api-reference/jobs#queue-an-operation) | ## Job lifecycle ```text queued ──> dispatched ──> running ──> succeeded │ ├──────> failed │ └──────> timed_out └──> cancelled (only while queued) ``` | Status | Meaning | | --- | --- | | `queued` | Waiting for the agent to pick it up. A job no agent picks up within 5 minutes fails. | | `dispatched` | Handed to the agent, not started yet. | | `running` | The agent is carrying it out and streaming its log. | | `succeeded`, `failed`, `timed_out`, `cancelled` | Final. | Retryable operations (status checks and reads) get up to 3 attempts; operations that change the server get one. Each operation has its own time limit. When a job finishes, the record it acts on is updated before the agent's next request is answered, so a follow-up job always sees the result of the one before. ### Duplicates The panel refuses a job identical to one that is still queued, dispatched or running (same server, operation and parameters) with `409 DUPLICATE_OPERATION`, and returns the existing job's id in `details.jobId`. ### Routine jobs Reads the interface waits on, such as file listings, log lines and status checks, are **routine** jobs. They are left out of `GET /jobs` unless you pass `includeRoutine=true`, and file contents are removed from stored jobs. ### Redacted parameters Passwords, environment values and written file contents in a job's parameters are replaced with `{ "redacted": true, "length": 42 }` (or `count` for lists) whenever the job is shown or stored for the long term. ## The job object ```json { "id": "a1d3c5e7-2b4d-4f6a-8c0e-1f3a5c7e9b2d", "type": "SERVICE_RESTART", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "status": "succeeded", "params": { "service": "nginx" }, "resource": null, "requestedBy": { "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "email": "ada@example.com" }, "attempts": 1, "maxAttempts": 1, "timeoutSeconds": 120, "requestId": "6f1c2a4e-1b7d-4c55-9a0e-3d2f8b7c9e10", "output": { "service": { "name": "nginx", "loadState": "loaded", "active": "active", "sub": "running", "enabled": "enabled", "description": "A high performance web server and a reverse proxy server" } }, "error": null, "expiresAt": "2026-11-10T11:15:00.000Z", "dispatchedAt": "2026-11-10T11:10:01.000Z", "startedAt": "2026-11-10T11:10:01.000Z", "finishedAt": "2026-11-10T11:10:03.000Z", "durationMs": 2000, "createdAt": "2026-11-10T11:10:00.000Z", "updatedAt": "2026-11-10T11:10:03.000Z" } ``` | Field | Description | | --- | --- | | `resource` | The record the job acts on, such as `{ "type": "website", "id": "…" }`, or `null`. | | `requestedBy` | The person who queued it, or `{ "type": "system" }` for the panel's own work. A hosting customer sees their provider's staff as `{ "type": "staff" }`. | | `output` | What the operation returned. Its shape depends on the operation. | | `error` | `{ code, message }` when the job failed. | | `expiresAt` | When a queued job fails if no agent has picked it up. | ## List jobs `GET /api/v1/jobs` — Permission: jobs.read — Token scope: read Jobs, newest first. Hosting customers see only jobs on their own records. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | No | Jobs on one server. | | `status` | string | No | One of the statuses above. | | `type` | string | No | One operation, such as `DEPLOY_GIT`. Routine jobs of that type are included. | | `includeRoutine` | boolean | No | Include routine jobs. Default `false`. | | `sort` | string | No | `createdAt` (default) or `finishedAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/jobs?status=failed&pageSize=10" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.jobs.list({ status: 'failed', pageSize: 10 }); ``` **Response** `200 OK`: `{ items: [job], pagination }`. ## Get a job and its logs `GET /api/v1/jobs/:id` — Permission: jobs.read — Token scope: read The job with its log lines. Poll it to follow a job: pass the highest log `id` you have seen as `afterLogId` to receive only newer lines. Each call returns up to 1000 lines. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `afterLogId` | integer | No | Only log lines with a higher id. Default `0`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/jobs/a1d3c5e7-2b4d-4f6a-8c0e-1f3a5c7e9b2d?afterLogId=0" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js // Poll until the job is final, printing log lines as they arrive. const { job, logs } = await panel.jobs.wait(jobId, { timeoutMs: 600_000, onProgress: (job, lines) => lines.forEach((line) => console.log(line.message)), }); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "a1d3c5e7-2b4d-4f6a-8c0e-1f3a5c7e9b2d", "type": "SERVICE_RESTART", "status": "succeeded", "logs": [ { "id": 90211, "stream": "system", "message": "Queued by ada@example.com", "loggedAt": "2026-11-10T11:10:00.000Z" }, { "id": 90212, "stream": "system", "message": "Agent started the operation", "loggedAt": "2026-11-10T11:10:01.000Z" }, { "id": 90213, "stream": "stdout", "message": "$ systemctl restart nginx.service", "loggedAt": "2026-11-10T11:10:01.000Z" } ] }, "message": "OK", "requestId": "…" } ``` The job's other fields are those of [the job object](https://docs.vaultpanel.net/api-reference/jobs#the-job-object). `stream` is `system` (the panel's own notes), `stdout` or `stderr`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such job, or not one of yours (hosting customers). | ## Cancel a job `POST /api/v1/jobs/:id/cancel` — Permission: jobs.cancel — Token scope: manage Cancels a job that is still `queued`. Once the agent has a job it may already be changing the server, so dispatched and running jobs cannot be cancelled. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/jobs/a1d3c5e7-2b4d-4f6a-8c0e-1f3a5c7e9b2d/cancel \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.jobs.cancel(jobId); ``` **Response** `200 OK` with the job, `status: "cancelled"`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such job. | | 409 | `JOB_NOT_CANCELLABLE` | The job is no longer queued. | ## List operations `GET /api/v1/jobs/operations` The whole operation catalog: every operation with its label, whether it is available in this release, the permission it needs and whether it is marked dangerous. Any signed-in caller may read it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/jobs/operations \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.jobs.operations(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "type": "SERVICE_STATUS", "label": "Check service status", "available": true, "phase": null, "permission": "servers.services", "dangerous": false }, { "type": "SERVER_REBOOT", "label": "Reboot server", "available": true, "phase": null, "permission": "servers.reboot", "dangerous": true } ] }, "message": "OK", "requestId": "…" } ``` ## Queue an operation `POST /api/v1/servers/:id/jobs` — Permission: per operation Queues one of the [direct operations](https://docs.vaultpanel.net/api-reference/jobs#direct-operations) on a server and answers `202 Accepted` with the job. The permission checked is the operation's own; parameters are validated against the catalog, and their errors are reported as `params.`. Hosting customers cannot queue operations on servers. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | Yes | The operation, such as `SERVICE_RESTART`. | | `params` | object | No | The operation's parameters. Default `{}`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/servers/1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b/jobs \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"type":"SERVICE_RESTART","params":{"service":"nginx"}}' ``` **JavaScript** ```js const job = await panel.servers.runOperation(serverId, { type: 'SERVICE_RESTART', params: { service: 'nginx' }, }); const { job: done } = await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` with [the job object](https://docs.vaultpanel.net/api-reference/jobs#the-job-object) (`status: "queued"`), message `Job queued`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `OPERATION_NOT_DIRECT` | The operation is started by its own endpoint (websites, files, apps…), not directly. | | 403 | `FORBIDDEN` | You lack the operation's permission, or you are a hosting customer. | | 404 | `NOT_FOUND` | No such server. | | 409 | `OPERATION_UNAVAILABLE` | The operation is in the catalog but not available in this release. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `AGENT_OUTDATED` | The server's agent does not support this operation. Update the agent. | | 409 | `DUPLICATE_OPERATION` | The same operation is already queued or running (`details.jobId`). | | 422 | `VALIDATION_ERROR` | Unknown `type`, or invalid `params` (`params.service`…). | ## Direct operations These operations can be queued with [Queue an operation](https://docs.vaultpanel.net/api-reference/jobs#queue-an-operation). The token scope column names the scope that grants the permission. | Operation | What it does | Permission | Token scope | Parameters | | --- | --- | --- | --- | --- | | `SERVICE_STATUS` | Check a systemd service's state | `servers.services` | `servers` | `service` (required) | | `SERVICE_START` | Start a service | `servers.services` | `servers` | `service` (required) | | `SERVICE_STOP` | Stop a service (dangerous) | `servers.services` | `servers` | `service` (required) | | `SERVICE_RESTART` | Restart a service (dangerous) | `servers.services` | `servers` | `service` (required) | | `SERVICE_LOGS` | Read a service's journal | `servers.services` | `servers` | `service` (required), `lines` (10 to 1000, default 200) | | `PROCESS_LIST` | List running processes | `servers.processes` | `servers` | `limit` (1 to 500, default 50), `sortBy` (`cpu` or `memory`, default `cpu`) | | `PROCESS_SIGNAL` | Stop a process (dangerous) | `servers.signal` | `servers` | `pid` (required, 2 to 4194304), `command` (required, the process name you saw), `signal` (`TERM` or `KILL`, default `TERM`) | | `LISTENING_PORTS` | List listening ports (routine) | `servers.processes` | `servers` | None | | `SELF_CHECK` | Run the [server self-check](https://docs.vaultpanel.net/guides/servers/self-check) now (routine) | `servers.read` | `read` | None | | `SERVER_REBOOT` | Reboot the server (dangerous) | `servers.reboot` | `servers` | None | | `WEB_STACK_INSTALL` | Install server software | `websites.manage` | `manage` | `components` (required, 1 to 12 of `nginx`, `php`, `certbot`, `apache`, `git`, `pm2`, `python`, `go`, `ruby`, `composer`, `mariadb`, `cron`) | | `PHP_VERSION_INSTALL` | Install a PHP version | `websites.manage` | `manage` | `version` (required: `7.4`, `8.0` to `8.5`) | | `PHP_VERSION_REMOVE` | Remove a PHP version (dangerous) | `websites.manage` | `manage` | `version` (required) | | `PHPMYADMIN_SETUP` | Set up phpMyAdmin | `servers.manage` | `servers` | `port` (1024 to 65535, default 8081), `domain`, `certName` | | `PHPMYADMIN_REMOVE` | Turn off phpMyAdmin | `servers.manage` | `servers` | None | | `DNS_SETUP` | Install and set up BIND for [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) | `dns.manage` | `manage` | None | | `SYSTEM_LOGS` | Read system logs (routine) | `servers.logs` | `logs` | `source` (required: `journal`, `kernel`, `auth` or `cron`), `priority` (`emerg` to `debug`, default `debug`), `search` (up to 200 characters), `sinceMinutes` (1 to 44640), `lines` (10 to 2000, default 300) | | `SECURITY_STATUS` | Read firewall, SSH, Fail2ban and update status (routine) | `security.read` | `read` | None | | `SECURITY_TOOLS_INSTALL` | Install security software | `security.manage` | `servers` | `components` (required, 1 to 3 of `ufw`, `fail2ban`, `unattended-upgrades`) | A `service` is a systemd unit name: up to 100 letters, digits and `: _ . @ -`, starting with a letter or digit. The agent re-checks every operation against its own policy, so a job can still fail on the server: for example, `SERVICE_STOP` is refused (`NOT_ALLOWED`) for a service whose stop would cut off remote access, and a service the agent's configuration does not allow is refused too. Such errors arrive in the job's `error`, not as an HTTP status. ## Other operations The rest of the catalog is queued by the endpoints for what it changes, which build the parameters from the panel's own records. Queuing one directly answers `400 OPERATION_NOT_DIRECT`. They appear in job lists and in `GET /jobs/:id` with these types. | Area | Operations | Started by | | --- | --- | --- | | Agent | `AGENT_UPDATE` | [Update the agent](https://docs.vaultpanel.net/api-reference/servers#update-the-agent), bulk actions | | Websites | `CREATE_SITE`, `CREATE_NGINX_CONFIG`, `DELETE_SITE`, `SITE_LOGS` | [Websites](https://docs.vaultpanel.net/api-reference/websites) | | SSL | `ISSUE_SSL`, `INSTALL_SSL_CERT`, `RENEW_SSL`, `SET_SSL_RENEWAL` | [Websites](https://docs.vaultpanel.net/api-reference/websites#issue-a-lets-encrypt-certificate) | | Files | `FILE_LIST`, `FILE_READ`, `FILE_WRITE`, `FILE_MKDIR`, `FILE_RENAME`, `FILE_DELETE`, `FILE_UPLOAD`, `FILE_DOWNLOAD`, `FILE_CHMOD`, `FILE_EXTRACT`, `FILE_COMPRESS` | [Website files](https://docs.vaultpanel.net/api-reference/websites#run-a-file-action) | | Website Git deploy | `SITE_GIT_SETUP`, `DEPLOY_SITE_GIT`, `ROLLBACK_SITE_GIT` | [Websites](https://docs.vaultpanel.net/api-reference/websites#set-up-git-deploy) | | Applications | `CREATE_APPLICATION`, `DEPLOY_GIT`, `ROLLBACK_APPLICATION`, `CONFIGURE_APPLICATION`, `START_APPLICATION`, `STOP_APPLICATION`, `RESTART_APPLICATION`, `DELETE_APPLICATION`, `APP_STATUS`, `APP_LOGS` | [Applications](https://docs.vaultpanel.net/api-reference/applications) | | App installer | `CMS_INSTALL`, `CMS_REMOVE` | [Applications](https://docs.vaultpanel.net/api-reference/applications#install-an-app) | | Databases | `CREATE_DATABASE`, `DELETE_DATABASE`, `CREATE_DATABASE_USER`, `UPDATE_DATABASE_USER`, `DELETE_DATABASE_USER`, `DATABASE_TABLES`, `DATABASE_TABLE_ROWS`, `DATABASE_QUERY`, `PHPMYADMIN_SIGNON` | [Databases](https://docs.vaultpanel.net/api-reference/databases) | | DNS | `DNS_ZONE_APPLY`, `DNS_ZONE_REMOVE` | [DNS](https://docs.vaultpanel.net/api-reference/dns) | | Email | `MAIL_SETUP`, `MAIL_APPLY`, `MAIL_USAGE` | [Mail](https://docs.vaultpanel.net/api-reference/mail) | | Backups | `CREATE_BACKUP`, `RESTORE_BACKUP`, `DELETE_BACKUP`, `UPLOAD_BACKUP`, `TEST_BACKUP_STORAGE` | [Backups](https://docs.vaultpanel.net/api-reference/backups) | | Cron | `CREATE_CRON`, `DELETE_CRON`, `RUN_CRON` | [Cron jobs](https://docs.vaultpanel.net/api-reference/cron-jobs) | | Security | `FIREWALL_ENABLE`, `FIREWALL_DISABLE`, `FIREWALL_RULE_ADD`, `FIREWALL_RULE_DELETE`, `FIREWALL_DEFAULTS`, `SSH_CONFIGURE`, `SSH_KEY_ADD`, `SSH_KEY_REMOVE`, `SSH_PORTS_SET`, `LOGIN_BANNER_SET`, `FAIL2BAN_CONFIGURE`, `FAIL2BAN_UNBAN`, `AUTO_UPDATES_CONFIGURE`, `SECURITY_UPDATES_INSTALL` | [Security](https://docs.vaultpanel.net/api-reference/security) | | Containers | `DOCKER_STATUS`, `DOCKER_INSTALL`, `CONTAINER_LIST`, `CONTAINER_INSPECT`, `CONTAINER_LOGS`, `CONTAINER_DEPLOY`, `CONTAINER_START`, `CONTAINER_STOP`, `CONTAINER_RESTART`, `CONTAINER_REMOVE`, `IMAGE_LIST`, `IMAGE_PULL`, `IMAGE_REMOVE` | [Containers](https://docs.vaultpanel.net/api-reference/containers) | | Assistant | `LOCAL_AI_INSTALL`, `LOCAL_AI_REMOVE`, `LOCAL_AI_UNINSTALL` | [Assistant](https://docs.vaultpanel.net/api-reference/assistant) | `PLUGIN_INSTALL` is in the catalog but not available in this release. --- # Server groups and bulk actions URL: https://docs.vaultpanel.net/api-reference/server-groups > API reference for server groups and bulk actions, which run one operation on many servers at once, in parallel or one server at a time. **Server groups** collect servers you watch and act on together, such as "Production" or "Frankfurt". A server can be in several groups. **Bulk actions** run one operation on a set of servers, or on a group, and track each server's part. See [Server groups](https://docs.vaultpanel.net/guides/servers/server-groups). To change the groups of one server, use [`PUT /servers/:id/groups`](https://docs.vaultpanel.net/api-reference/servers#set-a-servers-groups). ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/server-groups` | [List groups](https://docs.vaultpanel.net/api-reference/server-groups#list-groups) | | POST | `/api/v1/server-groups` | [Create a group](https://docs.vaultpanel.net/api-reference/server-groups#create-a-group) | | GET | `/api/v1/server-groups/:id` | [Get a group](https://docs.vaultpanel.net/api-reference/server-groups#get-a-group) | | PATCH | `/api/v1/server-groups/:id` | [Update a group](https://docs.vaultpanel.net/api-reference/server-groups#update-a-group) | | DELETE | `/api/v1/server-groups/:id` | [Delete a group](https://docs.vaultpanel.net/api-reference/server-groups#delete-a-group) | | GET | `/api/v1/bulk-actions` | [List bulk actions](https://docs.vaultpanel.net/api-reference/server-groups#list-bulk-actions) | | POST | `/api/v1/bulk-actions` | [Start a bulk action](https://docs.vaultpanel.net/api-reference/server-groups#start-a-bulk-action) | | GET | `/api/v1/bulk-actions/:id` | [Get a bulk action](https://docs.vaultpanel.net/api-reference/server-groups#get-a-bulk-action) | | POST | `/api/v1/bulk-actions/:id/cancel` | [Cancel a bulk action](https://docs.vaultpanel.net/api-reference/server-groups#cancel-a-bulk-action) | ## The group summary Group responses include a `summary` of their servers. Averages and highest values use only servers that are online and have reported metrics. ```json { "total": 3, "online": 3, "offline": 0, "pending": 0, "disabled": 0, "firingAlerts": 1, "agentsOutdated": 0, "cpu": { "average": 18.2, "max": 41.0 }, "memory": { "average": 46.7, "max": 63.1 }, "disk": { "average": 31.5, "max": 52.8 } } ``` `cpu`, `memory` and `disk` are percentages, or `null` when no server has data. ## List groups `GET /api/v1/server-groups` — Permission: servers.read — Token scope: read Every group, by name, with its servers and summary. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/server-groups \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.servers.groups.list(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e", "name": "Production", "description": "Customer-facing servers", "color": "green", "createdAt": "2026-10-22T09:00:00.000Z", "updatedAt": "2026-10-22T09:00:00.000Z", "servers": [{ "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "status": "online" }], "summary": { "total": 1, "online": 1, "offline": 0, "pending": 0, "disabled": 0, "firingAlerts": 0, "agentsOutdated": 0, "cpu": { "average": 12.4, "max": 12.4 }, "memory": { "average": 38.6, "max": 38.6 }, "disk": { "average": 24.5, "max": 24.5 } } } ] }, "message": "OK", "requestId": "…" } ``` This list is not paginated. ## Create a group `POST /api/v1/server-groups` — Permission: servers.manage — Token scope: servers **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 60 letters, numbers, spaces and `. _ - ( ) &`, starting with a letter or number. Unique. | | `description` | string | No | Up to 300 characters. | | `color` | string | No | `blue` (default), `green`, `amber`, `red`, `purple`, `teal` or `gray`. | | `serverIds` | string[] | No | Up to 500 servers to put in the group. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/server-groups \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"name":"Production","color":"green","serverIds":["1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b"]}' ``` **JavaScript** ```js const group = await panel.servers.groups.create({ name: 'Production', color: 'green', serverIds: [serverId], }); ``` **Response** `201 Created` with the group, as from [Get a group](https://docs.vaultpanel.net/api-reference/server-groups#get-a-group). **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `GROUP_EXISTS` | A group with this name already exists. | | 422 | `VALIDATION_ERROR` | A field is invalid, or one of the servers was not found. | ## Get a group `GET /api/v1/server-groups/:id` — Permission: servers.read — Token scope: read The group with its full server records: each server's fields, latest metrics, firing alert count and whether its agent is outdated. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/server-groups/c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const group = await panel.servers.groups.get(groupId); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e", "name": "Production", "description": "Customer-facing servers", "color": "green", "servers": [ { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "status": "online", "latestMetrics": { "cpuPercent": 12.4 }, "firingAlerts": 0, "agentOutdated": false } ], "summary": { "total": 1, "online": 1, "offline": 0, "pending": 0, "disabled": 0, "firingAlerts": 0, "agentsOutdated": 0, "cpu": { "average": 12.4, "max": 12.4 }, "memory": { "average": 38.6, "max": 38.6 }, "disk": { "average": 24.5, "max": 24.5 } } }, "message": "OK", "requestId": "…" } ``` Each server carries every field of [the server object](https://docs.vaultpanel.net/api-reference/servers#the-server-object). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such group. | ## Update a group `PATCH /api/v1/server-groups/:id` — Permission: servers.manage — Token scope: servers Changes any of `name`, `description`, `color` and `serverIds` (same rules as [Create a group](https://docs.vaultpanel.net/api-reference/server-groups#create-a-group)). `serverIds` replaces the whole membership. Send at least one field. **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/server-groups/c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"description":"Customer-facing servers in Frankfurt"}' ``` **JavaScript** ```js const group = await panel.servers.groups.update(groupId, { description: 'Customer-facing servers in Frankfurt' }); ``` **Response** `200 OK` with the group, as from [Get a group](https://docs.vaultpanel.net/api-reference/server-groups#get-a-group). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such group. | | 409 | `GROUP_EXISTS` | Another group has this name. | | 422 | `VALIDATION_ERROR` | No fields, an invalid field, or a server that was not found. | ## Delete a group `DELETE /api/v1/server-groups/:id` — Permission: servers.manage — Token scope: servers Deletes the group only. Its servers and past bulk actions stay. **Example request** **cURL** ```bash curl -X DELETE https://panel.example.com/api/v1/server-groups/c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.servers.groups.remove(groupId); ``` **Response** `200 OK` with `data: null`, message `Group deleted. Its servers were not changed.` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such group. | ## Bulk actions A bulk action runs one operation on up to 200 servers. Each server's part is an ordinary [job](https://docs.vaultpanel.net/api-reference/jobs) linked back to the action. | Operation | What it does | Default mode | Checked after the job | | --- | --- | --- | --- | | `SERVICE_RESTART` | Restart the same systemd service on every server (`params.service`) | `parallel` | No | | `SERVICE_START` | Start a stopped service (`params.service`) | `parallel` | No | | `SERVICE_STATUS` | Read a service's state (`params.service`) | `parallel` | No | | `SECURITY_UPDATES_INSTALL` | Install waiting security updates with unattended-upgrades | `rolling` | No | | `AGENT_UPDATE` | Install the agent version this panel serves (the panel fills in the version and checksum) | `parallel` | The new version must be reported, within 3 minutes | | `SERVER_REBOOT` | Restart the servers | `rolling` | A newer boot time must be reported, within 10 minutes | **Modes.** `parallel` starts every server at once. `rolling` runs one server at a time: each must finish (and pass its check) before the next starts, and with `stopOnFailure` a failure stops the rest. **Skipped servers.** Servers that are offline, have no agent, run an agent that cannot do the operation, or (for agent updates) are already current are `skipped` with the reason. If no server can run it, the action is refused with `409 NOTHING_TO_RUN`. **The panel's own server** (`isLocal`) always runs last. For `SERVER_REBOOT` it also waits until every other server is done, even in `parallel` mode, and its reboot is given 24 hours to be confirmed, since the panel is down until it is started again. A target goes `waiting`, then `running`, then `succeeded` or `failed`; reboots and agent updates pass through `verifying` while the panel waits for their check. The action is `running` until every target is final, then `succeeded`, `failed` or `cancelled`. ## List bulk actions `GET /api/v1/bulk-actions` — Permission: jobs.read — Token scope: read Bulk actions, newest first, with counts per target status. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `running`, `succeeded`, `failed` or `cancelled`. | | `groupId` | string | No | Actions started on one group. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/bulk-actions?status=running" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.bulkActions.list({ status: 'running' }); ``` **Response** `200 OK`: `{ items: [action], pagination }`, each action as below without `targets`. ## Start a bulk action `POST /api/v1/bulk-actions` — Permission: servers.bulk — Token scope: servers Starts an operation on a list of servers or on every server of a group. You need `servers.bulk` and the operation's own permission (for example `servers.reboot`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | Yes | One of the operations above. | | `params` | object | No | The operation's parameters, such as `{ "service": "nginx" }`. | | `serverIds` | string[] | One of the two | Up to 200 servers. | | `groupId` | string | One of the two | Every server in this group. | | `mode` | string | No | `parallel` or `rolling`. Defaults to the operation's default. | | `stopOnFailure` | boolean | No | For `rolling` mode: stop at the first failure. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/bulk-actions \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"type":"SECURITY_UPDATES_INSTALL","groupId":"c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e","mode":"rolling"}' ``` **JavaScript** ```js const action = await panel.bulkActions.create({ type: 'SERVICE_RESTART', params: { service: 'php8.3-fpm' }, groupId, }); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "id": "e9f8d7c6-5b4a-4392-8170-6f5e4d3c2b1a", "type": "SECURITY_UPDATES_INSTALL", "label": "Install security updates", "params": {}, "mode": "rolling", "stopOnFailure": true, "status": "running", "group": { "id": "c2d4e6f8-1a3b-4c5d-9e7f-2b4d6f8a0c1e", "name": "Production" }, "requestedBy": { "id": "3c9f0a52-7d1e-4b8a-9f3e-2a6d5c4b1e07", "email": "ada@example.com" }, "counts": { "total": 3, "waiting": 2, "running": 1, "verifying": 0, "succeeded": 0, "failed": 0, "skipped": 0, "cancelled": 0 }, "cancelledAt": null, "createdAt": "2026-11-10T11:20:00.000Z", "finishedAt": null, "targets": [ { "id": "f1e2d3c4-…", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "position": 0, "status": "running", "message": null, "jobId": "a7b8c9d0-…", "jobStatus": "running", "isLocal": false, "verifyUntil": null, "startedAt": "2026-11-10T11:20:00.000Z", "finishedAt": null } ] }, "message": "Bulk action started", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | You lack `servers.bulk` or the operation's permission. | | 404 | `NOT_FOUND` | The group was not found. | | 409 | `GROUP_EMPTY` | The group has no servers. | | 409 | `NOTHING_TO_RUN` | No server can run it. `details.servers` lists each server with its reason. | | 422 | `VALIDATION_ERROR` | Not exactly one of `serverIds` and `groupId`, an unknown `type`, invalid `params`, a server that was not found, or more than 200 servers. | ## Get a bulk action `GET /api/v1/bulk-actions/:id` — Permission: jobs.read — Token scope: read The action with one target per server, in the order they run. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/bulk-actions/e9f8d7c6-5b4a-4392-8170-6f5e4d3c2b1a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const action = await panel.bulkActions.get(actionId); ``` **Response** `200 OK` with the action, as from [Start a bulk action](https://docs.vaultpanel.net/api-reference/server-groups#start-a-bulk-action). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such bulk action. | ## Cancel a bulk action `POST /api/v1/bulk-actions/:id/cancel` — Permission: servers.bulk — Token scope: servers Cancels the servers that have not started yet, including jobs still waiting for their agent. Anything already running on a server finishes. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/bulk-actions/e9f8d7c6-5b4a-4392-8170-6f5e4d3c2b1a/cancel \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const action = await panel.bulkActions.cancel(actionId); ``` **Response** `200 OK` with the action, message `Servers that had not started were cancelled`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such bulk action. | | 409 | `NOT_RUNNING` | The action has already finished. | --- # Monitoring and alerts URL: https://docs.vaultpanel.net/api-reference/monitoring-and-alerts > API reference for the fleet monitoring overview, services across servers, firing alerts, acknowledgements and alert rules. Monitoring endpoints read what agents already report in their heartbeats: the latest metrics, a one-hour trend and the state of watched services on every server. Alert rules are evaluated by the panel's worker like Prometheus rules: when a rule's condition becomes true an event is `pending`, it becomes `firing` once the condition has held for the rule's `durationSeconds`, and `resolved` when it clears. A pending event whose condition clears is deleted. For a single server's metric history, see [Servers](https://docs.vaultpanel.net/api-reference/servers). For the concepts and the panel pages, see [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/monitoring/overview` | [Get the fleet overview](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#get-the-fleet-overview) | | GET | `/api/v1/monitoring/services` | [List services across servers](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#list-services-across-servers) | | GET | `/api/v1/alerts/summary` | [Get the alert summary](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#get-the-alert-summary) | | GET | `/api/v1/alerts/events` | [List alerts](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#list-alerts) | | POST | `/api/v1/alerts/events/:id/acknowledge` | [Acknowledge an alert](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#acknowledge-an-alert) | | GET | `/api/v1/alerts/rules` | [List alert rules](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#list-alert-rules) | | POST | `/api/v1/alerts/rules` | [Create an alert rule](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#create-an-alert-rule) | | PATCH | `/api/v1/alerts/rules/:id` | [Update an alert rule](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#update-an-alert-rule) | | DELETE | `/api/v1/alerts/rules/:id` | [Delete an alert rule](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#delete-an-alert-rule) | ## Get the fleet overview `GET /api/v1/monitoring/overview` — Permission: servers.read — Token scope: read Returns every server with its latest metrics, its fullest filesystem, how many watched services have a problem (failed, or stopped although enabled at boot), a one-hour CPU and memory trend of up to 30 points, and its firing alerts by severity. `firingAlerts` is `null` when you lack `alerts.read`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/monitoring/overview \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, totals } = await panel.monitoring.overview(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "web-1", "status": "online", "hostname": "web-1", "cpuCores": 4, "lastSeenAt": "2026-11-10T10:15:02.000Z", "latestMetrics": { "collectedAt": "2026-11-10T10:15:00.000Z", "cpuPercent": 12.4, "load": [0.42, 0.38, 0.35], "memoryUsedBytes": 1879048192, "memoryTotalBytes": 4294967296, "swapUsedBytes": 0, "swapTotalBytes": 1073741824, "diskUsedBytes": 21474836480, "diskTotalBytes": 85899345920, "netRxBytesPerSec": 10240, "netTxBytesPerSec": 20480, "processCount": 187, "uptimeSeconds": 864000 }, "fullestFilesystem": { "mount": "/", "percent": 25, "usedBytes": 21474836480, "totalBytes": 85899345920 }, "services": { "total": 14, "problems": 0 }, "trend": [{ "t": "2026-11-10T09:16:00.000Z", "cpu": 10.2, "memory": 43.1 }], "firingAlerts": { "warning": 0, "critical": 0 } } ], "totals": { "servers": 1, "byStatus": { "pending": 0, "online": 1, "offline": 0, "disabled": 0 } } }, "message": "OK", "requestId": "…" } ``` ## List services across servers `GET /api/v1/monitoring/services` — Permission: servers.read — Token scope: read Returns every watched systemd service on every connected server, as the agents last reported them, with the server each one runs on. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `state` | string | No | `all` (default), `running` (active services only) or `problem` (failed, or stopped although enabled at boot). | | `search` | string | No | Part of a service or server name, up to 100 characters. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/monitoring/services?state=problem" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.monitoring.services({ state: 'problem' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "name": "nginx", "loadState": "loaded", "active": "failed", "sub": "failed", "enabled": "enabled", "description": "A high performance web server and a reverse proxy server", "problem": true, "server": { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "web-1", "status": "online", "lastSeenAt": "2026-11-10T10:15:02.000Z" } } ] }, "message": "OK", "requestId": "…" } ``` ## Get the alert summary `GET /api/v1/alerts/summary` — Permission: alerts.read — Token scope: read Counts firing alerts, in total, not yet acknowledged and by severity. The panel's top bar uses it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/summary \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { firing, unacknowledged, bySeverity } = await panel.alerts.summary(); ``` **Response** `200 OK` ```json { "success": true, "data": { "firing": 2, "unacknowledged": 1, "bySeverity": { "warning": 1, "critical": 1 } }, "message": "OK", "requestId": "…" } ``` ## List alerts `GET /api/v1/alerts/events` — Permission: alerts.read — Token scope: read Returns alert events a page at a time, newest first. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `pending`, `firing`, `resolved`, or `open` (pending and firing together). | | `serverId` | string (UUID) | No | Only alerts for this server. | | `severity` | string | No | `warning` or `critical`. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `startedAt` (default) or `resolvedAt`; `desc` (default) or `asc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/alerts/events?status=open" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.alerts.events({ status: 'open' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "c0d1e2f3-…", "ruleId": "b7c8d9e0-…", "ruleName": "Disk almost full", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "metric": "disk_percent", "subject": "/", "severity": "critical", "status": "firing", "threshold": 90, "value": 93.4, "message": "Disk usage on / is 93% (threshold 90%)", "startedAt": "2026-11-10T09:50:00.000Z", "firedAt": "2026-11-10T09:55:00.000Z", "resolvedAt": null, "acknowledgedAt": null, "acknowledgedBy": null, "lastEvaluatedAt": "2026-11-10T10:15:00.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` `subject` names what the alert is about when a rule covers several things: the filesystem for `disk_percent`, the service for `service_down`, the website's address for `website_down`. ## Acknowledge an alert `POST /api/v1/alerts/events/:id/acknowledge` — Permission: alerts.acknowledge — Token scope: manage Marks a firing alert as acknowledged by you, so others know someone is on it. It keeps firing until its condition clears. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/events/c0d1e2f3-a4b5-4c6d-8e7f-9a0b1c2d3e4f/acknowledge \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const event = await panel.alerts.acknowledge(eventId); ``` **Response** `200 OK`: the alert event, with `acknowledgedAt` and `acknowledgedBy`; message `Alert acknowledged`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No alert with this id. | | 409 | `ALERT_NOT_ACKNOWLEDGEABLE` | The alert is not firing, or was already acknowledged. | ## List alert rules `GET /api/v1/alerts/rules` — Permission: alerts.read — Token scope: read Returns every rule, oldest first, each with `firingCount`: how many of its alerts are firing now. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/rules \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.alerts.rules(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "b7c8d9e0-…", "name": "Disk almost full", "metric": "disk_percent", "threshold": 90, "durationSeconds": 300, "severity": "critical", "serverId": null, "serverName": null, "serviceName": null, "isEnabled": true, "createdAt": "2026-10-04T08:00:00.000Z", "updatedAt": "2026-10-04T08:00:00.000Z", "firingCount": 1 } ] }, "message": "OK", "requestId": "…" } ``` ## Create an alert rule `POST /api/v1/alerts/rules` — Permission: alerts.manage — Token scope: manage Creates a rule. A rule without `serverId` applies to every server. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | 1 to 100 characters. | | `metric` | string | Yes | One of the metrics below. | | `threshold` | number or null | Metric rules | Required for the metric kinds, in the metric's range; ignored for the others. | | `durationSeconds` | integer | Yes | How long the condition must hold before the alert fires: 0 to 86400. | | `severity` | string | Yes | `warning` or `critical`. | | `serverId` | string (UUID) or null | No | One server, or every server when left out. | | `serviceName` | string or null | No | `service_down` only: one systemd service to watch. Without it, every watched service is checked. | | `isEnabled` | boolean | No | Default `true`. | | `metric` | Kind | `threshold` | | --- | --- | --- | | `cpu_percent` | Metric | 1 to 100 (%) | | `memory_percent` | Metric | 1 to 100 (%) | | `disk_percent` | Metric, per filesystem | 1 to 100 (%) | | `swap_percent` | Metric | 1 to 100 (%) | | `load_per_core` | Metric | 0.1 to 100 | | `server_offline` | The server stops reporting | None | | `service_down` | A service is down | None | | `website_down` | A website on the server fails the panel's [uptime checks](https://docs.vaultpanel.net/guides/websites/uptime-monitoring) (one alert per website) | None | | `self_check_failed` | The server's [self-check](https://docs.vaultpanel.net/guides/servers/self-check) reports a failure | None | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/rules \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Disk almost full", "metric": "disk_percent", "threshold": 90, "durationSeconds": 300, "severity": "critical" }' ``` **JavaScript** ```js const rule = await panel.alerts.createRule({ name: 'Disk almost full', metric: 'disk_percent', threshold: 90, durationSeconds: 300, severity: 'critical', }); ``` **Response** `201 Created`: the rule, message `Alert rule created`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | A missing or out-of-range threshold, `serviceName` on a rule that is not `service_down`, an unknown server, or another invalid field. | ## Update an alert rule `PATCH /api/v1/alerts/rules/:id` — Permission: alerts.manage — Token scope: manage Changes any of the rule's fields (the same fields as [Create an alert rule](https://docs.vaultpanel.net/api-reference/monitoring-and-alerts#create-an-alert-rule), all optional; send at least one). The merged rule is checked again. Changing `metric`, `threshold`, `serverId` or `serviceName`, or turning the rule off, resolves its open alerts, since they no longer mean the same thing. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/rules/b7c8d9e0-f1a2-4b3c-8d4e-5f6a7b8c9d0e \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "threshold": 85 }' ``` **JavaScript** ```js const rule = await panel.alerts.updateRule(ruleId, { threshold: 85 }); ``` **Response** `200 OK`: the rule, message `Alert rule updated`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No rule with this id. | | 422 | `VALIDATION_ERROR` | No field given, or the merged rule is invalid. | ## Delete an alert rule `DELETE /api/v1/alerts/rules/:id` — Permission: alerts.manage — Token scope: manage Resolves the rule's open alerts and deletes it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/alerts/rules/b7c8d9e0-f1a2-4b3c-8d4e-5f6a7b8c9d0e \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.alerts.removeRule(ruleId); ``` **Response** `200 OK`: `data` is `null`, message `Alert rule deleted`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No rule with this id. | --- # Security URL: https://docs.vaultpanel.net/api-reference/security > API reference for server firewalls, SSH settings and keys, Fail2ban, security updates, the login message, panel access by address, two-factor policy and sessions. Each server change on this page is a job for the server's agent, which checks it again and refuses anything that would lock people out. The panel adds what only it knows: the port people reach the panel on (when the panel runs on that server, returned as `protectedPorts`) and your own address, so a firewall rule cannot block you. The panel-wide endpoints at the end set who may reach the panel, the two-factor policy, and signed-in sessions. For the concepts, see [Security](https://docs.vaultpanel.net/guides/security), [Firewall](https://docs.vaultpanel.net/guides/security/firewall), [SSH](https://docs.vaultpanel.net/guides/security/ssh) and [Fail2ban and updates](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/security/overview` | [Get the security overview](https://docs.vaultpanel.net/api-reference/security#get-the-security-overview) | | GET | `/api/v1/security/servers/:id` | [Get a server's security](https://docs.vaultpanel.net/api-reference/security#get-a-servers-security) | | PUT | `/api/v1/security/servers/:id/firewall` | [Turn the firewall on or off](https://docs.vaultpanel.net/api-reference/security#turn-the-firewall-on-or-off) | | POST | `/api/v1/security/servers/:id/firewall/rules` | [Add a firewall rule](https://docs.vaultpanel.net/api-reference/security#add-a-firewall-rule) | | POST | `/api/v1/security/servers/:id/firewall/rules/delete` | [Delete a firewall rule](https://docs.vaultpanel.net/api-reference/security#delete-a-firewall-rule) | | PUT | `/api/v1/security/servers/:id/firewall/default` | [Set the firewall defaults](https://docs.vaultpanel.net/api-reference/security#set-the-firewall-defaults) | | PUT | `/api/v1/security/servers/:id/ssh` | [Change SSH settings](https://docs.vaultpanel.net/api-reference/security#change-ssh-settings) | | PUT | `/api/v1/security/servers/:id/ssh/ports` | [Change SSH ports](https://docs.vaultpanel.net/api-reference/security#change-ssh-ports) | | POST | `/api/v1/security/servers/:id/ssh/keys` | [Add an SSH key](https://docs.vaultpanel.net/api-reference/security#add-an-ssh-key) | | POST | `/api/v1/security/servers/:id/ssh/keys/delete` | [Remove an SSH key](https://docs.vaultpanel.net/api-reference/security#remove-an-ssh-key) | | PUT | `/api/v1/security/servers/:id/login-banner` | [Set the login message](https://docs.vaultpanel.net/api-reference/security#set-the-login-message) | | PUT | `/api/v1/security/servers/:id/fail2ban` | [Configure Fail2ban](https://docs.vaultpanel.net/api-reference/security#configure-fail2ban) | | POST | `/api/v1/security/servers/:id/fail2ban/unban` | [Unban an address](https://docs.vaultpanel.net/api-reference/security#unban-an-address) | | PUT | `/api/v1/security/servers/:id/updates` | [Turn automatic updates on or off](https://docs.vaultpanel.net/api-reference/security#turn-automatic-updates-on-or-off) | | POST | `/api/v1/security/servers/:id/updates/install` | [Install security updates](https://docs.vaultpanel.net/api-reference/security#install-security-updates) | | GET | `/api/v1/security/panel-access` | [Get panel access](https://docs.vaultpanel.net/api-reference/security#get-panel-access) | | PUT | `/api/v1/security/panel-access` | [Set panel access](https://docs.vaultpanel.net/api-reference/security#set-panel-access) | | GET | `/api/v1/security/authentication` | [Get the sign-in policy](https://docs.vaultpanel.net/api-reference/security#get-the-sign-in-policy) | | PUT | `/api/v1/security/authentication` | [Set the two-factor policy](https://docs.vaultpanel.net/api-reference/security#set-the-two-factor-policy) | | GET | `/api/v1/security/sessions` | [List sessions](https://docs.vaultpanel.net/api-reference/security#list-sessions) | | DELETE | `/api/v1/security/sessions/:id` | [Sign out a session](https://docs.vaultpanel.net/api-reference/security#sign-out-a-session) | ## Server changes are jobs Every `PUT` and `POST` under `/security/servers/:id` returns `202 Accepted` with the queued job as `data`. Wait for it with [`GET /api/v1/jobs/:id`](https://docs.vaultpanel.net/api-reference/jobs) or `panel.jobs.wait()`; its `output` and `error` say what the agent did. ```json { "success": true, "data": { "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b", "type": "FIREWALL_RULE_ADD", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "status": "queued", "params": { "action": "allow", "protocol": "tcp", "port": "8080", "source": "203.0.113.0/24", "protectedPorts": [8090] }, "resource": null, "attempts": 0, "output": null, "error": null, "createdAt": "2026-11-10T10:20:00.000Z" }, "message": "Adding the rule", "requestId": "…" } ``` These errors can come from any server change: | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No server with this id. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `AGENT_OUTDATED` | The agent cannot run this operation. Outgoing rules, the outgoing default, SSH ports and keys for accounts other than `root` need agent 0.34.0 or newer. | | 409 | `DUPLICATE_OPERATION` | The same change is already queued or running (`details.jobId`). | | 422 | `VALIDATION_ERROR` | A field is invalid. | ## Get the security overview `GET /api/v1/security/overview` — Permission: security.read — Token scope: read Returns every server with the security summary its agent last reported, the checks derived from it and a score: `passed` of `total` checks (checks with status `info` are not counted). `supported` is `false` when the agent cannot report security. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/overview \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.security.overview(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "web-1", "status": "online", "isLocal": true, "agentVersion": "0.41.0", "supported": true, "protectedPorts": [8090], "checkedAt": "2026-11-10T10:00:00.000Z", "checks": [ { "key": "firewall", "label": "Firewall", "status": "ok", "detail": "On, 4 rules", "fix": "firewall" }, { "key": "ssh_root", "label": "Root sign-in over SSH", "status": "warning", "detail": "Root can sign in with a password, the account attackers try first", "fix": "ssh" } ], "passed": 5, "total": 6 } ] }, "message": "OK", "requestId": "…" } ``` ## Get a server's security `GET /api/v1/security/servers/:id` — Permission: security.read — Token scope: read Returns one server's reported `summary` and `checks`, `protectedPorts`, `advanced` (the agent supports outgoing rules, SSH ports and keys for other accounts) and `yourAddress`, the address the panel sees your request from. For the full live state of the server (every firewall rule, SSH keys, banned addresses), run the `SECURITY_STATUS` operation with [`POST /api/v1/servers/:id/jobs`](https://docs.vaultpanel.net/api-reference/servers). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const security = await panel.security.server(serverId); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "web-1", "supported": true, "advanced": true, "protectedPorts": [8090], "summary": { "checkedAt": "2026-11-10T10:00:00.000Z" }, "checks": [], "yourAddress": "198.51.100.7" }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No server with this id. | ## Turn the firewall on or off `PUT /api/v1/security/servers/:id/firewall` — Permission: security.manage — Token scope: servers Turns UFW on (`FIREWALL_ENABLE`, keeping the panel's port reachable) or off (`FIREWALL_DISABLE`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | `true` turns the firewall on. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/firewall \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }' ``` **JavaScript** ```js const job = await panel.security.setFirewall(serverId, { enabled: true }); ``` **Response** `202 Accepted`: the job, message `Turning the firewall on` or `Turning the firewall off`. ## Add a firewall rule `POST /api/v1/security/servers/:id/firewall/rules` — Permission: security.manage — Token scope: servers Adds a UFW rule. An incoming rule has a `source`; an outgoing rule (agent 0.34.0 or newer) has a `destination`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | string | Yes | `allow`, `limit` (allow, but block an address that opens 6 or more connections in 30 seconds), `deny` (drop silently) or `reject` (refuse and tell the sender). | | `direction` | string | No | `in` (default) or `out`. | | `protocol` | string | No | `tcp` (default), `udp` or `any`. Lists and ranges of ports need `tcp` or `udp`. | | `port` | string | No | A port, a list (`80,443`) or a range (`6000:6010`), up to 100 characters. | | `source` | string | No | Incoming rules: an address or network. Default `any`. | | `destination` | string | No | Outgoing rules: an address or network. Default `any`. | | `comment` | string | No | Up to 60 characters. | Give a port, an address, or both. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/firewall/rules \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "allow", "protocol": "tcp", "port": "8080", "source": "203.0.113.0/24", "comment": "Office" }' ``` **JavaScript** ```js const job = await panel.security.addFirewallRule(serverId, { action: 'allow', protocol: 'tcp', port: '8080', source: '203.0.113.0/24', comment: 'Office', }); ``` **Response** `202 Accepted`: the job, message `Adding the rule`. **Errors** (besides those of [every server change](https://docs.vaultpanel.net/api-reference/security#server-changes-are-jobs)) | Status | Code | When | | --- | --- | --- | | 409 | `LOCKOUT_REFUSED` | An incoming `deny` or `reject` rule whose source includes your own address. | ## Delete a firewall rule `POST /api/v1/security/servers/:id/firewall/rules/delete` — Permission: security.manage — Token scope: servers Deletes the rule that matches the fields given: the same fields as [Add a firewall rule](https://docs.vaultpanel.net/api-reference/security#add-a-firewall-rule) without `comment`, plus `app` for a rule UFW created for an application profile (up to 64 characters). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/firewall/rules/delete \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "action": "allow", "protocol": "tcp", "port": "8080", "source": "203.0.113.0/24" }' ``` **JavaScript** ```js const job = await panel.security.removeFirewallRule(serverId, { action: 'allow', protocol: 'tcp', port: '8080', source: '203.0.113.0/24', }); ``` **Response** `202 Accepted`: the job, message `Deleting the rule`. ## Set the firewall defaults `PUT /api/v1/security/servers/:id/firewall/default` — Permission: security.manage — Token scope: servers Sets what happens to traffic no rule matches. Give at least one of the two. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `incoming` | string | No | `deny` (recommended), `reject` or `allow`. | | `outgoing` | string | No | `allow` (usual), `deny` or `reject`. Needs agent 0.34.0 or newer. | When outgoing connections are denied by default, the agent keeps what the server needs allowed: reaching the panel, name lookups, updates, the clock and mail. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/firewall/default \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "incoming": "deny" }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/firewall/default`, { body: { incoming: 'deny' }, }); ``` **Response** `202 Accepted`: the job, message `Changing the default`. ## Change SSH settings `PUT /api/v1/security/servers/:id/ssh` — Permission: security.manage — Token scope: servers Changes the SSH server's sign-in settings (`SSH_CONFIGURE`). Send all three fields. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `permitRootLogin` | string | Yes | `yes`, `prohibit-password` (keys only) or `no`. | | `passwordAuthentication` | boolean | Yes | Allow sign-in with a password. | | `maxAuthTries` | integer | Yes | 1 to 10. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/ssh \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "permitRootLogin": "prohibit-password", "passwordAuthentication": false, "maxAuthTries": 3 }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/ssh`, { body: { permitRootLogin: 'prohibit-password', passwordAuthentication: false, maxAuthTries: 3 }, }); ``` **Response** `202 Accepted`: the job, message `Applying SSH settings`. ## Change SSH ports `PUT /api/v1/security/servers/:id/ssh/ports` — Permission: security.manage — Token scope: servers Sets the ports SSH listens on: one, or two while you move to a new port. Needs agent 0.34.0 or newer. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `ports` | integer[] | Yes | 1 or 2 different ports from 1 to 65535. Not 80 or 443, and not the panel's own port. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/ssh/ports \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ports": [22, 2222] }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/ssh/ports`, { body: { ports: [22, 2222] }, }); ``` **Response** `202 Accepted`: the job, message `Changing the SSH port`. **Errors** (besides those of [every server change](https://docs.vaultpanel.net/api-reference/security#server-changes-are-jobs)) | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | A port is the one people reach the panel on, is reserved, or appears twice. | ## Add an SSH key `POST /api/v1/security/servers/:id/ssh/keys` — Permission: security.manage — Token scope: servers Adds a public key to an account's `authorized_keys` (`SSH_KEY_ADD`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `key` | string | Yes | One public key line, such as the contents of `~/.ssh/id_ed25519.pub`. Types: `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`, `sk-ssh-ed25519@openssh.com`, `sk-ecdsa-sha2-nistp256@openssh.com`. Options in front of the key are not accepted. | | `user` | string | No | The Linux account. Default `root`; other accounts need agent 0.34.0 or newer. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/ssh/keys \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"key\": \"$(cat ~/.ssh/id_ed25519.pub)\" }" ``` **JavaScript** ```js import { readFile } from 'node:fs/promises'; const key = (await readFile(`${process.env.HOME}/.ssh/id_ed25519.pub`, 'utf8')).trim(); const job = await panel.request('POST', `/security/servers/${serverId}/ssh/keys`, { body: { key } }); ``` **Response** `202 Accepted`: the job, message `Adding the key`. ## Remove an SSH key `POST /api/v1/security/servers/:id/ssh/keys/delete` — Permission: security.manage — Token scope: servers Removes a key by its fingerprint (`SSH_KEY_REMOVE`). The `SECURITY_STATUS` operation lists each account's keys with their fingerprints. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `fingerprint` | string | Yes | The key's SHA256 fingerprint: `SHA256:` and 43 base64 characters. | | `user` | string | No | The Linux account. Default `root`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/ssh/keys/delete \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "fingerprint": "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8" }' ``` **JavaScript** ```js const job = await panel.request('POST', `/security/servers/${serverId}/ssh/keys/delete`, { body: { fingerprint: 'SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8' }, }); ``` **Response** `202 Accepted`: the job, message `Removing the key`. ## Set the login message `PUT /api/v1/security/servers/:id/login-banner` — Permission: security.manage — Token scope: servers Chooses what SSH logins and the browser terminal show: only the VaultPanel banner (with this server's name and the panel's address), or the system's own welcome message (`LOGIN_BANNER_SET`, agent 0.21.0 or newer). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `vaultpanelOnly` | boolean | Yes | `true` shows only the VaultPanel banner; `false` brings back the system's message. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/login-banner \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "vaultpanelOnly": false }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/login-banner`, { body: { vaultpanelOnly: false }, }); ``` **Response** `202 Accepted`: the job, message `Changing the login message`. ## Configure Fail2ban `PUT /api/v1/security/servers/:id/fail2ban` — Permission: security.manage — Token scope: servers Turns Fail2ban's SSH protection on or off and sets its limits (`FAIL2BAN_CONFIGURE`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | Turn Fail2ban on or off. | | `maxRetry` | integer | No | Failed attempts before a ban: 1 to 20, default 5. | | `findTimeMinutes` | integer | No | The window those attempts are counted in: 1 to 1440, default 10. | | `banTimeMinutes` | integer | No | How long a ban lasts: 1 to 43200, default 60. | | `ignoreIps` | string[] | No | Up to 20 addresses or networks never banned. Default none. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/fail2ban \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "maxRetry": 5, "findTimeMinutes": 10, "banTimeMinutes": 60, "ignoreIps": ["203.0.113.0/24"] }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/fail2ban`, { body: { enabled: true, maxRetry: 5, findTimeMinutes: 10, banTimeMinutes: 60, ignoreIps: ['203.0.113.0/24'] }, }); ``` **Response** `202 Accepted`: the job, message `Applying Fail2ban settings`. ## Unban an address `POST /api/v1/security/servers/:id/fail2ban/unban` — Permission: security.manage — Token scope: servers Lifts Fail2ban's ban on one address (`FAIL2BAN_UNBAN`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `ip` | string | Yes | One IP address (not a network). | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/fail2ban/unban \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ip": "198.51.100.7" }' ``` **JavaScript** ```js const job = await panel.request('POST', `/security/servers/${serverId}/fail2ban/unban`, { body: { ip: '198.51.100.7' }, }); ``` **Response** `202 Accepted`: the job, message `Unblocking the address`. ## Turn automatic updates on or off `PUT /api/v1/security/servers/:id/updates` — Permission: security.manage — Token scope: servers Turns automatic security updates (unattended-upgrades) on or off (`AUTO_UPDATES_CONFIGURE`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | `true` installs security updates automatically. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/updates \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }' ``` **JavaScript** ```js const job = await panel.request('PUT', `/security/servers/${serverId}/updates`, { body: { enabled: true } }); ``` **Response** `202 Accepted`: the job, message `Changing automatic updates`. ## Install security updates `POST /api/v1/security/servers/:id/updates/install` — Permission: security.manage — Token scope: servers Installs the pending security updates now (`SECURITY_UPDATES_INSTALL`). No body. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/updates/install \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.security.installUpdates(serverId); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: the job, message `Installing security updates`. ## Get panel access `GET /api/v1/security/panel-access` — Permission: settings.manage — Token scope: full Returns the list of addresses allowed to use the panel, whether the list is on, and who it applies to. `disabledByEnv` is `true` when `VAULTPANEL_PANEL_ACCESS=off` in the panel's `.env` turns the check off. Requests from addresses not on an enabled list are refused with `403 IP_NOT_ALLOWED` (`details.address`). Requests from the server itself (loopback) are always allowed. See [Panel access](https://docs.vaultpanel.net/guides/security/panel-access). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/panel-access \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const access = await panel.request('GET', '/security/panel-access'); ``` **Response** `200 OK` ```json { "success": true, "data": { "enabled": true, "scope": "staff", "addresses": [{ "address": "203.0.113.0/24", "note": "Office" }], "yourAddress": "203.0.113.25", "disabledByEnv": false }, "message": "OK", "requestId": "…" } ``` ## Set panel access `PUT /api/v1/security/panel-access` — Permission: settings.manage — Token scope: full Saves the list. It cannot be turned on, or saved while on, unless your own address is in it. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | Turn the list on. Needs at least one address. | | `scope` | string | No | `everyone` (default: staff and hosting customers) or `staff` (customers sign in from anywhere). | | `addresses` | object[] | Yes | Up to 50 entries `{ address, note }`: an IP address or network such as `203.0.113.0/24`, each once, and an optional note of up to 60 characters. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/panel-access \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "scope": "staff", "addresses": [{ "address": "203.0.113.0/24", "note": "Office" }] }' ``` **JavaScript** ```js await panel.request('PUT', '/security/panel-access', { body: { enabled: true, scope: 'staff', addresses: [{ address: '203.0.113.0/24', note: 'Office' }] }, }); ``` **Response** `200 OK`: the saved settings as in [Get panel access](https://docs.vaultpanel.net/api-reference/security#get-panel-access), message `Panel access saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `LOCKOUT_REFUSED` | Your own address is not in the list. | | 422 | `VALIDATION_ERROR` | Turned on with no addresses, an invalid address, or an address twice. | ## Get the sign-in policy `GET /api/v1/security/authentication` — Permission: settings.manage — Token scope: full Returns the two-factor policy and every user's two-factor state, recovery codes left and active sessions. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/authentication \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { twoFactorPolicy, users } = await panel.request('GET', '/security/authentication'); ``` **Response** `200 OK` ```json { "success": true, "data": { "twoFactorPolicy": "admins", "users": [ { "id": "3c4d5e6f-…", "email": "owner@example.com", "name": "Sam Owner", "role": "owner", "isActive": true, "twoFactorEnabled": true, "recoveryCodesLeft": 9, "activeSessions": 2, "lastLoginAt": "2026-11-10T08:00:00.000Z" } ] }, "message": "OK", "requestId": "…" } ``` ## Set the two-factor policy `PUT /api/v1/security/authentication` — Permission: settings.manage — Token scope: full Sets who must use two-factor sign-in. People the policy covers who have not set it up are sent to set it up at their next request: every other route answers `403 TWO_FACTOR_SETUP_REQUIRED` until they do. See [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `twoFactorPolicy` | string | Yes | `off` (each person decides), `admins` (owners and admins must) or `all` (every account must). | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/authentication \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "twoFactorPolicy": "admins" }' ``` **JavaScript** ```js await panel.request('PUT', '/security/authentication', { body: { twoFactorPolicy: 'admins' } }); ``` **Response** `200 OK`: the same data as [Get the sign-in policy](https://docs.vaultpanel.net/api-reference/security#get-the-sign-in-policy), message `Sign-in policy saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `TWO_FACTOR_REQUIRED_FIRST` | Turning the policy on before your own account uses two-factor sign-in. | | 422 | `VALIDATION_ERROR` | Unknown policy. | ## List sessions `GET /api/v1/security/sessions` — Permission: users.manage — Token scope: full Returns everyone's signed-in sessions, most recently used first (up to 500). `current` marks the session making the request. Your own sessions are also at `GET /api/v1/auth/sessions`; see [Authentication](https://docs.vaultpanel.net/api-reference/authentication). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/sessions \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/security/sessions'); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "8d9e0f1a-…", "user": { "id": "3c4d5e6f-…", "email": "owner@example.com", "name": "Sam Owner" }, "ip": "198.51.100.7", "userAgent": "Mozilla/5.0 …", "createdAt": "2026-11-10T08:00:00.000Z", "lastSeenAt": "2026-11-10T10:20:00.000Z", "expiresAt": "2026-11-17T08:00:00.000Z", "current": false } ] }, "message": "OK", "requestId": "…" } ``` ## Sign out a session `DELETE /api/v1/security/sessions/:id` — Permission: users.manage — Token scope: full Ends someone's session. You cannot end a session of someone whose role ranks above yours, nor the session you are using (sign out instead). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/security/sessions/8d9e0f1a-2b3c-4d5e-8f6a-7b8c9d0e1f2a \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('DELETE', `/security/sessions/${sessionId}`); ``` **Response** `200 OK`: `data` is `null`, message `Session signed out`. **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | The session is the one you are using. | | 403 | `FORBIDDEN` | The session's user has a higher role than yours. | | 404 | `NOT_FOUND` | No active session with this id. | --- # Websites URL: https://docs.vaultpanel.net/api-reference/websites > API reference for websites, SSL certificates, website files, uptime checks, Git deploy, caching, the firewall, statistics, SFTP, malware scans, copies, WordPress tools, subdomains and domains. A website is a site NGINX serves on one of your servers: **static** files, a **PHP** site on its own PHP-FPM pool, or a **reverse proxy** to an app's port. The site's name is also its Linux user and the folder under `/var/www`. See [Websites](https://docs.vaultpanel.net/guides/websites). Hosting customers can use every endpoint on this page for their own websites, except custom NGINX rules, which are set by their host. ## How changes work Creating, changing, enabling, disabling and deleting a website, and every SSL change, returns `202 Accepted` with `{ website, job }`. The panel saves the request, the agent carries it out, and the website keeps its current settings until the job succeeds. While it runs, `status` is `creating`, `updating` or `deleting` and `pendingAction` names the change. A failed change leaves the settings as they were and sets `lastError`. A request that changes nothing answers `200` with `job: null`. Only one change runs at a time: another change while one is running answers `409 WEBSITE_BUSY` with the running job's id in `details.jobId`. File and log requests are jobs too. Their result arrives in the job's `output`; poll [`GET /jobs/:id`](https://docs.vaultpanel.net/api-reference/jobs#get-a-job-and-its-logs) for it. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/websites` | [List websites](https://docs.vaultpanel.net/api-reference/websites#list-websites) | | POST | `/api/v1/websites` | [Create a website](https://docs.vaultpanel.net/api-reference/websites#create-a-website) | | GET | `/api/v1/websites/:id` | [Get a website](https://docs.vaultpanel.net/api-reference/websites#get-a-website) | | PATCH | `/api/v1/websites/:id` | [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website) | | DELETE | `/api/v1/websites/:id` | [Delete a website](https://docs.vaultpanel.net/api-reference/websites#delete-a-website) | | POST | `/api/v1/websites/:id/enable` | [Enable or disable a website](https://docs.vaultpanel.net/api-reference/websites#enable-or-disable-a-website) | | POST | `/api/v1/websites/:id/disable` | [Enable or disable a website](https://docs.vaultpanel.net/api-reference/websites#enable-or-disable-a-website) | | POST | `/api/v1/websites/:id/retry` | [Retry creating a website](https://docs.vaultpanel.net/api-reference/websites#retry-creating-a-website) | | POST | `/api/v1/websites/:id/ssl` | [Issue a Let's Encrypt certificate](https://docs.vaultpanel.net/api-reference/websites#issue-a-lets-encrypt-certificate) | | POST | `/api/v1/websites/:id/ssl/upload` | [Install your own certificate](https://docs.vaultpanel.net/api-reference/websites#install-your-own-certificate) | | POST | `/api/v1/websites/:id/ssl/renew` | [Renew a certificate](https://docs.vaultpanel.net/api-reference/websites#renew-a-certificate) | | DELETE | `/api/v1/websites/:id/ssl` | [Turn HTTPS off](https://docs.vaultpanel.net/api-reference/websites#turn-https-off) | | POST | `/api/v1/websites/:id/logs` | [Read website logs](https://docs.vaultpanel.net/api-reference/websites#read-website-logs) | | POST | `/api/v1/websites/:id/dns-check` | [Check a website's DNS](https://docs.vaultpanel.net/api-reference/websites#check-a-websites-dns) | | GET | `/api/v1/websites/:id/uptime` | [Get uptime](https://docs.vaultpanel.net/api-reference/websites#get-uptime) | | PUT | `/api/v1/websites/:id/uptime` | [Turn uptime monitoring on or off](https://docs.vaultpanel.net/api-reference/websites#turn-uptime-monitoring-on-or-off) | | POST | `/api/v1/websites/:id/uptime/check` | [Check uptime now](https://docs.vaultpanel.net/api-reference/websites#check-uptime-now) | | POST | `/api/v1/websites/:id/files/:action` | [Run a file action](https://docs.vaultpanel.net/api-reference/websites#run-a-file-action) | | POST | `/api/v1/websites/:id/files/uploads` | [Upload a large file](https://docs.vaultpanel.net/api-reference/websites#upload-a-large-file) | | PUT | `/api/v1/websites/:id/files/uploads/:uploadId/chunks/:offset` | [Upload a large file](https://docs.vaultpanel.net/api-reference/websites#upload-a-large-file) | | POST | `/api/v1/websites/:id/files/uploads/:uploadId/finish` | [Upload a large file](https://docs.vaultpanel.net/api-reference/websites#upload-a-large-file) | | POST | `/api/v1/websites/:id/files/downloads` | [Download a file](https://docs.vaultpanel.net/api-reference/websites#download-a-file) | | GET | `/api/v1/websites/:id/files/downloads/:downloadId` | [Download a file](https://docs.vaultpanel.net/api-reference/websites#download-a-file) | | GET | `/api/v1/websites/:id/files/downloads/:downloadId/file` | [Download a file](https://docs.vaultpanel.net/api-reference/websites#download-a-file) | | PUT | `/api/v1/websites/:id/git` | [Set up Git deploy](https://docs.vaultpanel.net/api-reference/websites#set-up-git-deploy) | | DELETE | `/api/v1/websites/:id/git` | [Turn Git deploy off](https://docs.vaultpanel.net/api-reference/websites#turn-git-deploy-off) | | POST | `/api/v1/websites/:id/deploy` | [Deploy a website from Git](https://docs.vaultpanel.net/api-reference/websites#deploy-a-website-from-git) | | POST | `/api/v1/websites/:id/rollback` | [Roll back a website](https://docs.vaultpanel.net/api-reference/websites#roll-back-a-website) | | GET | `/api/v1/websites/:id/deployments` | [List website deployments](https://docs.vaultpanel.net/api-reference/websites#list-website-deployments) | | GET | `/api/v1/websites/:id/environment` | [Get or set build variables](https://docs.vaultpanel.net/api-reference/websites#get-or-set-build-variables) | | PUT | `/api/v1/websites/:id/environment` | [Get or set build variables](https://docs.vaultpanel.net/api-reference/websites#get-or-set-build-variables) | | POST | `/api/v1/websites/:id/git/webhook` | [Turn push to deploy on or off](https://docs.vaultpanel.net/api-reference/websites#turn-push-to-deploy-on-or-off) | | DELETE | `/api/v1/websites/:id/git/webhook` | [Turn push to deploy on or off](https://docs.vaultpanel.net/api-reference/websites#turn-push-to-deploy-on-or-off) | | POST | `/api/v1/websites/:id/cache/purge` | [Empty the page cache](https://docs.vaultpanel.net/api-reference/websites#empty-the-page-cache) | | POST | `/api/v1/websites/:id/firewall/events` | [Read firewall events](https://docs.vaultpanel.net/api-reference/websites#read-firewall-events) | | GET | `/api/v1/websites/:id/stats` | [Get website statistics](https://docs.vaultpanel.net/api-reference/websites#get-website-statistics) | | POST | `/api/v1/websites/:id/stats/refresh` | [Read statistics now](https://docs.vaultpanel.net/api-reference/websites#read-statistics-now) | | GET | `/api/v1/websites/:id/sftp` | [Get SFTP settings](https://docs.vaultpanel.net/api-reference/websites#get-sftp-settings) | | PUT | `/api/v1/websites/:id/sftp` | [Change SFTP settings](https://docs.vaultpanel.net/api-reference/websites#change-sftp-settings) | | GET | `/api/v1/websites/:id/malware` | [Get malware scan results](https://docs.vaultpanel.net/api-reference/websites#get-malware-scan-results) | | POST | `/api/v1/websites/:id/malware/scan` | [Scan a website for malware](https://docs.vaultpanel.net/api-reference/websites#scan-a-website-for-malware) | | POST | `/api/v1/websites/:id/malware/actions` | [Act on malware findings](https://docs.vaultpanel.net/api-reference/websites#act-on-malware-findings) | | GET | `/api/v1/websites/:id/copies` | [List a website's copies](https://docs.vaultpanel.net/api-reference/websites#list-a-websites-copies) | | POST | `/api/v1/websites/:id/clone` | [Clone a website](https://docs.vaultpanel.net/api-reference/websites#clone-a-website) | | POST | `/api/v1/websites/:id/staging` | [Make a staging copy](https://docs.vaultpanel.net/api-reference/websites#make-a-staging-copy) | | POST | `/api/v1/websites/:id/push` | [Push staging to live](https://docs.vaultpanel.net/api-reference/websites#push-staging-to-live) | | POST | `/api/v1/cms/installs/:id/wordpress/status` | [Read WordPress status](https://docs.vaultpanel.net/api-reference/websites#read-wordpress-status) | | POST | `/api/v1/cms/installs/:id/wordpress/actions` | [Change WordPress](https://docs.vaultpanel.net/api-reference/websites#change-wordpress) | | GET | `/api/v1/subdomains/parents` | [List subdomain parents](https://docs.vaultpanel.net/api-reference/websites#list-subdomain-parents) | | POST | `/api/v1/subdomains` | [Create a subdomain](https://docs.vaultpanel.net/api-reference/websites#create-a-subdomain) | | GET | `/api/v1/domains` | [List domains](https://docs.vaultpanel.net/api-reference/websites#list-domains) | | POST | `/api/v1/domains/:id/dns-check` | [Check a domain's DNS](https://docs.vaultpanel.net/api-reference/websites#check-a-domains-dns) | | GET | `/api/v1/ssl-certificates` | [List certificates](https://docs.vaultpanel.net/api-reference/websites#list-certificates) | | GET | `/api/v1/ssl-certificates/renewal` | [Get renewal settings](https://docs.vaultpanel.net/api-reference/websites#get-renewal-settings) | | PUT | `/api/v1/ssl-certificates/renewal` | [Change renewal settings](https://docs.vaultpanel.net/api-reference/websites#change-renewal-settings) | ## The website object ```json { "id": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "serverStatus": "online", "customerId": null, "subdomainOf": null, "dnsRecords": [], "name": "shop", "type": "php", "primaryDomain": "shop.example.com", "domains": [ { "id": "d4c3b2a1-…", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "domain": "shop.example.com", "isPrimary": true, "dns": { "status": "ok", "addresses": ["203.0.113.10"], "checkedAt": "2026-11-10T09:00:00.000Z" }, "createdAt": "2026-11-01T10:00:00.000Z" } ], "documentRoot": "public", "phpVersion": "8.3", "proxyPort": null, "customNginx": "", "htaccess": false, "spa": false, "stagingOf": null, "pageCache": { "enabled": true, "minutes": 10 }, "waf": { "mode": "detect", "exclude": [942100] }, "loginLimit": { "perMinute": 10, "blockXmlrpc": true }, "phpSettings": { "uploadMb": 128, "memoryMb": 256, "maxExecutionSeconds": 120, "maxInputVars": 3000, "workers": 10 }, "isEnabled": true, "forceHttps": true, "status": "active", "pendingAction": null, "provisioned": true, "health": { "status": "ok", "message": "HTTP 200", "checkedAt": "2026-11-01T10:00:20.000Z" }, "uptime": { "enabled": true, "status": "up", "since": "2026-11-01T10:05:00.000Z", "checkedAt": "2026-11-10T11:00:00.000Z", "message": null }, "ssl": { "id": "6a5b4c3d-…", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "certName": "vp-shop", "provider": "letsencrypt", "dnsProviderId": null, "status": "active", "state": "active", "daysLeft": 81, "domains": ["shop.example.com"], "issuer": "R11", "isStaging": false, "email": "ada@example.com", "notBefore": "2026-11-01T09:00:00.000Z", "notAfter": "2027-01-30T09:00:00.000Z", "issuedAt": "2026-11-01T10:02:00.000Z", "lastJobId": "…", "lastError": null, "updatedAt": "2026-11-01T10:02:00.000Z" }, "application": null, "git": null, "uncoveredDomains": [], "lastJobId": "…", "lastError": null, "createdAt": "2026-11-01T10:00:00.000Z", "updatedAt": "2026-11-01T10:02:00.000Z" } ``` | Field | Description | | --- | --- | | `type` | `static`, `php` or `proxy`. | | `status` | `creating`, `active`, `updating`, `disabled`, `deleting` or `failed`. | | `domains` | The first is the primary domain. `dns.status` is `ok` (points at the server), `mismatch`, `unresolved` or `error`, after a DNS check. | | `documentRoot` | The folder inside the site that is served, such as `public`. | | `customNginx`, `htaccess`, `spa` | Custom NGINX rules, `.htaccess` support through Apache, and the single-page app setting (static sites). See [NGINX rules and .htaccess](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess). | | `stagingOf` | For a [staging copy](https://docs.vaultpanel.net/api-reference/websites#make-a-staging-copy): the id of the live website, else `null`. | | `pageCache` | PHP sites: `{ enabled, minutes }`, NGINX's page cache. `null` for other types. | | `waf` | The web application firewall: `{ mode, exclude }`, `mode` being `detect` or `block` and `exclude` the rule ids turned off for this site. `null` when off. | | `loginLimit` | PHP sites: `{ perMinute, blockXmlrpc }`, the limit on WordPress sign-in attempts. `null` when off. | | `phpSettings` | PHP sites: the PHP-FPM pool's limits, defaults filled in. `null` for other types. | | `health` | The agent's check right after the last change: `status` is `ok` or `failing`. | | `uptime` | The panel's own uptime checks. [Get uptime](https://docs.vaultpanel.net/api-reference/websites#get-uptime) has more. | | `ssl` | The certificate, or `null`. `status` is `pending`, `active`, `failed` or `inactive`; `state` adds `expiring` and `expired`. `provider` is `letsencrypt` or `custom` (uploaded). | | `application` | The app this site serves as a reverse proxy, or `null`. | | `git` | Git deploy settings, or `null` while the site is managed with the file manager. See [Set up Git deploy](https://docs.vaultpanel.net/api-reference/websites#set-up-git-deploy). | | `uncoveredDomains` | Domains added after the active certificate was issued, which it does not cover. | | `subdomainOf`, `dnsRecords` | For sites added as [subdomains](https://docs.vaultpanel.net/api-reference/websites#create-a-subdomain): the parent domain and the DNS records the panel added. | ## List websites `GET /api/v1/websites` — Permission: websites.read — Token scope: read Websites, newest first. Hosting customers see only their own. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches the site name or any of its domains. | | `serverId` | string | No | Sites on one server. | | `status` | string | No | One of the statuses above. | | `subdomains` | boolean | No | `true` lists only sites added as subdomains. | | `sort` | string | No | `createdAt` (default) or `name`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/websites?search=example.com" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.websites.list({ search: 'example.com' }); ``` **Response** `200 OK`: `{ items: [website], pagination }`. ## Create a website `POST /api/v1/websites` — Permission: websites.manage — Token scope: manage Saves the website and queues a `CREATE_SITE` job that creates its Linux user and folders, its PHP-FPM pool for PHP sites, and its NGINX configuration, then checks it answers. NGINX must be installed on the server. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | Yes | The server to create it on. | | `name` | string | Yes | 3 to 32 lowercase letters, digits and dashes, starting with a letter. Becomes the Linux user and folder name; unique per server among websites and apps. | | `type` | string | Yes | `static`, `php` or `proxy`. | | `domains` | string[] | Yes | 1 to 20 domains; the first is the primary one. A domain may be a wildcard one level deep, such as `*.example.com` (agent 0.37.0 or later). | | `documentRoot` | string | No | The folder inside the site to serve. Default `public`. | | `phpVersion` | string | For `php` | A PHP version installed on the server, such as `8.3`. | | `proxyPort` | integer | For `proxy` | The local port of the app to forward to, 1 to 65535. A hosting customer may only point at one of their own apps. | A wildcard domain serves every name under its domain that no other site lists itself, since NGINX prefers exact names. It cannot sit directly on a registry suffix such as `*.co.uk`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{ "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "shop", "type": "php", "domains": ["shop.example.com", "www.shop.example.com"], "phpVersion": "8.3" }' ``` **JavaScript** ```js const { website, job } = await panel.websites.create({ serverId, name: 'shop', type: 'php', domains: ['shop.example.com', 'www.shop.example.com'], phpVersion: '8.3', }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "website": { "id": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "name": "shop", "type": "php", "status": "creating", "pendingAction": "create", "provisioned": false }, "job": { "id": "a1d3c5e7-…", "type": "CREATE_SITE", "status": "queued" } }, "message": "Website saved. The agent is creating it on the server.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `NGINX_NOT_INSTALLED` | Install the web stack on the server first. | | 409 | `AGENT_OUTDATED` | A wildcard domain needs agent 0.37.0 or later. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more websites. | | 422 | `VALIDATION_ERROR` | An invalid field, a name or domain already taken, a missing `phpVersion` or `proxyPort`, or a server that was not found. | ## Get a website `GET /api/v1/websites/:id` — Permission: websites.read — Token scope: read The website with its 10 most recent change jobs in `recentJobs` (creation, configuration, SSL, file changes and Git deploys). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const website = await panel.websites.get(websiteId); ``` **Response** `200 OK`: [the website object](https://docs.vaultpanel.net/api-reference/websites#the-website-object) with `recentJobs`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such website, or not yours. | ## Update a website `PATCH /api/v1/websites/:id` — Permission: websites.manage — Token scope: manage Changes a website's settings. The changes are merged with the current ones, checked again and applied by a `CREATE_NGINX_CONFIG` job. Send at least one field. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | No | `static`, `php` or `proxy`. | | `domains` | string[] | No | The full new list, 1 to 20; the first is primary. | | `documentRoot` | string | No | The folder to serve. | | `phpVersion` | string or null | No | For PHP sites. | | `proxyPort` | integer or null | No | For reverse proxies. | | `forceHttps` | boolean | No | Redirect HTTP to HTTPS. Needs an active certificate. | | `customNginx` | string | No | Custom NGINX rules for the site's server block, up to 8192 characters. Staff only; needs agent 0.18.0. | | `htaccess` | boolean | No | Honour `.htaccess` files through Apache behind NGINX. Needs agent 0.18.0. | | `spa` | boolean | No | Static sites: serve `index.html` for every path a file does not match. Needs agent 0.30.0. | | `pageCache` | object or null | No | PHP sites: `{ "minutes": 1-1440 }` turns NGINX's page cache on, keeping pages that many minutes; `null` turns it off. Not with `htaccess`. Needs agent 0.43.0. See [Caching](https://docs.vaultpanel.net/guides/websites/caching). | | `phpSettings` | object | No | PHP sites: any of `uploadMb` (1 to 2048), `memoryMb` (32 to 4096), `maxExecutionSeconds` (5 to 3600), `maxInputVars` (100 to 100000) and `workers` (1 to 100); the others keep their values. Needs agent 0.43.0. See [PHP settings](https://docs.vaultpanel.net/guides/websites/php-settings). | | `waf` | object or null | No | `{ "mode": "detect" \| "block", "exclude": [ruleId] }` turns the web application firewall on, with up to 100 rule ids turned off for this site; `null` turns it off. The firewall must be installed on the server. Needs agent 0.44.0. See [Web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall). | | `loginLimit` | object or null | No | PHP sites: `{ "perMinute": 1-60, "blockXmlrpc": boolean }` limits WordPress sign-in attempts from one address; `null` removes the limit. Needs agent 0.44.0. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"phpVersion":"8.4","forceHttps":true}' ``` **JavaScript** ```js const { website, job } = await panel.websites.update(websiteId, { phpVersion: '8.4', forceHttps: true }); ``` **Response** `202 Accepted` with `{ website, job }`, or `200 OK` with `job: null` when nothing changes. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | A hosting customer sent `customNginx`. | | 409 | `WEBSITE_BUSY` | Another change is running (`details.jobId`). | | 409 | `WEBSITE_NOT_READY` | The site was never created on its server. Retry or delete it. | | 409 | `WEBSITE_OWNED_BY_APP` | The site serves an app; change the app's port instead. | | 409 | `WEBSITE_GIT_DEPLOY` | The site deploys from Git; turn Git deploy off before changing its type. | | 409 | `PANEL_WEBSITE` | The site serves the panel's own domain. Change it on the **Panel Domain** page. | | 409 | `AGENT_OUTDATED` | The setting needs a newer agent. | | 409 | `WAF_NOT_INSTALLED` | `waf` on a server without the web application firewall. Install it from the server's **Security** tab. | | 422 | `VALIDATION_ERROR` | An invalid value, `forceHttps` without a certificate, `pageCache`, `loginLimit` or `phpSettings` on a site that is not PHP, `pageCache` with `htaccess`, or nothing to update. | ## Delete a website `DELETE /api/v1/websites/:id` — Permission: websites.manage — Token scope: manage Removes the site from NGINX (and its PHP-FPM pool) with a `DELETE_SITE` job. Its files stay unless you ask for them to be removed. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `removeFiles` | boolean | No | Also delete the site's folder and Linux user. Default `false`. | **Example request** **cURL** ```bash curl -X DELETE "https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a?removeFiles=true" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.websites.remove(websiteId, { removeFiles: true }); ``` **Response** `202 Accepted` with `{ website, job }` (`status: "deleting"`). **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `WEBSITE_BUSY` | Another change is running. | | 409 | `WEBSITE_OWNED_BY_APP` | `removeFiles=true` on a site that serves an app: the files belong to the app. | | 409 | `PANEL_WEBSITE` | The site serves the panel's own domain. | ## Enable or disable a website `POST /api/v1/websites/:id/enable` — Permission: websites.manage — Token scope: manage `POST /api/v1/websites/:id/disable` — Permission: websites.manage — Token scope: manage A disabled website keeps its settings and files but NGINX stops serving it. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/disable \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.websites.disable(websiteId); await panel.websites.enable(websiteId); ``` **Response** `202 Accepted` with `{ website, job }`, or `200 OK` with `job: null` when it is already in that state. Errors as for [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website). ## Retry creating a website `POST /api/v1/websites/:id/retry` — Permission: websites.manage — Token scope: manage Queues `CREATE_SITE` again for a website whose creation failed. **Response** `202 Accepted` with `{ website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `WEBSITE_READY` | The website already exists on its server. | | 409 | `WEBSITE_BUSY` | Another change is running. | ## Issue a Let's Encrypt certificate `POST /api/v1/websites/:id/ssl` — Permission: websites.manage — Token scope: manage Requests a free certificate from Let's Encrypt with Certbot (`ISSUE_SSL`) for the site's domains and turns HTTPS on. Let's Encrypt must reach the site over HTTP, so the site must be enabled and its domains must point at the server. Renewal is automatic. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). **Wildcard certificates.** With `wildcard: true`, one certificate covers the domain and `*.domain`, checked through DNS: the domain needs an active [DNS zone](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) on the site's server. Or pass `dnsProviderId` to check it through [Cloudflare or Namecheap](https://docs.vaultpanel.net/guides/dns-and-email/dns-providers) instead, with no zone on the server (staff with `dns.read`, agent 0.38.0 or later). Without either, the site's wildcard domains are left out of the certificate; a site whose domains are all wildcards always asks for a wildcard certificate. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Let's Encrypt's contact address for expiry notices. | | `staging` | boolean | No | Use Let's Encrypt's staging service, for a test certificate browsers do not trust. Default `false`. | | `verifyDns` | boolean | No | Check the domains point at the server first. Default `true`. | | `forceHttps` | boolean | No | Redirect HTTP to HTTPS once issued. Default `true`. | | `wildcard` | boolean | No | Ask for a wildcard certificate through the server's DNS zone. Default `false`. | | `dnsProviderId` | string or null | No | A DNS provider to check a wildcard certificate through. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/ssl \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"email":"ada@example.com","forceHttps":true}' ``` **JavaScript** ```js const { job } = await panel.websites.issueSsl(websiteId, { email: 'ada@example.com', forceHttps: true }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` with `{ website, job }`. The certificate is `pending` until the job finishes. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | `dnsProviderId` from a hosting customer, or without `dns.read`. | | 409 | `SITE_DISABLED` | Enable the website first. | | 409 | `CERTBOT_NOT_INSTALLED` | Install Certbot from the server's web stack first. | | 409 | `DNS_ZONE_MISSING` | A wildcard certificate needs a DNS zone for the domain on this server. | | 409 | `AGENT_OUTDATED` | Wildcard certificates need agent 0.28.0, DNS providers 0.38.0. | | 409 | `DNS_PROVIDER_NO_ADDRESS` | Namecheap needs the server's public IPv4 address, which the panel does not know. | | 409 | `WEBSITE_BUSY`, `WEBSITE_NOT_READY` | See [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website). | | 422 | `WILDCARD_NOT_POSSIBLE` | The site's domains do not fit one wildcard certificate. | | 422 | `DNS_PROVIDER_DOMAIN` | The panel cannot tell which Namecheap domain the name belongs to. | ## Install your own certificate `POST /api/v1/websites/:id/ssl/upload` — Permission: websites.manage — Token scope: manage Installs a certificate bought elsewhere (`INSTALL_SSL_CERT`). The agent checks that the key matches, the certificate is valid now and it covers every domain of the site before it goes live. The private key is removed from the stored job. Uploaded certificates show `provider: "custom"` and are never renewed by the panel. Needs agent 0.28.0. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `certificate` | string | Yes | PEM certificate with its chain, up to 65536 characters. | | `privateKey` | string | Yes | PEM private key, up to 16384 characters. | | `forceHttps` | boolean | No | Redirect HTTP to HTTPS. Default `true`. | **Example request** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/ssl/upload \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d "$(jq -n --rawfile cert fullchain.pem --rawfile key privkey.pem '{certificate: $cert, privateKey: $key}')" ``` **Response** `202 Accepted` with `{ website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `AGENT_OUTDATED` | The agent is older than 0.28.0. | | 409 | `WEBSITE_BUSY`, `WEBSITE_NOT_READY` | See [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website). | | 422 | `VALIDATION_ERROR` | The PEM data is missing or not a certificate and key. | ## Renew a certificate `POST /api/v1/websites/:id/ssl/renew` — Permission: websites.manage — Token scope: manage Renews a Let's Encrypt certificate now (`RENEW_SSL`). Without `force`, Certbot renews only inside the renewal window. Certificates also renew on their own; see [Get renewal settings](https://docs.vaultpanel.net/api-reference/websites#get-renewal-settings). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `force` | boolean | No | Renew even when the certificate is not due. Default `false`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/ssl/renew \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"force":true}' ``` **JavaScript** ```js await panel.websites.renewSsl(websiteId, { force: true }); ``` **Response** `202 Accepted` with `{ website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SSL_NOT_FOUND` | The site has no certificate yet. | | 409 | `SSL_CUSTOM` | The certificate was uploaded; upload the renewed one instead. | | 409 | `WEBSITE_BUSY` | Another change is running. | ## Turn HTTPS off `DELETE /api/v1/websites/:id/ssl` — Permission: websites.manage — Token scope: manage Serves the site over HTTP only again. The certificate stays on the server until the site is deleted, so HTTPS can be turned back on. **Example request** **cURL** ```bash curl -X DELETE https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/ssl \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.websites.disableSsl(websiteId); ``` **Response** `202 Accepted` with `{ website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SSL_NOT_ACTIVE` | HTTPS is not on for this website. | ## Read website logs `POST /api/v1/websites/:id/logs` — Permission: websites.logs — Token scope: logs Queues a routine `SITE_LOGS` job that reads the last lines of the site's NGINX access or error log. The lines arrive in the job's `output`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `log` | string | Yes | `access` or `error`. | | `lines` | integer | No | 10 to 2000. Default 200. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/logs \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"log":"error","lines":100}' ``` **JavaScript** ```js const job = await panel.websites.logs(websiteId, { log: 'error', lines: 100 }); const { job: done } = await panel.jobs.wait(job.id); console.log(done.output); ``` **Response** `202 Accepted` with the job. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | ## Check a website's DNS `POST /api/v1/websites/:id/dns-check` — Permission: websites.read — Token scope: read Looks up every domain of the site in public DNS and compares the addresses with the server's. The result is saved on each domain. For a wildcard domain, a random name under it is looked up. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/dns-check \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.websites.checkDns(websiteId); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "d4c3b2a1-…", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "domain": "shop.example.com", "isPrimary": true, "dns": { "status": "ok", "addresses": ["203.0.113.10"], "checkedAt": "2026-11-10T11:30:00.000Z" }, "createdAt": "2026-11-01T10:00:00.000Z", "serverAddresses": ["203.0.113.10"], "detail": null } ] }, "message": "DNS checked", "requestId": "…" } ``` `dns.status` is `ok` (an address matches the server), `mismatch` (it resolves elsewhere), `unresolved` (no A or AAAA records) or `error` (the lookup failed; `detail` says why). ## Get uptime `GET /api/v1/websites/:id/uptime` — Permission: websites.read — Token scope: read The panel checks each enabled website the way visitors reach it, every `VAULTPANEL_UPTIME_CHECK_SECONDS` (300 by default): the primary domain, or the first that is not a wildcard, over HTTPS when the certificate covers it. A site is **down** after no answer, an HTTP 5xx or a certificate browsers refuse, twice in a row 10 seconds apart. See [Uptime monitoring](https://docs.vaultpanel.net/guides/websites/uptime-monitoring). **Example request** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/uptime \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `200 OK` ```json { "success": true, "data": { "uptime": { "enabled": true, "intervalSeconds": 300, "status": "up", "since": "2026-11-01T10:05:00.000Z", "checkedAt": "2026-11-10T11:30:00.000Z", "message": null, "responseMs": 84, "url": "https://shop.example.com/", "certificateValidTo": "2027-01-30T09:00:00.000Z", "day": 100, "week": 99.9, "month": 99.97, "averageMs": 91, "incidents": [ { "id": "…", "startedAt": "2026-11-06T02:10:00.000Z", "endedAt": "2026-11-06T02:25:00.000Z", "message": "HTTP 502" } ] } }, "message": "OK", "requestId": "…" } ``` `status` is `up`, `down` or `null` (not checked yet). `day`, `week` and `month` are uptime percentages; `averageMs` is the last day's average response time; `incidents` are the 10 most recent downtimes. ## Turn uptime monitoring on or off `PUT /api/v1/websites/:id/uptime` — Permission: websites.manage — Token scope: manage Turning monitoring off forgets the current status and ends any open downtime, so its **Website down** alert resolves. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | Check this website. | **Example request** ```bash curl -X PUT https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/uptime \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"enabled":false}' ``` **Response** `200 OK`, the same as [Get uptime](https://docs.vaultpanel.net/api-reference/websites#get-uptime). ## Check uptime now `POST /api/v1/websites/:id/uptime/check` — Permission: websites.manage — Token scope: manage Checks the website once, now, without the second try. **Response** `200 OK`, the same as [Get uptime](https://docs.vaultpanel.net/api-reference/websites#get-uptime), message `Checked`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `UPTIME_NOT_CHECKED` | Monitoring is off for this website, or the website is disabled. | ## Run a file action `POST /api/v1/websites/:id/files/:action` — Permission: files.read, files.write — Token scope: manage The file manager. Each action queues a job that the agent runs as the site's own user, inside the site's home folder. `list` and `read` need `files.read` and are routine jobs; the others need `files.write`. The result is in the job's `output`. Paths are relative to the site's home folder. Absolute paths, `..` and control characters are refused. Files up to 1 MB can be read or written this way; use [Upload a large file](https://docs.vaultpanel.net/api-reference/websites#upload-a-large-file) and [Download a file](https://docs.vaultpanel.net/api-reference/websites#download-a-file) for bigger ones. Written contents never reach the audit log and are removed from the stored job, and read results are deleted an hour after the job. | Action | Body | What it does | | --- | --- | --- | | `list` | `path` (default `""`, the home folder) | Lists a folder. | | `read` | `path` | Reads a file up to 1 MB. | | `write` | `path`, `content`, `encoding` (`utf8` or `base64`, default `utf8`), `overwrite` (default `true`) | Saves a file up to 1 MB. | | `mkdir` | `path` | Creates a folder. | | `rename` | `from`, `to` | Renames or moves a file or folder. | | `delete` | `path` | Deletes a file or folder. | | `extract` | `path` (a `.zip`, `.tar.gz`, `.tgz` or `.tar`), `to` (default `""`), `overwrite` (default `false`) | Unpacks an archive; `to` is created when missing. | | `compress` | `folder` (default `""`), `names` (1 to 200 names in the folder), `to` (a path ending in `.zip`) | Makes a zip. | | `chmod` | `path`, `mode` (three octal digits such as `755`), `recursive` (default `false`), `fileMode` (required with `recursive`) | Changes permissions. With `recursive`, folders inside get `mode` and files `fileMode`; links are skipped. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/files/list \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"path":"public"}' ``` **JavaScript** ```js const job = await panel.websites.files(websiteId, 'list', { path: 'public' }); const { job: done } = await panel.jobs.wait(job.id, { intervalMs: 500 }); for (const entry of done.output.entries) console.log(entry.type, entry.name); ``` **Response** `202 Accepted` with the job, message `Queued`. A finished `list` job's output looks like: ```json { "path": "public", "entries": [ { "name": "assets", "type": "dir", "size": null, "mode": "0755", "modifiedAt": "2026-11-09T14:02:11.000Z" }, { "name": "index.php", "type": "file", "size": 1830, "mode": "0644", "modifiedAt": "2026-11-09T14:02:11.000Z" } ], "total": 2, "truncated": false } ``` `type` is `dir`, `file`, `link` or `other`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `WEBSITE_NOT_READY` | The site's files are not available (being created or deleted). | | 422 | `VALIDATION_ERROR` | Unknown action, or an invalid path or field. | ## Upload a large file Files larger than 1 MB, up to `VAULTPANEL_FILE_UPLOAD_MAX_MB` (2048 by default), go up in three steps, all with `files.write`: `POST /api/v1/websites/:id/files/uploads` — Permission: files.write — Token scope: manage `PUT /api/v1/websites/:id/files/uploads/:uploadId/chunks/:offset` — Permission: files.write — Token scope: manage `POST /api/v1/websites/:id/files/uploads/:uploadId/finish` — Permission: files.write — Token scope: manage 1. **Start** with `{ path, size, overwrite }` (`overwrite` defaults to `false`). The panel answers `201 Created` with `{ uploadId, chunkBytes, size }`. 2. **Send the pieces in order** as raw bytes (`Content-Type: application/octet-stream`), each up to `chunkBytes` (8 MB), at the byte offset it starts at. Each answers `{ received, size }`. 3. **Finish.** The panel answers `202 Accepted` with a `FILE_UPLOAD` job: the agent fetches the file from the panel, checks its SHA-256 and saves it as the site's user. Only the person who started an upload can continue it. ```bash SITE=0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a API=https://panel.example.com/api/v1/websites/$SITE/files/uploads SIZE=$(stat -c %s backup.zip) UPLOAD=$(curl -s "$API" -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d "{\"path\":\"backup.zip\",\"size\":$SIZE}" | jq -r .data.uploadId) split -b 8M -d backup.zip part- OFFSET=0 for PART in part-*; do curl -s -X PUT "$API/$UPLOAD/chunks/$OFFSET" -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/octet-stream" --data-binary @"$PART" > /dev/null OFFSET=$((OFFSET + $(stat -c %s "$PART"))) done curl -s -X POST "$API/$UPLOAD/finish" -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Errors** | Status | Code | When | | --- | --- | --- | | 400 | `BAD_REQUEST` | A piece arrived without a body. | | 404 | `NOT_FOUND` | No such upload, or it is not yours. | | 409 | `OFFSET_MISMATCH` | The piece does not start where the last one ended (`details.expected`). | | 409 | `UPLOAD_INCOMPLETE` | Finished before every byte arrived (`details.received`). | | 409 | `UPLOAD_FINISHED` | The upload is already complete. | | 413 | `FILE_TOO_LARGE` | `size` is over the panel's upload limit. | | 413 | `CHUNK_TOO_LARGE` | A piece is larger than `chunkBytes`. | | 422 | `UPLOAD_TOO_LARGE` | More data than the declared size. | ## Download a file Files of any size, up to `VAULTPANEL_FILE_DOWNLOAD_MAX_MB` (2048 by default), are sent to the panel by the agent first, then downloaded from the panel. All three steps need `files.read`. `POST /api/v1/websites/:id/files/downloads` — Permission: files.read — Token scope: manage `GET /api/v1/websites/:id/files/downloads/:downloadId` — Permission: files.read — Token scope: manage `GET /api/v1/websites/:id/files/downloads/:downloadId/file` — Permission: files.read — Token scope: manage 1. **Start** with `{ path }`. The panel answers `202 Accepted` with a `FILE_DOWNLOAD` job that carries `downloadId`. 2. **Poll** `GET …/downloads/:downloadId` until `ready` is `true`. It answers `{ id, path, ready, size, sha256 }`. 3. **Fetch** `GET …/downloads/:downloadId/file`. The file is sent as `application/octet-stream` with `Content-Disposition: attachment` (add `?inline=1` to leave that header out). Only the person who asked can fetch it, for an hour. ```bash curl -L -o error.log \ "https://panel.example.com/api/v1/websites/$SITE/files/downloads/$DOWNLOAD/file" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | The download expired, failed, or is not yours. | | 409 | `DOWNLOAD_NOT_READY` | The file is still on its way from the server. | ## Set up Git deploy `PUT /api/v1/websites/:id/git` — Permission: websites.manage — Token scope: manage Turns Git deploy on for a static or PHP website, or changes its settings. Each deploy clones the repository and runs its install and build commands in a new release folder on the server, and the site serves that release's output folder. The newest releases stay for instant rollbacks. Turning it on (or moving to a repository on another host) sets up the release folder and a deploy key with a `SITE_GIT_SETUP` job; add the returned `git.deployKey` to the repository as a read-only deploy key. Needs agent 0.22.0 (0.32.0 for PHP sites) and Git on the server. See [Git deploy](https://docs.vaultpanel.net/guides/websites/git-deploy). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `repositoryUrl` | string | Yes | An `https://` or SSH Git URL, without a password in it. Up to 500 characters. | | `branch` | string | No | Default `main`. | | `installCommand` | string or null | No | Up to 10 lines of up to 500 characters, such as `npm ci`. | | `buildCommand` | string or null | No | Same limits, such as `npm run build`. | | `outputDir` | string | No | The folder to serve, inside the repository, such as `dist`. Empty serves the repository as it is. | | `keepReleases` | integer | No | Releases to keep, 1 to 20. Default 5. | | `deployNow` | boolean | No | Queue the first deployment after setup. Default `false`. | **Example request** ```bash curl -X PUT https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/git \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"repositoryUrl":"git@github.com:example/site.git","buildCommand":"npm ci\nnpm run build","outputDir":"dist","deployNow":true}' ``` **Response** `202 Accepted` with `{ website, job, deployment }` when a job is queued, or `200 OK` when only settings were saved. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `WEBSITE_NOT_STATIC` | The site is a reverse proxy; its app deploys from Git itself. | | 409 | `WEBSITE_OWNED_BY_APP` | The site serves an app. | | 409 | `AGENT_OUTDATED` | The agent is too old for Git deploy. | | 409 | `SOFTWARE_MISSING` | Git is not installed on the server. | | 409 | `SERVER_NOT_READY`, `WEBSITE_BUSY` | See above. | | 422 | `VALIDATION_ERROR` | An invalid URL, branch, command or folder. | ## Turn Git deploy off `DELETE /api/v1/websites/:id/git` — Permission: websites.manage — Token scope: manage Turns Git deploy off. When a release is live, the site serves its previous folder again (a job does that), and you manage it with the file manager. **Response** `202 Accepted` with `{ website, job }`, or `200 OK` with `{ website, job: null }`. ## Deploy a website from Git `POST /api/v1/websites/:id/deploy` — Permission: websites.manage — Token scope: manage Deploys the newest commit of the branch (`DEPLOY_SITE_GIT`). **Example request** ```bash curl -X POST https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/deploy \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `202 Accepted` with `{ website, deployment, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `GIT_DEPLOY_OFF` | Git deploy is not on for this website. | | 409 | `WEBSITE_BUSY` | Another change is running. | ## Roll back a website `POST /api/v1/websites/:id/rollback` — Permission: websites.manage — Token scope: manage Makes an earlier release live again (`ROLLBACK_SITE_GIT`), without building it again. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `deploymentId` | string | Yes | A successful deployment whose release is still on the server. | **Response** `202 Accepted` with `{ website, deployment, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such deployment of this website. | | 409 | `WEBSITE_NOT_DEPLOYED` | Nothing was deployed from Git yet. | | 409 | `RELEASE_ALREADY_LIVE` | That release is already live. | | 409 | `RELEASE_NOT_DEPLOYABLE` | That deployment did not succeed. | | 409 | `RELEASE_NOT_FOUND` | Its release was removed (only the newest are kept). Deploy its commit again instead. | ## List website deployments `GET /api/v1/websites/:id/deployments` — Permission: websites.read — Token scope: read The website's 20 most recent Git deployments and rollbacks, newest first. **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "7c6b5a49-…", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "jobId": "…", "kind": "deploy", "trigger": "webhook", "status": "succeeded", "releaseId": "20261110113000-a1b2c3", "sourceDeploymentId": null, "repositoryUrl": "git@github.com:example/site.git", "branch": "main", "outputDir": "dist", "commit": { "hash": "4e5f6a7b…", "message": "Update pricing page", "author": "Ada Lovelace" }, "failedStage": null, "error": null, "releaseAvailable": true, "isCurrent": true, "requestedBy": null, "stages": null, "startedAt": "2026-11-10T11:30:00.000Z", "finishedAt": "2026-11-10T11:30:42.000Z" } ] }, "message": "OK", "requestId": "…" } ``` ## Get or set build variables `GET /api/v1/websites/:id/environment` — Permission: websites.manage — Token scope: manage `PUT /api/v1/websites/:id/environment` — Permission: websites.manage — Token scope: manage Environment variables available to a Git-deployed website's install and build commands. `PUT` replaces the whole list. Both answer `{ variables: [{ key, value }] }`. **Request body** (`PUT`) | Field | Type | Required | Description | | --- | --- | --- | --- | | `variables` | object[] | Yes | Up to 100 `{ key, value }`. Keys are letters, digits and underscores, not starting with a digit; values up to 8192 characters. | ## Turn push to deploy on or off `POST /api/v1/websites/:id/git/webhook` — Permission: websites.manage — Token scope: manage `DELETE /api/v1/websites/:id/git/webhook` — Permission: websites.manage — Token scope: manage `POST` creates (or replaces) the website's push webhook and returns its URL and signing secret, shown only this once. Add both to your Git host; a push to the branch then deploys the site through the [Git push hook](https://docs.vaultpanel.net/api-reference/applications#git-push-hook). `DELETE` turns it off. **Response** `200 OK` (`POST`) ```json { "success": true, "data": { "website": { "id": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "git": { "webhook": { "enabled": true, "signed": true, "createdAt": "…" } } }, "webhook": { "url": "https://panel.example.com/api/v1/hooks/deploy/…", "secret": "…" } }, "message": "Copy the webhook URL now: it is shown only once", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `GIT_DEPLOY_OFF` | Git deploy is not on for this website. | ## Empty the page cache `POST /api/v1/websites/:id/cache/purge` — Permission: websites.manage — Token scope: manage Queues a `SITE_CACHE_PURGE` job that empties the PHP site's [page cache](https://docs.vaultpanel.net/guides/websites/caching#page-cache). Turn the cache on or off with `pageCache` in [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website). Needs agent 0.43.0 or later. **Example request** ```bash curl -X POST https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/cache/purge \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `202 Accepted` with the job. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `NO_PAGE_CACHE` | The website has no page cache. | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | ## Read firewall events `POST /api/v1/websites/:id/firewall/events` — Permission: websites.logs — Token scope: logs Queues a `WAF_EVENTS` job that reads the newest requests the [web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) caught for this website, from the server's firewall log. Turn the firewall on with `waf` in [Update a website](https://docs.vaultpanel.net/api-reference/websites#update-a-website). Needs agent 0.44.0 or later. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | integer | No | How many requests, newest first: 1 to 200. Default 50. | **Example request** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/firewall/events \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"limit":50}' ``` **Response** `202 Accepted` with the job. Its `output` holds: ```json { "total": 12, "blocked": 3, "installed": true, "logMissing": false, "events": [ { "time": "Tue Nov 17 13:15:38 2026", "address": "203.0.113.9", "host": "shop.example.com", "method": "GET", "uri": "/?id=1%20union%20select", "status": 403, "blocked": true, "overLimit": true, "rules": [{ "id": "942100", "message": "SQL Injection Attack Detected via libinjection", "severity": "2" }] } ] } ``` `blocked` is true when the request was answered with 403. `overLimit` is true when the request scored enough to be blocked, so in detect-only mode it means **Would block**. Only the request line, address, status and rules are returned; the log never keeps headers or bodies. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `AGENT_OUTDATED` | The agent is older than 0.44.0. | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | ## Get website statistics `GET /api/v1/websites/:id/stats` — Permission: websites.read — Token scope: read Visitors, page views, traffic, bots and response classes per day, with the top lists, read from the website's NGINX access log once a day. Only day totals are stored: no addresses or user agents. See [Statistics](https://docs.vaultpanel.net/guides/websites/statistics). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `days` | integer | No | `7`, `30`, `90` or `365`, today included. Default `30`. | **Example request** ```bash curl "https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/stats?days=7" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `200 OK` ```json { "success": true, "data": { "stats": { "since": "2026-11-12", "until": "2026-11-18", "days": [{ "day": "2026-11-12", "requests": 5120, "pageViews": 830, "visitors": 214, "bytes": 81234567, "bots": 1302 }], "totals": { "requests": 35840, "pageViews": 5810, "visitors": 1498, "bytes": 568641969, "bots": 9114, "status": { "2xx": 31002, "3xx": 2911, "4xx": 1890, "5xx": 37 } }, "top": { "pages": [{ "name": "/", "count": 1210 }], "referrers": [{ "name": "www.google.com", "count": 402 }], "browsers": [{ "name": "Chrome", "count": 820 }], "systems": [{ "name": "Windows", "count": 610 }], "notFound": [{ "name": "/old-page", "count": 41 }] }, "firstDay": "2026-10-04", "collectedAt": "2026-11-18T03:10:00.000Z", "collecting": false, "jobId": null, "lastError": null, "supported": true } }, "message": "OK", "requestId": "…" } ``` `days` has one entry per day of the period, with zeros for days without data. `supported` is false when the server's agent is older than 0.49.0. ## Read statistics now `POST /api/v1/websites/:id/stats/refresh` — Permission: websites.read — Token scope: read Queues a `WEBSITE_STATS` job that reads the website's access logs now, instead of waiting for the daily read. **Response** `202 Accepted` with `{ job }`. When a read is already running, its job comes back with `already: true` and the message `Already reading the logs`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `AGENT_OUTDATED` | The agent is older than 0.49.0. | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | ## Get SFTP settings `GET /api/v1/websites/:id/sftp` — Permission: websites.read — Token scope: read The website's SFTP account: its own Linux user, locked into the website's folder, with SFTP only. See [SFTP](https://docs.vaultpanel.net/guides/websites/sftp). **Response** `200 OK` ```json { "success": true, "data": { "sftp": { "enabled": true, "username": "shop", "host": "203.0.113.10", "port": 22, "folder": "/shop", "hasPassword": true, "keys": [{ "type": "ssh-ed25519", "fingerprint": "SHA256:…", "comment": "ada@laptop", "line": "ssh-ed25519 AAAA… ada@laptop" }], "applying": false, "lastJobId": "…", "lastError": null, "supported": true } }, "message": "OK", "requestId": "…" } ``` The password itself is never returned: the panel keeps only its hash. `supported` is false when the server's agent is older than 0.47.0. ## Change SFTP settings `PUT /api/v1/websites/:id/sftp` — Permission: websites.manage — Token scope: manage Turns SFTP on or off, sets or removes the password, or replaces the keys, then queues an `SFTP_APPLY` job with the SFTP accounts of every website on the server. Send at least one field. Needs agent 0.47.0 or later. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | No | SFTP on or off. | | `password` | string or null | No | A new password, 12 to 128 characters, or `null` to remove it. | | `keys` | string[] | No | All the public keys, up to 20, in OpenSSH format. Replaces the current list. | With SFTP on, the account needs a password or at least one key. **Example request** ```bash curl -X PUT https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/sftp \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"enabled":true,"keys":["ssh-ed25519 AAAA… ada@laptop"]}' ``` **Response** `202 Accepted` with `{ sftp, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `AGENT_OUTDATED` | The agent is older than 0.47.0. | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | | 422 | `VALIDATION_ERROR` | A bad password or key, more than 20 keys, no field sent, or SFTP on with neither a password nor a key. | ## Get malware scan results `GET /api/v1/websites/:id/malware` — Permission: websites.read — Token scope: read The scanner on the website's server, the last scan and what it found (up to 500 files). See [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning). **Response** `200 OK` ```json { "success": true, "data": { "scanner": { "supported": true, "installed": true, "signatures": true, "signaturesUpdatedAt": "2026-11-18T02:00:00.000Z", "weekly": true }, "lastScan": { "id": "…", "trigger": "manual", "status": "succeeded", "filesScanned": 4210, "foundCount": 1, "error": null, "jobId": "…", "signaturesUpdatedAt": "2026-11-18T02:00:00.000Z", "createdAt": "2026-11-18T09:00:00.000Z", "finishedAt": "2026-11-18T09:03:12.000Z" }, "findings": [ { "id": "…", "path": "public/wp-content/uploads/2026/11/x.php", "signature": "…", "kind": "suspicious", "state": "found", "firstSeenAt": "2026-11-18T09:03:12.000Z", "lastSeenAt": "2026-11-18T09:03:12.000Z", "updatedAt": "2026-11-18T09:03:12.000Z" } ] }, "message": "OK", "requestId": "…" } ``` `kind` is `malware` (ClamAV recognised it) or `suspicious` (a PHP file in `wp-content/uploads`). `state` is `found`, `quarantined`, `ignored` or `deleted`. Turn weekly scans of every website on a server on or off with `PUT /api/v1/servers/:id/malware-schedule` and `{ "weekly": true }` (`security.manage`). ## Scan a website for malware `POST /api/v1/websites/:id/malware/scan` — Permission: websites.manage — Token scope: manage Queues a `MALWARE_SCAN` job that runs ClamAV as the website's own user. Needs agent 0.43.0 or later and ClamAV installed on the server. **Response** `202 Accepted` with `{ scanId, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `AGENT_OUTDATED` | The agent is older than 0.43.0. | | 409 | `MALWARE_SCANNER_NOT_INSTALLED` | ClamAV is not installed on the server. | | 409 | `SCAN_RUNNING` | A scan of this website is already running. | | 409 | `WEBSITE_NOT_READY` | The site does not exist on its server yet. | ## Act on malware findings `POST /api/v1/websites/:id/malware/actions` — Permission: websites.manage — Token scope: manage Quarantines, restores or deletes files a scan found (a `MALWARE_QUARANTINE` job), or ignores them in the panel. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | string | Yes | `quarantine` (found files), `restore` (quarantined files), `delete` (found, quarantined or ignored files), `ignore` (found files) or `unignore` (ignored files). | | `findingIds` | string[] | Yes | 1 to 100 finding ids of this website. | **Example request** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/malware/actions \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"action":"quarantine","findingIds":["5c1d…"]}' ``` **Response** `202 Accepted` with `{ job }` for `quarantine`, `restore` and `delete`; `200 OK` with `job: null` for `ignore` and `unignore`. Each file's result is in the job's `output.items`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | A finding id is not one of this website's. | | 409 | `WRONG_STATE` | A file's state does not allow the action. | ## List a website's copies `GET /api/v1/websites/:id/copies` — Permission: websites.read — Token scope: read The website's staging copy, the live website when it is itself a staging copy, and its 10 most recent copies. See [Staging and clones](https://docs.vaultpanel.net/guides/websites/staging-and-clones). **Response** `200 OK` ```json { "success": true, "data": { "staging": { "id": "…", "name": "staging-shop-example-com", "domain": "staging.shop.example.com", "status": "active" }, "stagingOf": null, "copies": [ { "id": "…", "kind": "staging", "status": "done", "sourceWebsiteId": "0b8e4c2a-…", "targetWebsiteId": "…", "sourceName": "shop", "targetName": "staging-shop-example-com", "targetUrl": "http://staging.shop.example.com", "lastJobId": "…", "error": null, "createdAt": "2026-11-18T09:00:00.000Z", "finishedAt": "2026-11-18T09:04:00.000Z" } ] }, "message": "OK", "requestId": "…" } ``` `kind` is `clone`, `staging` or `push`. `status` is `waiting`, `backing_up`, `copying`, `done` or `failed`. ## Clone a website `POST /api/v1/websites/:id/clone` — Permission: websites.manage — Token scope: manage Creates a new website on the same server and copies the files, the linked databases (each into a new database and user) and the settings into it with a `SITE_CLONE` job. A WordPress from the app installer is pointed at its new database and address. Static and PHP websites only, not deployed from Git. Linked databases also need `databases.manage`. Needs agent 0.43.0 or later. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | The copy's site name, as for [Create a website](https://docs.vaultpanel.net/api-reference/websites#create-a-website). | | `domains` | string[] | Yes | 1 to 20 domains for the copy; the first is primary. | **Example request** ```bash curl https://panel.example.com/api/v1/websites/0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a/clone \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"name":"shop-copy","domains":["copy.example.com"]}' ``` **Response** `202 Accepted` with `{ clone, website }`: the copy (as in [List a website's copies](https://docs.vaultpanel.net/api-reference/websites#list-a-websites-copies)) and the new website. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `CLONE_UNSUPPORTED` | Not a static or PHP website, deployed from Git, or more than 10 linked databases. | | 409 | `CLONE_RUNNING` | A copy of this website is already running. | | 409 | `WEBSITE_NOT_READY` | The website is not active, or a change is running. | | 409 | `PANEL_SITE` | The panel's own website cannot be copied. | | 409 | `AGENT_OUTDATED` | The agent is older than 0.43.0. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more websites or databases. | | 422 | `VALIDATION_ERROR` | An invalid or taken name or domain. | ## Make a staging copy `POST /api/v1/websites/:id/staging` — Permission: websites.manage — Token scope: manage Like [Clone a website](https://docs.vaultpanel.net/api-reference/websites#clone-a-website), at `staging.` unless another domain is given, and linked to the live website. The site name is chosen from the domain. A website has one staging copy at a time, and a staging copy cannot have one. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `domain` | string | No | The copy's domain. Default `staging.`. | **Response** `202 Accepted` with `{ clone, website }`. **Errors** as for [Clone a website](https://docs.vaultpanel.net/api-reference/websites#clone-a-website), plus: | Status | Code | When | | --- | --- | --- | | 409 | `STAGING_EXISTS` | The website already has a staging copy. | | 409 | `NAME_TAKEN` | No free site name was found for the domain. | ## Push staging to live `POST /api/v1/websites/:id/push` — Permission: websites.manage, backups.create — Token scope: manage Call it on the staging copy. Backs up the live website and its databases first; once the backups are done, a `SITE_CLONE` job copies the staging copy's files and databases over the live site's and puts the live address back. Data written to the live site since the copy was made is lost, except in those backups. **Response** `202 Accepted` with `{ clone }`, `kind: "push"` and `status: "backing_up"`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `NOT_STAGING` | The website is not a staging copy made by VaultPanel. | | 409 | `LIVE_GONE` | The live website was deleted. | | 409 | `DATABASE_GONE` | A database of the staging copy or the live site, or the live WordPress's database user, was deleted. | | 409 | `WEBSITE_NOT_READY` | The live website is not active, or a change is running. | ## WordPress tools The [WordPress tools](https://docs.vaultpanel.net/guides/websites/wordpress-tools) work on a WordPress from the app installer, by its install id (see [List installed apps](https://docs.vaultpanel.net/api-reference/applications#list-installed-apps)). Each runs as a job on the server, as the website's user, with WordPress's plugins left out while it loads. Both need `websites.manage` and agent 0.43.0 or later. | Method | Path | Description | | --- | --- | --- | | POST | `/api/v1/cms/installs/:id/wordpress/status` | Reads the version, updates, plugins, themes, administrators, maintenance mode, debug logging and object cache. | | POST | `/api/v1/cms/installs/:id/wordpress/actions` | Changes WordPress. | ### Read WordPress status `POST /api/v1/cms/installs/:id/wordpress/status` — Permission: websites.manage — Token scope: manage **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `refresh` | boolean | No | Ask wordpress.org for updates now. Default `false`. | **Response** `200 OK` with the `WORDPRESS_STATUS` job. The status arrives in the job's `output`. ### Change WordPress `POST /api/v1/cms/installs/:id/wordpress/actions` — Permission: websites.manage — Token scope: manage **Request body**: one action, with its fields. No other fields are accepted. | `action` | Fields | What it does | | --- | --- | --- | | `update` | `core` (boolean), `plugins` (`true` or 1 to 200 plugin files), `themes` (`true` or 1 to 200 theme names) | Installs updates. At least one of the three. `true` updates every plugin or theme with an update. | | `plugin` | `plugin`, `active` (boolean) | Activates or deactivates a plugin. | | `theme` | `theme` | Activates a theme. | | `password` | `user`, `password` (optional) | Sets an administrator's password and signs them out everywhere. Without `password`, the panel makes one and returns it once as `password`. | | `maintenance` | `on` (boolean) | Maintenance mode. | | `debug` | `on` (boolean) | Debug logging to `wp-content/debug.log`. | | `login` | `user` (optional) | A one-time sign-in link that works for two minutes. The answer holds `token`; the job's `output.url` ends in `?vaultpanel_login=`, and the token goes after it. | | `objectCache` | `on` (boolean) | The Redis object cache. Turning it on needs Redis installed on the server. | | `flushObjectCache` | none | Empties the site's object cache. | **Example request** ```bash curl https://panel.example.com/api/v1/cms/installs/2a3b4c5d-…/wordpress/actions \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"action":"update","core":true,"plugins":true}' ``` **Response** `202 Accepted` with `{ job }`, plus `password` or `token` for those actions. When the website has a page cache, `update`, `plugin`, `theme` and `maintenance` empty it once the job succeeds. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `NOT_WORDPRESS` | The install is not WordPress. | | 409 | `CMS_BUSY` | WordPress is not installed yet, or is being removed. | | 409 | `WEBSITE_NOT_PHP` | The website is no longer a PHP site. | | 409 | `REDIS_NOT_INSTALLED` | `objectCache` on a server without Redis for websites. | | 409 | `AGENT_OUTDATED` | The agent is older than 0.43.0. | ## List subdomain parents `GET /api/v1/subdomains/parents` — Permission: websites.read — Token scope: read The domains a subdomain can be created under: those of your websites (every website's, for staff), without `www.` names and the panel's own domain. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/subdomains/parents \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.subdomains.parents(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "domain": "example.com", "website": { "id": "…", "name": "main" }, "server": { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "phpVersions": ["8.3"] }, "customer": null } ] }, "message": "OK", "requestId": "…" } ``` `customer` is shown to staff only. ## Create a subdomain `POST /api/v1/subdomains` — Permission: websites.manage — Token scope: manage Creates a website of its own for `name.parentDomain`, on the parent's server and owned by the parent's account, where it counts against the plan's subdomains. The site name is chosen for you. When a panel [DNS zone](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) holds the name, an A (and AAAA) record is added once the site exists and removed when it is deleted. Subdomains are websites: list, change and delete them with the website endpoints. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `parentDomain` | string | Yes | One of the domains from [List subdomain parents](https://docs.vaultpanel.net/api-reference/websites#list-subdomain-parents). | | `name` | string | Yes | The label to add, such as `blog`. | | `type` | string | Yes | `static` or `php`. | | `documentRoot` | string | No | Default `public`. | | `phpVersion` | string | For `php` | A PHP version installed on the server. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/subdomains \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"parentDomain":"example.com","name":"blog","type":"php","phpVersion":"8.3"}' ``` **JavaScript** ```js const { website, job } = await panel.subdomains.create({ parentDomain: 'example.com', name: 'blog', type: 'php', phpVersion: '8.3' }); ``` **Response** `202 Accepted` with `{ website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `NAME_TAKEN` | No free site name for the subdomain on that server. | | 409 | `QUOTA_REACHED` | The plan allows no more subdomains. | | 422 | `VALIDATION_ERROR` | `parentDomain` is not one of yours, or `name` is invalid. | ## List domains `GET /api/v1/domains` — Permission: websites.read — Token scope: read Every domain of every website, alphabetically, with its site, server and whether HTTPS covers it. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches the domain. | | `serverId` | string | No | Domains on one server. | | `sort` | string | No | `domain` (default, ascending) or `createdAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/domains?search=example" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.domains.list({ search: 'example' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "d4c3b2a1-…", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "domain": "shop.example.com", "isPrimary": true, "dns": null, "createdAt": "2026-11-01T10:00:00.000Z", "website": { "id": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "name": "shop" }, "server": { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1" }, "https": "active" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` `https` is the covering certificate's state (`active`, `expiring` or `expired`), or `null` when no active certificate covers the domain. ## Check a domain's DNS `POST /api/v1/domains/:id/dns-check` — Permission: websites.read — Token scope: read The same check as [Check a website's DNS](https://docs.vaultpanel.net/api-reference/websites#check-a-websites-dns), for one domain. **Response** `200 OK` with `{ items: [domain] }`. `404 NOT_FOUND` when there is no such domain. ## List certificates `GET /api/v1/ssl-certificates` — Permission: websites.read — Token scope: read Certificates of every website, soonest expiry first. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `pending`, `active`, `failed`, `inactive`, or `expiring` (active, inside the warning window) or `expired`. | | `serverId` | string | No | Certificates on one server. | | `sort` | string | No | `notAfter` (default, ascending) or `createdAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/ssl-certificates?status=expiring" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.certificates.list({ status: 'expiring' }); ``` **Response** `200 OK`: `{ items, pagination }`. Each item is the website object's `ssl` with `website: { id, name, status }` and `server: { id, name }`. ## Get renewal settings `GET /api/v1/ssl-certificates/renewal` — Permission: websites.read — Token scope: read When certificates renew and when they count as expiring. The panel renews a Let's Encrypt certificate itself when it is inside its renewal window and Certbot's timer has not. **Response** `200 OK` ```json { "success": true, "data": { "renewBeforeDays": 30, "warnDays": 14, "defaults": { "renewBeforeDays": 30, "warnDays": 14 }, "limits": { "renewBeforeDays": { "min": 7, "max": 60 }, "warnDays": { "min": 1 } }, "minAgentVersion": "0.25.0", "servers": [ { "id": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "web-1", "agentVersion": "0.41.0", "certificates": 6, "appliesWindow": true } ] }, "message": "OK", "requestId": "…" } ``` `servers` lists the servers with certificates (empty for hosting customers). `appliesWindow` is `false` for agents older than 0.25.0, which keep Certbot's 30 days. ## Change renewal settings `PUT /api/v1/ssl-certificates/renewal` — Permission: settings.manage — Token scope: full Saves the renewal window and applies it on every server with certificates whose agent can (`SET_SSL_RENEWAL`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `renewBeforeDays` | integer | Yes | Renew this many days before expiry, 7 to 60. | | `warnDays` | integer | Yes | Show certificates as expiring this many days before expiry. At least 1, and less than `renewBeforeDays`. | No other fields are accepted. **Example request** ```bash curl -X PUT https://panel.example.com/api/v1/ssl-certificates/renewal \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"renewBeforeDays":30,"warnDays":10}' ``` **Response** `200 OK`: the same as [Get renewal settings](https://docs.vaultpanel.net/api-reference/websites#get-renewal-settings), plus `queued` (`[{ serverId, name, jobId }]`) and `skipped` (`[{ serverId, name, reason }]`). **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | A value out of range, `warnDays` not below `renewBeforeDays`, or an unknown field. | --- # Migrations URL: https://docs.vaultpanel.net/api-reference/migrations > API reference for moving websites, databases and email to one of your servers from a cPanel full account backup. A migration moves a cPanel account to one of your servers from its full account backup (`backup-….tar.gz` or `cpmove-user.tar.gz`). The backup is uploaded to the panel in pieces, then read on the chosen server. From what the server found, you pick what to move; the panel makes the websites, databases and email the usual way, and the server fills them with the files, data and mail. See [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel). Migrations need agent 0.48.0 or newer on the server, and 0.50.0 or newer to move email. They are for staff with `websites.manage` and `databases.manage` (and `mail.manage` to move email); hosting customers are refused with `403 FORBIDDEN`. ## How a migration works | Step | Request | Status afterwards | | --- | --- | --- | | 1 | [Start a migration](https://docs.vaultpanel.net/api-reference/migrations#start-a-migration) and [send the backup](https://docs.vaultpanel.net/api-reference/migrations#send-a-piece-of-the-backup) in pieces. | `uploading` | | 2 | [Finish the upload](https://docs.vaultpanel.net/api-reference/migrations#finish-the-upload). The server reads the backup (`MIGRATION_INSPECT`). | `inspecting`, then `ready` | | 3 | Read `inspection` with [Get a migration](https://docs.vaultpanel.net/api-reference/migrations#get-a-migration), then [move what you pick](https://docs.vaultpanel.net/api-reference/migrations#move-what-you-picked). | `creating`, then `restoring` (`MIGRATION_RESTORE`), then `done` | Any step can end in `failed`, with `lastError`. [Discard](https://docs.vaultpanel.net/api-reference/migrations#discard-a-migration) sets `discarded`. The backup is deleted from the server once the move is done or discarded. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/migrations` | [List migrations](https://docs.vaultpanel.net/api-reference/migrations#list-migrations) | | POST | `/api/v1/migrations` | [Start a migration](https://docs.vaultpanel.net/api-reference/migrations#start-a-migration) | | GET | `/api/v1/migrations/:id` | [Get a migration](https://docs.vaultpanel.net/api-reference/migrations#get-a-migration) | | PUT | `/api/v1/migrations/:id/uploads/:uploadId/chunks/:offset` | [Send a piece of the backup](https://docs.vaultpanel.net/api-reference/migrations#send-a-piece-of-the-backup) | | POST | `/api/v1/migrations/:id/uploads/:uploadId/finish` | [Finish the upload](https://docs.vaultpanel.net/api-reference/migrations#finish-the-upload) | | POST | `/api/v1/migrations/:id/start` | [Move what you picked](https://docs.vaultpanel.net/api-reference/migrations#move-what-you-picked) | | POST | `/api/v1/migrations/:id/discard` | [Discard a migration](https://docs.vaultpanel.net/api-reference/migrations#discard-a-migration) | ## The migration object ```json { "id": "5f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "fileName": "backup-11.10.2026_09-30-12_shopacct.tar.gz", "sizeBytes": 734003200, "status": "ready", "inspection": { "account": "shopacct", "mainDomain": "example.com", "totalBytes": 734003200, "sites": [ { "domain": "example.com", "aliases": ["www.example.com"], "root": "public_html", "phpVersion": "8.2", "kind": "main", "bytes": 412000000 }, { "domain": "shop.com", "aliases": ["www.shop.com"], "root": "public_html/shop", "phpVersion": null, "kind": "addon", "bytes": 98000000 } ], "databases": [{ "name": "shopacct_wp", "bytes": 52428800 }], "mail": [ { "domain": "example.com", "mailboxes": [{ "local": "info", "address": "info@example.com", "quotaMb": 1024, "bytes": 15728640, "hasMail": true, "hasPassword": true }], "forwarders": [{ "local": "sales", "address": "sales@example.com", "destinations": ["team@example.org"] }] } ] }, "plan": null, "result": null, "lastJobId": "…", "lastError": null, "createdAt": "2026-11-11T09:40:00.000Z", "updatedAt": "2026-11-11T09:42:10.000Z" } ``` | Field | Description | | --- | --- | | `status` | `uploading`, `inspecting`, `ready`, `creating`, `restoring`, `done`, `failed` or `discarded`. | | `inspection` | What the server found in the backup, once `ready`. Each site's `kind` is `main`, `addon` or `subdomain`, and its `root` is its folder in the old home. `mail` is `null` when an agent older than 0.50.0 read the backup. Password hashes are never in it. | | `plan` | What was made for the move: `sites` (`{ root, websiteId, name, domains }`), `databases` (`{ source, databaseId, userId, name, user }`) and `mail` (`{ domains, mailboxes, forwarders, skipped }`). Each mailbox has `needsPassword` when its password could not come over. | | `result` | When `done`: the moved `sites`, `databases`, the `wordpress` sites pointed at their new database, the `mail` moved per mailbox (`{ address, messages, bytes }`) and `mailErrors`. | ## List migrations `GET /api/v1/migrations` — Permission: websites.manage, databases.manage — Token scope: manage The 50 newest migrations that were not discarded, newest first. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/migrations \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/migrations'); ``` **Response** `200 OK`: `{ items: [migration] }`. ## Start a migration `POST /api/v1/migrations` — Permission: websites.manage, databases.manage — Token scope: manage Makes a migration to a server and starts the upload of its backup. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | The server to move to. | | `fileName` | string | Yes | The backup's file name, up to 255 characters. | | `size` | integer | Yes | The backup's size in bytes. At most `VAULTPANEL_FILE_UPLOAD_MAX_MB` (2048 MB by default). | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/migrations \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"serverId":"1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b","fileName":"cpmove-shopacct.tar.gz","size":734003200}' ``` **JavaScript** ```js const { migration, upload } = await panel.request('POST', '/migrations', { body: { serverId, fileName: 'cpmove-shopacct.tar.gz', size: file.length }, }); ``` **Response** `201 Created`: `{ migration, upload }`, message `Upload the backup`. `upload` is `{ uploadId, chunkBytes, size }`; `chunkBytes` is the largest piece (8 MB). **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | A hosting customer, or a missing permission. | | 409 | `AGENT_OUTDATED` | The server's agent is older than 0.48.0. | | 413 | `FILE_TOO_LARGE` | The backup is larger than `VAULTPANEL_FILE_UPLOAD_MAX_MB`. | | 422 | `VALIDATION_ERROR` | The server does not exist, or a field is invalid. | ## Get a migration `GET /api/v1/migrations/:id` — Permission: websites.manage, databases.manage — Token scope: manage **Response** `200 OK`: `{ migration }`. Poll it to follow a migration. `404 NOT_FOUND` when there is no such migration. ## Send a piece of the backup `PUT /api/v1/migrations/:id/uploads/:uploadId/chunks/:offset` — Permission: websites.manage, databases.manage — Token scope: manage Sends the backup's bytes from `offset`, as the raw request body (`Content-Type: application/octet-stream`), up to `chunkBytes` per request, in order. Only the person who started the upload can add to it. **Example request** ```bash curl -X PUT "https://panel.example.com/api/v1/migrations/$MIGRATION_ID/uploads/$UPLOAD_ID/chunks/0" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/octet-stream" \ --data-binary @part-0 ``` **Response** `200 OK`: `{ received, size }`. Send the next piece from `received`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such upload, or it is someone else's. | | 409 | `OFFSET_MISMATCH` | The piece is not for the next offset. `details.expected` is where to continue. | | 409 | `UPLOAD_FINISHED` | The upload is already finished. | | 413 | `CHUNK_TOO_LARGE` | The piece is larger than `chunkBytes`. | | 422 | `UPLOAD_TOO_LARGE` | More data than the size given at the start. | ## Finish the upload `POST /api/v1/migrations/:id/uploads/:uploadId/finish` — Permission: websites.manage, databases.manage — Token scope: manage Checks that every byte arrived, computes the backup's SHA-256 and queues `MIGRATION_INSPECT`. The server fetches the backup, checks it against the SHA-256, keeps it in a folder only root can read and lists what is in it. When the job succeeds, `status` is `ready` and `inspection` is filled in; the panel's copy is deleted. **Response** `202 Accepted`: `{ migration, job }`, message `Reading the backup`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MIGRATION_BUSY` | The backup was already uploaded. | | 409 | `UPLOAD_INCOMPLETE` | Not every byte has arrived. `details.received` says how many have. | The job fails with `MIGRATION_UNSUPPORTED` for a file that is not a cPanel full backup, a backup that keeps the home folder as `homedir.tar`, or one with more than one account; with `MIGRATION_ARCHIVE_INVALID` for a file `tar` cannot read; and with `MIGRATION_UNREADABLE` when the backup's `userdata/` does not name the account's domain or website folders. ## Move what you picked `POST /api/v1/migrations/:id/start` — Permission: websites.manage, databases.manage — Token scope: manage Moves the websites, databases and email domains you pick from `inspection`. Pick at least one. - Each website is made as a PHP website with document root `public` (`CREATE_SITE`), and the files of its folder are unpacked into it, owned by the website, without setuid bits. Folders of other moved websites inside it are left out. - Each database is made with a user of the same name (cut to 32 characters) with full access, and its dump is imported as an account that reaches only it. Databases are linked to the first moved website. - A WordPress whose `wp-config.php` uses a moved database is pointed at the new one. - Each email domain is added to the server's mail server (no DNS records are added), with its mailboxes (passwords as cPanel kept them, quotas and all their mail) and forwarders. Addresses the panel already has are left as they are and listed in `plan.mail.skipped`. Needs a mail server set up on the server, `mail.manage` and agent 0.50.0 or newer. When every website and database exists, the panel queues `MIGRATION_RESTORE`. If making them fails, what was already made is kept and the migration is `failed`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `sites` | object[] | No | Up to 100. Each `{ root, name, domains, phpVersion }`: `root` from `inspection.sites`, the website `name` (3 to 32 lowercase letters, digits and dashes), 1 to 20 `domains` (no wildcards) and an optional PHP version such as `8.3`. | | `databases` | object[] | No | Up to 200. Each `{ source, name }`: `source` from `inspection.databases` and the new database's `name`. | | `mail` | object | No | `{ domains }`: up to 200 email domains from `inspection.mail`, moved whole. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/migrations/5f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0/start \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"sites":[{"root":"public_html","name":"example","domains":["example.com","www.example.com"],"phpVersion":"8.2"}],"databases":[{"source":"shopacct_wp","name":"example_wp"}],"mail":{"domains":["example.com"]}}' ``` **JavaScript** ```js const { migration } = await panel.request('POST', `/migrations/${migrationId}/start`, { body: { sites: [{ root: 'public_html', name: 'example', domains: ['example.com', 'www.example.com'], phpVersion: '8.2' }], databases: [{ source: 'shopacct_wp', name: 'example_wp' }], mail: { domains: ['example.com'] }, }, }); ``` **Response** `202 Accepted`: `{ migration }`, message `Moving the websites`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MIGRATION_BUSY` | The backup is not read yet, is already being moved, or was moved. | | 409 | `AGENT_OUTDATED` | Email was picked and the agent is older than 0.50.0. | | 409 | `MAIL_NOT_SET_UP` | Email was picked and the server has no mail server. | | 409 | `DATABASE_SERVER_NOT_INSTALLED` and others | A website or database could not be made: the errors of [creating a website](https://docs.vaultpanel.net/api-reference/websites#create-a-website) or [a database](https://docs.vaultpanel.net/api-reference/databases#create-a-database). | | 422 | `VALIDATION_ERROR` | Nothing picked, a folder, database or email domain that is not in the backup, one listed twice, an invalid name or domain, an email domain that has email on another server, or a backup read by an agent too old to list its email. | The `MIGRATION_RESTORE` job fails with `MIGRATION_ARCHIVE_GONE` when the backup is no longer on the server, and with `IMPORT_FAILED` when a database dump cannot be imported (see [Import a dump](https://docs.vaultpanel.net/api-reference/databases#import-a-dump)). Mail that cannot be moved for one mailbox does not stop the job: it is listed in `result.mailErrors`. ## Discard a migration `POST /api/v1/migrations/:id/discard` — Permission: websites.manage, databases.manage — Token scope: manage Removes the backup from the server (`MIGRATION_DISCARD`) when it is still there, and hides the migration from the list. What was already moved stays. **Response** `200 OK`: `{ migration }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MIGRATION_BUSY` | The backup is being read or moved: wait until the current step has finished. | --- # Applications URL: https://docs.vaultpanel.net/api-reference/applications > API reference for Node.js, Python, Go and Ruby apps deployed from Git, their deployments, environment, scaling and push-to-deploy hooks, and the app installer. An application is a Git repository the agent deploys into release folders on a server and runs under PM2, as the app's own Linux user. An app gets a domain and SSL through a linked reverse-proxy [website](https://docs.vaultpanel.net/api-reference/websites). See [Applications](https://docs.vaultpanel.net/guides/applications). Hosting customers can use these endpoints for their own apps, within their plan. ## How changes work Setting up, deploying, rolling back, starting, stopping, restarting, applying settings and deleting return `202 Accepted` with `{ application, job }` (deploys and rollbacks add `deployment`). The app's `status` is `creating`, `deploying`, `updating` or `deleting` while a job runs; another change meanwhile answers `409 APPLICATION_BUSY` with `details.jobId`. Settings saved with [Update an application](https://docs.vaultpanel.net/api-reference/applications#update-an-application) are stored at once. Process settings (start command, port, health check, limits, copies, zero-downtime reloads) and environment variables go live on the next deploy or when you [apply](https://docs.vaultpanel.net/api-reference/applications#apply-settings); `configPending` says when saved settings are not live yet. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/applications` | [List applications](https://docs.vaultpanel.net/api-reference/applications#list-applications) | | GET | `/api/v1/applications/suggest-port` | [Suggest a port](https://docs.vaultpanel.net/api-reference/applications#suggest-a-port) | | POST | `/api/v1/applications` | [Create an application](https://docs.vaultpanel.net/api-reference/applications#create-an-application) | | GET | `/api/v1/applications/:id` | [Get an application](https://docs.vaultpanel.net/api-reference/applications#get-an-application) | | PATCH | `/api/v1/applications/:id` | [Update an application](https://docs.vaultpanel.net/api-reference/applications#update-an-application) | | DELETE | `/api/v1/applications/:id` | [Delete an application](https://docs.vaultpanel.net/api-reference/applications#delete-an-application) | | GET | `/api/v1/applications/:id/environment` | [Get environment variables](https://docs.vaultpanel.net/api-reference/applications#get-environment-variables) | | PUT | `/api/v1/applications/:id/environment` | [Set environment variables](https://docs.vaultpanel.net/api-reference/applications#set-environment-variables) | | POST | `/api/v1/applications/:id/deploy` | [Deploy](https://docs.vaultpanel.net/api-reference/applications#deploy) | | POST | `/api/v1/applications/:id/rollback` | [Roll back](https://docs.vaultpanel.net/api-reference/applications#roll-back) | | POST | `/api/v1/applications/:id/start` | [Start, stop or restart](https://docs.vaultpanel.net/api-reference/applications#start-stop-or-restart) | | POST | `/api/v1/applications/:id/stop` | [Start, stop or restart](https://docs.vaultpanel.net/api-reference/applications#start-stop-or-restart) | | POST | `/api/v1/applications/:id/restart` | [Start, stop or restart](https://docs.vaultpanel.net/api-reference/applications#start-stop-or-restart) | | POST | `/api/v1/applications/:id/apply` | [Apply settings](https://docs.vaultpanel.net/api-reference/applications#apply-settings) | | POST | `/api/v1/applications/:id/scale` | [Scale](https://docs.vaultpanel.net/api-reference/applications#scale) | | POST | `/api/v1/applications/:id/status` | [Refresh process state](https://docs.vaultpanel.net/api-reference/applications#refresh-process-state) | | POST | `/api/v1/applications/:id/logs` | [Read application logs](https://docs.vaultpanel.net/api-reference/applications#read-application-logs) | | POST | `/api/v1/applications/:id/website` | [Add a website](https://docs.vaultpanel.net/api-reference/applications#add-a-website) | | POST | `/api/v1/applications/:id/webhook` | [Turn push to deploy on](https://docs.vaultpanel.net/api-reference/applications#turn-push-to-deploy-on) | | DELETE | `/api/v1/applications/:id/webhook` | [Turn push to deploy off](https://docs.vaultpanel.net/api-reference/applications#turn-push-to-deploy-off) | | GET | `/api/v1/deployments` | [List deployments](https://docs.vaultpanel.net/api-reference/applications#list-deployments) | | GET | `/api/v1/deployments/:id` | [Get a deployment](https://docs.vaultpanel.net/api-reference/applications#get-a-deployment) | | POST | `/api/v1/hooks/deploy/:token` | [Git push hook](https://docs.vaultpanel.net/api-reference/applications#git-push-hook) | | GET | `/api/v1/cms/apps` | [List installable apps](https://docs.vaultpanel.net/api-reference/applications#list-installable-apps) | | GET | `/api/v1/cms/installs` | [List installed apps](https://docs.vaultpanel.net/api-reference/applications#list-installed-apps) | | POST | `/api/v1/cms/installs` | [Install an app](https://docs.vaultpanel.net/api-reference/applications#install-an-app) | | GET | `/api/v1/cms/installs/:id` | [Get an installed app](https://docs.vaultpanel.net/api-reference/applications#get-an-installed-app) | | DELETE | `/api/v1/cms/installs/:id` | [Remove an installed app](https://docs.vaultpanel.net/api-reference/applications#remove-an-installed-app) | ## Runtimes | `runtime` | Default start command | Notes | | --- | --- | --- | | `node` | `npm start` | Runs with the server's system-wide Node.js; dependencies installed with npm. Can run several copies and reload without downtime. | | `python` | `gunicorn app:app` | Runs in its own virtual environment; dependencies from `requirements.txt`. | | `go` | `./app` | Built with the server's Go (default build command `go build -o app .`). One process. Agent 0.32.0. | | `ruby` | `bundle exec puma -b tcp://127.0.0.1:$PORT` | Gems from the Gemfile installed with Bundler into the release. One process. Agent 0.32.0. | Deploying needs Git and PM2 on the server, plus the runtime itself for Python, Go and Ruby apps. The app's port reaches it as the `PORT` environment variable. ## The application object ```json { "id": "5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "serverStatus": "online", "customerId": null, "name": "api", "runtime": "node", "repositoryUrl": "git@github.com:example/api.git", "branch": "main", "installCommand": "npm ci", "buildCommand": "npm run build", "startCommand": "node dist/server.js", "port": 3000, "keepReleases": 5, "healthCheckSeconds": 30, "cpuLimitPercent": null, "memoryLimitMb": 512, "instances": 2, "zeroDowntime": true, "status": "ready", "pendingAction": null, "provisioned": true, "current": { "deploymentId": "9e8d7c6b-…", "releaseId": "20261110113000-a1b2c3", "commit": "4e5f6a7b…", "deployedAt": "2026-11-10T11:30:42.000Z" }, "configPending": false, "process": { "state": "running", "checkedAt": "2026-11-10T11:31:00.000Z" }, "deployKey": "ssh-ed25519 AAAA… vaultpanel-api", "webhook": { "enabled": true, "signed": true, "createdAt": "2026-11-02T09:00:00.000Z" }, "websiteId": "0b8e4c2a-…", "primaryDomain": "api.example.com", "website": null, "envKeys": null, "lastJobId": "…", "lastError": null, "createdAt": "2026-11-02T08:55:00.000Z", "updatedAt": "2026-11-10T11:30:42.000Z" } ``` | Field | Description | | --- | --- | | `status` | `creating`, `ready`, `deploying`, `updating`, `deleting` or `failed`. | | `current` | The live release, or `null` before the first deploy. | | `process` | The last process state the agent reported (PM2), or `null`. | | `deployKey` | The public key to add to the repository as a read-only deploy key, for private repositories over SSH. | | `cpuLimitPercent`, `memoryLimitMb` | Resource caps, or `null` for none. CPU is a percentage of one core (10 to 6400); memory is in MiB (64 to 262144). | | `instances` | Copies of the app that run, 1 to 16. | | `website`, `envKeys` | Filled by [Get an application](https://docs.vaultpanel.net/api-reference/applications#get-an-application): the linked website and the names (not values) of the environment variables. | ## List applications `GET /api/v1/applications` — Permission: applications.read — Token scope: read Apps, newest first. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches name, repository URL or domain. | | `serverId` | string | No | Apps on one server. | | `status` | string | No | One of the statuses above. | | `runtime` | string | No | `node`, `python`, `go` or `ruby`. | | `sort` | string | No | `createdAt` (default), `name` or `lastDeployedAt`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/applications?runtime=node" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.applications.list({ runtime: 'node' }); ``` **Response** `200 OK`: `{ items: [application], pagination }`. ## Suggest a port `GET /api/v1/applications/suggest-port` — Permission: applications.read — Token scope: read A free port for a new app on a server. For staff, the first port from 3000 up that no app, website or customer holds, with `pool: null`. For a hosting customer, the first free port of their own, with their whole pool. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | Yes | The server the app will run on. | **Example request** ```bash curl "https://panel.example.com/api/v1/applications/suggest-port?serverId=1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `200 OK` ```json { "success": true, "data": { "port": 3001, "pool": null }, "message": "OK", "requestId": "…" } ``` ## Create an application `POST /api/v1/applications` — Permission: applications.manage — Token scope: manage Saves the app and queues `CREATE_APPLICATION`, which sets up its Linux user, folders and deploy key. With `domains`, it also creates the linked reverse-proxy website (needs `websites.manage`). With `deployNow` (the default), the first deployment is queued right after setup. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | Yes | The server to run it on. | | `name` | string | Yes | 3 to 32 lowercase letters, digits and dashes, starting with a letter. The Linux user and folder; unique per server among apps and websites. | | `runtime` | string | Yes | `node`, `python`, `go` or `ruby`. | | `repositoryUrl` | string | Yes | An `https://` or SSH Git URL, without a password in it. | | `branch` | string | No | Default `main`. | | `installCommand` | string | No | Up to 10 lines of up to 500 characters. | | `buildCommand` | string | No | Same limits. | | `startCommand` | string | No | One line. Defaults to the runtime's start command. | | `port` | integer or null | With `domains` | 1024 to 65535; not 3306, 5432, 6379, 11211 or 27017. A hosting customer must use one of their own ports. | | `keepReleases` | integer | No | Releases kept for rollbacks, 1 to 20. Default 5. | | `healthCheckSeconds` | integer | No | How long a new release must stay up, 5 to 300. Default 30. | | `domains` | string[] | No | Up to 20 domains for the linked website. | | `env` | object[] | No | Up to 100 `{ key, value }`. `PORT`, `PATH`, `HOME`, `USER` and `PM2_HOME` are set by VaultPanel. | | `deployNow` | boolean | No | Deploy once set up. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{ "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "name": "api", "runtime": "node", "repositoryUrl": "https://github.com/example/api.git", "installCommand": "npm ci", "buildCommand": "npm run build", "startCommand": "node dist/server.js", "port": 3000, "domains": ["api.example.com"], "env": [{ "key": "NODE_ENV", "value": "production" }] }' ``` **JavaScript** ```js const { application, job, deployment } = await panel.applications.create({ serverId, name: 'api', runtime: 'node', repositoryUrl: 'https://github.com/example/api.git', installCommand: 'npm ci', buildCommand: 'npm run build', startCommand: 'node dist/server.js', port: 3000, domains: ['api.example.com'], env: [{ key: 'NODE_ENV', value: 'production' }], }); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "application": { "id": "5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c", "name": "api", "status": "creating", "pendingAction": "create", "provisioned": false }, "job": { "id": "…", "type": "CREATE_APPLICATION", "status": "queued" }, "deployment": { "id": "9e8d7c6b-…", "kind": "deploy", "trigger": "manual", "status": "queued" } }, "message": "App saved. The agent is setting it up on the server.", "requestId": "…" } ``` `deployment` is `null` when `deployNow` is `false`. When the app is saved but its website could not be created, the app's `lastError` has code `WEBSITE_FAILED`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | `domains` without `websites.manage`. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `SOFTWARE_MISSING` | Git, PM2 or the runtime is not installed (`details.missing`). | | 409 | `NODE_IN_HOME_FOLDER` | Node.js is installed in a home folder (for example by nvm). Install it system-wide. | | 409 | `AGENT_OUTDATED` | The agent is too old to run apps, or to run Go or Ruby apps. | | 409 | `NGINX_NOT_INSTALLED` | `domains` given and NGINX is not installed. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more apps. | | 422 | `VALIDATION_ERROR` | A field is invalid, the name or port is taken, or `domains` without `port`. | ## Get an application `GET /api/v1/applications/:id` — Permission: applications.read — Token scope: read The app with its linked website, its environment variable names, its 10 most recent deployments (`deployments`) and change jobs (`recentJobs`). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const app = await panel.applications.get(appId); ``` **Response** `200 OK`: [the application object](https://docs.vaultpanel.net/api-reference/applications#the-application-object) with `deployments` and `recentJobs`. ## Update an application `PATCH /api/v1/applications/:id` — Permission: applications.manage — Token scope: manage Saves new settings at once. Repository and build settings apply on the next deploy; process settings apply on the next deploy or when you [apply](https://docs.vaultpanel.net/api-reference/applications#apply-settings). Send at least one field. A hosting customer's CPU and memory limits are capped by their plan. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `repositoryUrl`, `branch` | string | No | As for create. | | `installCommand`, `buildCommand` | string or null | No | As for create; `null` removes it. | | `startCommand` | string | No | One line. Cannot be empty. | | `port` | integer or null | No | `null` runs the app without a port, unless it has a website. | | `keepReleases`, `healthCheckSeconds` | integer | No | As for create. | | `cpuLimitPercent` | integer or null | No | 10 to 6400 (percent of one core), or `null` for none. | | `memoryLimitMb` | integer or null | No | 64 to 262144, or `null` for none. | | `instances` | integer | No | 1 to 16 copies. More than one needs agent 0.14.0 and a Node.js or Python app. | | `zeroDowntime` | boolean | No | Node.js apps: reload without downtime on deploys. Needs agent 0.32.0. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"memoryLimitMb":512,"zeroDowntime":true}' ``` **JavaScript** ```js const { application, changed } = await panel.applications.update(appId, { memoryLimitMb: 512, zeroDowntime: true }); ``` **Response** `200 OK` ```json { "success": true, "data": { "application": { "id": "5c4b3a29-…", "configPending": true }, "changed": ["memoryLimitMb", "zeroDowntime"] }, "message": "Settings saved", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_BUSY` | Another change is running. | | 409 | `AGENT_OUTDATED` | Several copies or zero-downtime reloads need a newer agent. | | 422 | `VALIDATION_ERROR` | An invalid value, a port in use, several copies of a Go or Ruby app, zero-downtime on another runtime, or nothing to update. | ## Delete an application `DELETE /api/v1/applications/:id` — Permission: applications.manage — Token scope: manage Stops the app and removes it from PM2 (`DELETE_APPLICATION`), and deletes its linked website too (needs `websites.manage`). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `removeFiles` | boolean | No | Also delete its releases, folder and Linux user. Default `false`. | **Example request** **cURL** ```bash curl -X DELETE "https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c?removeFiles=true" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.applications.remove(appId, { removeFiles: true }); ``` **Response** `202 Accepted` with `{ application, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | The app has a website and you lack `websites.manage`. | | 409 | `APPLICATION_BUSY` | Another change is running. | ## Get environment variables `GET /api/v1/applications/:id/environment` — Permission: applications.manage — Token scope: manage The app's environment variables, with their values. Every read is recorded in the audit log. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/environment \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { variables } = await panel.applications.environment(appId); ``` **Response** `200 OK` ```json { "success": true, "data": { "variables": [{ "key": "NODE_ENV", "value": "production" }] }, "message": "OK", "requestId": "…" } ``` ## Set environment variables `PUT /api/v1/applications/:id/environment` — Permission: applications.manage — Token scope: manage Replaces the whole list. The new values go live on the next deploy or when you [apply](https://docs.vaultpanel.net/api-reference/applications#apply-settings). The audit log records which names were added, changed and removed, never the values. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `variables` | object[] | Yes | Up to 100 `{ key, value }`. Keys are letters, digits and underscores, not starting with a digit, each once; values up to 8192 characters. `PORT`, `PATH`, `HOME`, `USER` and `PM2_HOME` are reserved. | **Example request** **cURL** ```bash curl -X PUT https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/environment \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"variables":[{"key":"NODE_ENV","value":"production"},{"key":"LOG_LEVEL","value":"info"}]}' ``` **JavaScript** ```js await panel.applications.setEnvironment(appId, { variables: [ { key: 'NODE_ENV', value: 'production' }, { key: 'LOG_LEVEL', value: 'info' }, ], }); await panel.applications.apply(appId); ``` **Response** `200 OK` with `{ application }`, message `Environment saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_BUSY` | Another change is running. | | 422 | `VALIDATION_ERROR` | An invalid, reserved or repeated key, or a value too long (`details` names `variables.N.key`…). | ## Deploy `POST /api/v1/applications/:id/deploy` — Permission: applications.deploy — Token scope: deploy Deploys the newest commit of the branch (`DEPLOY_GIT`): clone it into a new release folder, run the install and build commands, point `current` at the release, restart and wait for the port to answer (the health check). A deployment that fails before the switch leaves the running release untouched; one that fails its health check is switched back to the previous release. Also sets up an app whose setup failed. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/deploy \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job, deployment } = await panel.applications.deploy(appId); const { job: done } = await panel.jobs.wait(job.id); if (done.status !== 'succeeded') throw new Error(done.error?.message); ``` **Response** `202 Accepted` with `{ application, deployment, job }`, message `Deploying the app`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_BUSY` | Another change is running. | | 409 | `APPLICATION_NOT_READY` | The app is still being set up. | | 409 | `SERVER_NOT_READY`, `SOFTWARE_MISSING`, `AGENT_OUTDATED`, `NODE_IN_HOME_FOLDER` | As for create. | ## Roll back `POST /api/v1/applications/:id/rollback` — Permission: applications.deploy — Token scope: deploy Makes an earlier release live again (`ROLLBACK_APPLICATION`) without building it again. Only the newest `keepReleases` releases are kept on the server. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `deploymentId` | string | Yes | A successful deployment of this app whose release is still on the server. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/rollback \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"deploymentId":"9e8d7c6b-5a49-4382-9170-8f7e6d5c4b3a"}' ``` **JavaScript** ```js const { job } = await panel.applications.rollback(appId, { deploymentId }); ``` **Response** `202 Accepted` with `{ application, deployment, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such deployment of this app. | | 409 | `APPLICATION_NOT_DEPLOYED` | The app has never been deployed. | | 409 | `RELEASE_ALREADY_LIVE` | That release is already live. | | 409 | `RELEASE_NOT_DEPLOYABLE` | That deployment did not succeed. | | 409 | `RELEASE_NOT_FOUND` | Its release was removed from the server. Deploy its commit again instead. | ## Start, stop or restart `POST /api/v1/applications/:id/:action` — Permission: applications.deploy — Token scope: deploy `action` is `start`, `stop` or `restart`. Works on a deployed app. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/restart \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.applications.restart(appId); ``` **Response** `202 Accepted` with `{ application, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_NOT_DEPLOYED` | Deploy the app first. | | 409 | `APPLICATION_BUSY`, `APPLICATION_NOT_READY` | See above. | ## Apply settings `POST /api/v1/applications/:id/apply` — Permission: applications.manage — Token scope: manage Writes the saved process settings and environment to the server and restarts the app with them (`CONFIGURE_APPLICATION`), without deploying. **Response** `202 Accepted` with `{ application, job }`. Errors as for [Start, stop or restart](https://docs.vaultpanel.net/api-reference/applications#start-stop-or-restart). ## Scale `POST /api/v1/applications/:id/scale` — Permission: applications.manage — Token scope: manage Sets how many copies of the app run and puts it into effect: a running app changes now, in place, while the other copies keep serving. A stopped or undeployed app uses the new count the next time it starts. See [Scaling](https://docs.vaultpanel.net/guides/applications/scaling). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `instances` | integer | Yes | 1 to 16. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/scale \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"instances":4}' ``` **JavaScript** ```js await panel.applications.scale(appId, 4); ``` **Response** `202 Accepted` with `{ application, job }` when a running app changes, or `200 OK` with `job: null` when the count is saved for later. **Errors** as for [Update an application](https://docs.vaultpanel.net/api-reference/applications#update-an-application). ## Refresh process state `POST /api/v1/applications/:id/status` — Permission: applications.read — Token scope: read Queues a routine `APP_STATUS` job that reads the app's process state from PM2. The app's `process` is updated when it finishes. **Response** `202 Accepted` with the job. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_NOT_READY` | The app is not set up on its server yet. | ## Read application logs `POST /api/v1/applications/:id/logs` — Permission: applications.logs — Token scope: logs Queues a routine `APP_LOGS` job that reads the last lines of the app's output or error log. The lines arrive in the job's `output`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `log` | string | Yes | `output` or `error`. | | `lines` | integer | No | 10 to 2000. Default 200. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/logs \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"log":"error","lines":200}' ``` **JavaScript** ```js const job = await panel.applications.logs(appId, { log: 'error', lines: 200 }); const { job: done } = await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` with the job. ## Add a website `POST /api/v1/applications/:id/website` — Permission: applications.manage, websites.manage — Token scope: manage Gives an app without a website one: a reverse proxy from the domains to the app's port. Then [issue a certificate](https://docs.vaultpanel.net/api-reference/websites#issue-a-lets-encrypt-certificate) on the new website. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `domains` | string[] | Yes | 1 to 20 domains. | **Response** `202 Accepted` with `{ application, website, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `APPLICATION_HAS_WEBSITE` | The app already has a website. Add domains to that website instead. | | 422 | `VALIDATION_ERROR` | The app has no port, or a domain is invalid or taken. | ## Turn push to deploy on `POST /api/v1/applications/:id/webhook` — Permission: applications.manage — Token scope: manage Creates (or replaces) the app's push webhook and returns its URL and signing secret, shown only this once. Add both to your Git host as a push webhook with content type `application/json`; pushes to the app's branch then deploy it through the [Git push hook](https://docs.vaultpanel.net/api-reference/applications#git-push-hook). **Example request** ```bash curl -X POST https://panel.example.com/api/v1/applications/5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c/webhook \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **Response** `200 OK` ```json { "success": true, "data": { "application": { "id": "5c4b3a29-…", "webhook": { "enabled": true, "signed": true, "createdAt": "2026-11-10T11:40:00.000Z" } }, "webhook": { "url": "https://panel.example.com/api/v1/hooks/deploy/…", "secret": "…" } }, "message": "Copy the webhook URL now: it is shown only once", "requestId": "…" } ``` ## Turn push to deploy off `DELETE /api/v1/applications/:id/webhook` — Permission: applications.manage — Token scope: manage **Response** `200 OK` with `{ application }`, message `Push to deploy turned off`. ## List deployments `GET /api/v1/deployments` — Permission: applications.read — Token scope: read App deployments and rollbacks across all apps, newest first. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `applicationId` | string | No | Deployments of one app. | | `serverId` | string | No | Deployments on one server. | | `status` | string | No | `running`, `succeeded`, `failed` or `cancelled`. `running` also matches deployments still queued. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/deployments?applicationId=5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.deployments.list({ applicationId: appId }); ``` **Response** `200 OK`: `{ items: [deployment], pagination }`. ## Get a deployment `GET /api/v1/deployments/:id` — Permission: applications.read — Token scope: read **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/deployments/9e8d7c6b-5a49-4382-9170-8f7e6d5c4b3a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const deployment = await panel.deployments.get(deploymentId); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "9e8d7c6b-5a49-4382-9170-8f7e6d5c4b3a", "applicationId": "5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c", "applicationName": "api", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "jobId": "…", "kind": "deploy", "trigger": "webhook", "status": "succeeded", "releaseId": "20261110113000-a1b2c3", "sourceDeploymentId": null, "repositoryUrl": "git@github.com:example/api.git", "branch": "main", "commit": { "hash": "4e5f6a7b…", "message": "Add rate limiting", "author": "Ada Lovelace" }, "failedStage": null, "error": null, "releaseAvailable": true, "isCurrent": true, "stages": null, "requestedBy": null, "startedAt": "2026-11-10T11:30:00.000Z", "finishedAt": "2026-11-10T11:30:42.000Z", "durationMs": 42000, "createdAt": "2026-11-10T11:30:00.000Z" }, "message": "OK", "requestId": "…" } ``` `kind` is `deploy` or `rollback`; `trigger` says what started it, such as `manual` or `webhook`. `stages` comes from the job's output, and the deployment's log is its job's log: read it with [`GET /jobs/:id`](https://docs.vaultpanel.net/api-reference/jobs#get-a-job-and-its-logs). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such deployment. | ## Git push hook `POST /api/v1/hooks/deploy/:token` — Auth: hook The URL Git hosts call on a push, for both apps and [Git-deployed websites](https://docs.vaultpanel.net/api-reference/websites#turn-push-to-deploy-on-or-off). No session or API token: the secret token in the URL finds the app or website, and the request must be signed with the webhook's secret. | Git host | Signature | | --- | --- | | GitHub, Gitea, Forgejo, Bitbucket | HMAC-SHA256 of the raw body with the secret, in `X-Hub-Signature-256` (`sha256=`), `X-Gitea-Signature` or `X-Forgejo-Signature` (``), or `X-Hub-Signature` (`sha256=`). | | GitLab | The secret itself, in `X-Gitlab-Token`. | Only pushes to the configured branch deploy. Other events (named in `X-GitHub-Event`, `X-Gitlab-Event`, `X-Gitea-Event` or `X-Event-Key`), pings and pushes to other branches answer `200` with `ignored: true` and a reason. Limited to 30 requests a minute per address. Webhooks made before signing existed have no secret and work on the URL alone. **Example request** ```bash BODY='{"ref":"refs/heads/main"}' SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" -hex | sed 's/^.* //') curl https://panel.example.com/api/v1/hooks/deploy/$WEBHOOK_TOKEN \ -H "Content-Type: application/json" -H "X-GitHub-Event: push" \ -H "X-Hub-Signature-256: sha256=$SIG" -d "$BODY" ``` **Response** `202 Accepted` ```json { "success": true, "data": { "ignored": false, "deploymentId": "9e8d7c6b-…", "releaseId": "20261110113000-a1b2c3" }, "message": "Deploying", "requestId": "…" } ``` **Response** `200 OK`, ignored ```json { "success": true, "data": { "ignored": true, "reason": "Push to refs/heads/dev; this app deploys main" }, "message": "Push to refs/heads/dev; this app deploys main", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `WEBHOOK_SIGNATURE_INVALID` | The signature is missing or does not match. The rejection is audited. | | 404 | `NOT_FOUND` | Unknown webhook token. | | 409 | `APPLICATION_BUSY`, `WEBSITE_BUSY` | A change is already running. | | 429 | `RATE_LIMITED` | More than 30 calls a minute from this address. | ## The app installer The app installer puts WordPress, Joomla, Drupal or Laravel into a PHP website in one step, with its own database and user. See [App installer](https://docs.vaultpanel.net/guides/websites/cms-installer). | `app` | Installs into | Minimum PHP | Admin page | | --- | --- | --- | --- | | `wordpress` | A folder of the document root, or the root | 7.4 | `wp-admin/` | | `joomla` | A folder of the document root, or the root | 8.1 | `administrator/` | | `drupal` | A project folder (default `drupal`); the site serves its `web` folder | 8.1 | `user/login` | | `laravel` | A project folder (default `laravel`); the site serves its `public` folder | 8.2 | None | Drupal and Laravel take over the website's document root: they need a website with no other installed app, and a website with one of them takes no other. Needs agent 0.20.0. ## List installable apps `GET /api/v1/cms/apps` The catalog above, with each app's description and where it is downloaded from. Any signed-in caller may read it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cms/apps \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { apps } = await panel.cms.catalog(); ``` **Response** `200 OK` ```json { "success": true, "data": { "apps": [ { "key": "wordpress", "label": "WordPress", "description": "Blogs and websites. The most used CMS.", "kind": "docroot", "minPhp": "7.4", "admin": true, "adminPath": "wp-admin/", "source": "wordpress.org, checked against its published SHA-1" } ] }, "message": "OK", "requestId": "…" } ``` ## List installed apps `GET /api/v1/cms/installs` — Permission: websites.read — Token scope: read **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `websiteId` | string | No | Apps in one website. | | `serverId` | string | No | Apps on one server. | | `page`, `pageSize` | integer | No | Paging. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/cms/installs?websiteId=0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.cms.installs({ websiteId }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "2a3b4c5d-…", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "websiteId": "0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a", "websiteName": "shop", "websiteDomain": "shop.example.com", "customerId": null, "app": "wordpress", "appLabel": "WordPress", "kind": "docroot", "version": "6.8.3", "directory": "public/blog", "path": "blog", "url": "https://shop.example.com/blog", "adminUrl": "https://shop.example.com/blog/wp-admin/", "title": "Shop blog", "adminUser": "admin", "adminEmail": "ada@example.com", "database": { "id": "…", "name": "shop_wp" }, "databaseUser": { "id": "…", "username": "shop_wp" }, "status": "installed", "lastJobId": "…", "lastError": null, "installedAt": "2026-11-05T15:02:00.000Z", "createdAt": "2026-11-05T15:00:00.000Z", "updatedAt": "2026-11-05T15:02:00.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` `status` is `waiting`, `installing`, `installed`, `removing` or `failed`. ## Install an app `POST /api/v1/cms/installs` — Permission: websites.manage, databases.manage — Token scope: manage Installs an app into an existing PHP website, or into a new one created with it. A database and a database user are created for it. The admin password is generated when you leave it out, and returned only in this response: the panel does not keep it. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `app` | string | Yes | `wordpress`, `joomla`, `drupal` or `laravel`. | | `websiteId` | string | One of the two | An existing PHP website. | | `newWebsite` | object | One of the two | `{ serverId, name, domains, phpVersion }` for a new PHP website. | | `path` | string | No | A folder of the document root (WordPress, Joomla) or the project folder (Drupal, Laravel). Lowercase letters, digits, dots, dashes and underscores, up to three folders deep. Empty installs at the site's root. | | `title` | string | No | The site title, up to 100 characters. | | `adminUser` | string | No | 3 to 60 letters, digits, dots, dashes and underscores. | | `adminEmail` | string | No | The admin's email address. | | `adminPassword` | string | No | 12 to 128 characters without spaces. Generated when left out. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cms/installs \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"app":"wordpress","websiteId":"0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a","path":"blog","title":"Shop blog","adminEmail":"ada@example.com"}' ``` **JavaScript** ```js const { install, admin } = await panel.cms.install({ app: 'wordpress', websiteId, path: 'blog', title: 'Shop blog', adminEmail: 'ada@example.com', }); console.log(admin.url, admin.username, admin.password); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "install": { "id": "2a3b4c5d-…", "app": "wordpress", "status": "waiting", "url": "https://shop.example.com/blog" }, "admin": { "url": "https://shop.example.com/blog/wp-admin/", "username": "admin", "password": "…", "email": "ada@example.com" }, "database": { "name": "shop_wp", "username": "shop_wp" }, "jobs": { "website": null, "database": { "id": "…", "type": "CREATE_DATABASE", "status": "queued" } } }, "message": "Installing the app", "requestId": "…" } ``` `admin` is `null` for Laravel, which has no admin page. `jobs.website` is the new website's job when `newWebsite` was given. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | You lack `websites.manage` or `databases.manage`. | | 409 | `WEBSITE_NOT_READY` | The website is not ready yet. | | 409 | `PANEL_WEBSITE` | The website serves VaultPanel itself. | | 409 | `WEBSITE_OWNED_BY_APP` | The website serves an app. | | 409 | `CMS_PHP_TOO_OLD` | The website's PHP version is older than the app needs. | | 409 | `CMS_SITE_TAKEN` | A Drupal or Laravel app already uses the document root, or Drupal or Laravel would take over a website that already has an app. | | 409 | `AGENT_OUTDATED` | The agent is older than 0.20.0. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more websites, databases or database users. | | 422 | `VALIDATION_ERROR` | Not exactly one of `websiteId` and `newWebsite`, or an invalid field. | ## Get an installed app `GET /api/v1/cms/installs/:id` — Permission: websites.read — Token scope: read **Response** `200 OK` with the installed app, as in [List installed apps](https://docs.vaultpanel.net/api-reference/applications#list-installed-apps). `404 NOT_FOUND` when there is no such install. ## Remove an installed app `DELETE /api/v1/cms/installs/:id` — Permission: websites.manage — Token scope: manage Removes the app's files from the website (`CMS_REMOVE`). The website stays. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `removeDatabase` | boolean | No | Also delete its database and database user (needs `databases.manage`). Default `false`. | **Example request** **cURL** ```bash curl -X DELETE "https://panel.example.com/api/v1/cms/installs/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d?removeDatabase=true" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { warnings } = await panel.cms.remove(installId, { removeDatabase: true }); ``` **Response** `202 Accepted` with `{ install, job, warnings }`. `warnings` lists anything that could not be removed, such as the database. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `CMS_BUSY` | The app is still being installed, or already being removed. | --- # Databases URL: https://docs.vaultpanel.net/api-reference/databases > API reference for MariaDB databases and database users, linking them to apps and websites, the SQL interface, dump imports and one-click phpMyAdmin sign-in. Databases and database users live on the MariaDB server of one of your servers (the one the installer set up for websites and apps, on port 3306). Passwords are generated for you, stored encrypted, and added to an app's environment in one step. See [Databases](https://docs.vaultpanel.net/guides/databases). Hosting customers can use these endpoints for their own databases, within their plan. ## How changes work Creating, deleting and changing databases and users returns `202 Accepted` with the record and the `job` that carries the change out. A record's `status` is `creating`, `updating` or `deleting` while its job runs; another change meanwhile answers `409 DATABASE_BUSY` with `details.jobId`. MariaDB must be installed on the server. ## Endpoints | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/databases` | [List databases](https://docs.vaultpanel.net/api-reference/databases#list-databases) | | POST | `/api/v1/databases` | [Create a database](https://docs.vaultpanel.net/api-reference/databases#create-a-database) | | GET | `/api/v1/databases/:id` | [Get a database](https://docs.vaultpanel.net/api-reference/databases#get-a-database) | | PATCH | `/api/v1/databases/:id` | [Link a database](https://docs.vaultpanel.net/api-reference/databases#link-a-database) | | DELETE | `/api/v1/databases/:id` | [Delete a database](https://docs.vaultpanel.net/api-reference/databases#delete-a-database) | | POST | `/api/v1/databases/:id/retry` | [Retry creating a database](https://docs.vaultpanel.net/api-reference/databases#retry-creating-a-database) | | POST | `/api/v1/databases/:id/tables` | [List tables](https://docs.vaultpanel.net/api-reference/databases#list-tables) | | POST | `/api/v1/databases/:id/rows` | [Browse a table](https://docs.vaultpanel.net/api-reference/databases#browse-a-table) | | POST | `/api/v1/databases/:id/query` | [Run SQL](https://docs.vaultpanel.net/api-reference/databases#run-sql) | | POST | `/api/v1/databases/:id/phpmyadmin` | [Open in phpMyAdmin](https://docs.vaultpanel.net/api-reference/databases#open-in-phpmyadmin) | | POST | `/api/v1/databases/:id/imports` | [Import a dump](https://docs.vaultpanel.net/api-reference/databases#import-a-dump) | | PUT | `/api/v1/databases/:id/imports/:uploadId/chunks/:offset` | [Import a dump](https://docs.vaultpanel.net/api-reference/databases#import-a-dump) | | POST | `/api/v1/databases/:id/imports/:uploadId/finish` | [Import a dump](https://docs.vaultpanel.net/api-reference/databases#import-a-dump) | | GET | `/api/v1/database-users` | [List database users](https://docs.vaultpanel.net/api-reference/databases#list-database-users) | | POST | `/api/v1/database-users` | [Create a database user](https://docs.vaultpanel.net/api-reference/databases#create-a-database-user) | | PATCH | `/api/v1/database-users/:id` | [Update a database user](https://docs.vaultpanel.net/api-reference/databases#update-a-database-user) | | DELETE | `/api/v1/database-users/:id` | [Delete a database user](https://docs.vaultpanel.net/api-reference/databases#delete-a-database-user) | | POST | `/api/v1/database-users/:id/password` | [Reveal a user's password](https://docs.vaultpanel.net/api-reference/databases#reveal-a-users-password) | ## The database object ```json { "id": "8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "customerId": null, "engine": "mariadb", "name": "shop", "charset": "utf8mb4", "collation": "utf8mb4_unicode_ci", "status": "active", "sizeBytes": 52428800, "sizeCheckedAt": "2026-11-10T11:00:00.000Z", "application": { "id": "5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c", "name": "api" }, "website": null, "users": [{ "id": "b1a2c3d4-…", "username": "shop", "privileges": "all" }], "lastJobId": "…", "lastError": null, "createdAt": "2026-11-02T09:10:00.000Z", "updatedAt": "2026-11-02T09:10:20.000Z" } ``` `status` is `creating`, `active`, `updating`, `deleting` or `failed`. `application` and `website` are the app and website that use the database; a website's backups can include its linked databases. ## The database user object ```json { "id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b", "serverName": "web-1", "customerId": null, "engine": "mariadb", "username": "shop", "privileges": "all", "status": "active", "hosts": ["localhost", "127.0.0.1"], "databases": [{ "id": "8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9", "name": "shop" }], "lastJobId": "…", "lastError": null, "createdAt": "2026-11-02T09:10:00.000Z", "updatedAt": "2026-11-02T09:10:20.000Z" } ``` `privileges` is `all` (read, write and change the structure) or `readonly` (`SELECT` only). Users connect from the server itself, by socket or TCP. ## List databases `GET /api/v1/databases` — Permission: databases.read — Token scope: read Databases, by name. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches the name. | | `serverId` | string | No | Databases on one server. | | `applicationId` | string | No | Databases linked to one app. | | `websiteId` | string | No | Databases linked to one website. | | `sort` | string | No | `name` (default, ascending), `createdAt` or `size`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/databases?serverId=1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.databases.list({ serverId }); ``` **Response** `200 OK`: `{ items: [database], pagination }`. ## Create a database `POST /api/v1/databases` — Permission: databases.manage — Token scope: manage Creates a database (`CREATE_DATABASE`) and, by default, a user with access to it, named like the database. The user's generated password is returned only in this response. With `applicationId` and `addToAppEnv` (the default), the connection settings are added to the app's environment as `DATABASE_URL`, `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER` and `DB_PASSWORD`, only those it does not have yet (needs `applications.manage`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | Yes | The server to create it on. | | `name` | string | Yes | 2 to 64 lowercase letters, digits and underscores, starting with a letter. Not a name reserved by the database server. | | `applicationId` | string or null | No | The app that uses it, on the same server and account. | | `websiteId` | string or null | No | The website that uses it, so its backups can include it. | | `createUser` | boolean | No | Also create a user. Default `true`. | | `username` | string | No | 2 to 32 lowercase letters, digits and underscores. Defaults to the database name. | | `privileges` | string | No | The user's access: `all` (default) or `readonly`. | | `addToAppEnv` | boolean | No | Add the connection settings to the app. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/databases \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"serverId":"1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b","name":"shop","applicationId":"5c4b3a29-8d7e-4f6a-b5c4-3d2e1f0a9b8c"}' ``` **JavaScript** ```js const { database, user, password, envAdded } = await panel.databases.create({ serverId, name: 'shop', applicationId: appId, }); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "database": { "id": "8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9", "name": "shop", "status": "creating" }, "job": { "id": "…", "type": "CREATE_DATABASE", "status": "queued" }, "user": { "id": "b1a2c3d4-…", "username": "shop", "privileges": "all", "status": "creating" }, "password": "k2Vb9…", "envAdded": ["DATABASE_URL", "DB_HOST", "DB_PORT", "DB_NAME", "DB_USER", "DB_PASSWORD"] }, "message": "Creating the database on the server", "requestId": "…" } ``` `user` and `password` are `null` when no user was created. Apply the app's settings (or deploy it) for new environment variables to take effect. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Adding to an app's environment without `applications.manage`. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `DATABASE_SERVER_NOT_INSTALLED` | Install MariaDB on the server first. | | 409 | `AGENT_OUTDATED` | The agent is too old to manage databases. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more databases or users. | | 422 | `VALIDATION_ERROR` | An invalid or reserved name, a name already used on the server, or an app or website not on the same server and account. | ## Get a database `GET /api/v1/databases/:id` — Permission: databases.read — Token scope: read **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const database = await panel.databases.get(databaseId); ``` **Response** `200 OK` with [the database object](https://docs.vaultpanel.net/api-reference/databases#the-database-object). `404 NOT_FOUND` when there is no such database, or it is not yours. ## Link a database `PATCH /api/v1/databases/:id` — Permission: databases.manage — Token scope: manage Links the database to the app and the website that use it, on the same server and account. `null` unlinks; a field left out keeps its link. Nothing changes on the server. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `applicationId` | string or null | No | The app that uses it. | | `websiteId` | string or null | No | The website that uses it. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"websiteId":"0b8e4c2a-7d6f-4e1b-9a3c-5f2e8d1c4b7a"}' ``` **JavaScript** ```js const { database } = await panel.databases.update(databaseId, { websiteId }); ``` **Response** `200 OK` with `{ database }`, message `Saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | Nothing to update, or the app or website is not on the same server and account. | ## Delete a database `DELETE /api/v1/databases/:id` — Permission: databases.manage — Token scope: manage Drops the database on the server (`DELETE_DATABASE`). Users stay; delete them separately. **Example request** **cURL** ```bash curl -X DELETE https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.databases.remove(databaseId); ``` **Response** `202 Accepted` with `{ database, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `DATABASE_BUSY` | Another change is running. | ## Retry creating a database `POST /api/v1/databases/:id/retry` — Permission: databases.manage — Token scope: manage Queues `CREATE_DATABASE` again for a database whose creation failed. **Response** `202 Accepted` with `{ database, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `DATABASE_READY` | The database already exists on its server. | ## The SQL interface [List tables](https://docs.vaultpanel.net/api-reference/databases#list-tables), [Browse a table](https://docs.vaultpanel.net/api-reference/databases#browse-a-table) and [Run SQL](https://docs.vaultpanel.net/api-reference/databases#run-sql) power the panel's database page. Each queues a routine job; the result arrives in the job's `output`. The agent runs them as an account that can reach only this database, read-only unless you allow changes. Statements stop after 30 seconds, results are cut at 1000 rows, and long cells at 5000 characters. All three need `databases.manage` and a database that is not being created, deleted or failed (`409 DATABASE_NOT_READY`). See [SQL client](https://docs.vaultpanel.net/guides/databases/sql-client). ## List tables `POST /api/v1/databases/:id/tables` — Permission: databases.manage — Token scope: manage **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/tables \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.request('POST', `/databases/${databaseId}/tables`); const { job: done } = await panel.jobs.wait(job.id, { intervalMs: 500 }); ``` **Response** `202 Accepted` with the job. Its output: ```json { "name": "shop", "tables": [ { "name": "orders", "type": "table", "engine": "InnoDB", "rowEstimate": 12840, "dataBytes": 2637824, "indexBytes": 1589248, "collation": "utf8mb4_unicode_ci", "comment": null, "updatedAt": "2026-11-10 11:28:04" } ] } ``` ## Browse a table `POST /api/v1/databases/:id/rows` — Permission: databases.manage — Token scope: manage One page of a table's rows, with its columns, indexes and `CREATE` statement. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `table` | string | Yes | The table or view. | | `page` | integer | No | From 1. Default 1. | | `pageSize` | integer | No | 1 to 500. Default 50. | | `orderBy` | string | No | A column to sort by. | | `order` | string | No | `asc` (default) or `desc`. | **Example request** ```bash curl https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/rows \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"table":"orders","pageSize":20,"orderBy":"id","order":"desc"}' ``` **Response** `202 Accepted` with the job. Its output: ```json { "name": "shop", "table": "orders", "columns": [ { "name": "id", "type": "int(10) unsigned", "nullable": false, "key": "PRI", "default": null, "extra": "auto_increment", "comment": null } ], "indexes": [{ "name": "PRIMARY", "unique": true, "type": "BTREE", "columns": ["id"] }], "isView": false, "createStatement": "CREATE TABLE `orders` (…)", "page": 1, "pageSize": 20, "orderBy": "id", "order": "desc", "rows": [["12840", "…"]], "hasMore": true, "truncated": false } ``` ## Run SQL `POST /api/v1/databases/:id/query` — Permission: databases.manage — Token scope: manage Runs one or more statements. Without `allowChanges` they run read-only; statements that change data or structure are refused by the database server, and the error carries a `hint`. Queries run with `allowChanges` are recorded in the audit log (the first 1000 characters). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `sql` | string | Yes | Up to 100000 characters. | | `allowChanges` | boolean | No | Run with write access. Default `false`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/query \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"sql":"SELECT status, COUNT(*) AS n FROM orders GROUP BY status;"}' ``` **JavaScript** ```js const job = await panel.request('POST', `/databases/${databaseId}/query`, { body: { sql: 'SELECT status, COUNT(*) AS n FROM orders GROUP BY status;' }, }); const { job: done } = await panel.jobs.wait(job.id, { intervalMs: 500 }); console.log(done.output.statements, done.output.error); ``` **Response** `202 Accepted` with the job. Its output has `name`, `allowChanges`, `elapsedMs`, one entry per statement in `statements` (each with its `sql` and its result), and `error` when a statement failed: `{ code, sqlState, line, message }`, plus `hint` for a change refused in read-only mode. ## Open in phpMyAdmin `POST /api/v1/databases/:id/phpmyadmin` — Permission: databases.manage — Token scope: manage One-click phpMyAdmin sign-in. The agent leaves a one-time ticket, valid for two minutes, for a fresh token; open phpMyAdmin with the token to be signed in as the database's own full-access account. Only the token's SHA-256 goes into the job; the token itself is returned only to you. phpMyAdmin must be set up on the server (`PHPMYADMIN_SETUP`). See [phpMyAdmin](https://docs.vaultpanel.net/guides/databases/phpmyadmin). **Response** `202 Accepted` ```json { "success": true, "data": { "job": { "id": "…", "type": "PHPMYADMIN_SIGNON", "status": "queued" }, "token": "…", "phpmyadmin": { "port": 8081, "domain": null, "host": "203.0.113.10", "isLocal": false } }, "message": "OK", "requestId": "…" } ``` Wait for the job to succeed before opening phpMyAdmin with the token. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `PHPMYADMIN_NOT_SET_UP` | phpMyAdmin is not set up on this server. | | 409 | `DATABASE_NOT_READY` | The database is not ready on its server. | ## Import a dump `POST /api/v1/databases/:id/imports` — Permission: databases.manage — Token scope: manage Loads a `.sql` or `.sql.gz` file into the database (`IMPORT_DATABASE`, agent 0.43.0 or newer) in three steps, like [large file uploads](https://docs.vaultpanel.net/api-reference/websites#upload-a-large-file): 1. **Start**: `POST /databases/:id/imports` with the file's size and name. 2. **Send the pieces**: `PUT /databases/:id/imports/:uploadId/chunks/:offset` with each piece as the raw body (`Content-Type: application/octet-stream`), up to `chunkBytes` (8 MB) each, in order. Each answers `{ received, size }`. 3. **Finish**: `POST /databases/:id/imports/:uploadId/finish`. The panel checks the whole file's SHA-256 and queues the job; the agent fetches the file and imports it. The agent runs the `mysql` client as `nobody`, in its sandbox mode, signed in as an account that can reach only this database, so a dump cannot reach other databases or accounts. Files up to `VAULTPANEL_FILE_UPLOAD_MAX_MB` (2048 MB by default) are taken. The database must be `active`. See [Import and export](https://docs.vaultpanel.net/guides/databases/import-and-export). **Request body** (start) | Field | Type | Required | Description | | --- | --- | --- | --- | | `size` | integer | Yes | The file's size in bytes, at least 1. | | `fileName` | string | Yes | Up to 255 characters, ending in `.sql` or `.sql.gz`. Shown in the audit log. | **Request body** (finish) | Field | Type | Required | Description | | --- | --- | --- | --- | | `replace` | boolean | No | Empty the database first (drop and create it again). Default `false`: the file runs on top of what is there. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/imports -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"size":5242880,"fileName":"shop.sql.gz"}' curl -X PUT https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/imports/$UPLOAD_ID/chunks/0 -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/octet-stream" --data-binary @shop.sql.gz curl https://panel.example.com/api/v1/databases/8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9/imports/$UPLOAD_ID/finish -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" -d '{"replace":false}' ``` **JavaScript** ```js const { uploadId, chunkBytes } = await panel.request('POST', `/databases/${databaseId}/imports`, { body: { size: file.length, fileName: 'shop.sql.gz' }, }); // Send each piece with PUT .../imports/${uploadId}/chunks/${offset}, then: const job = await panel.request('POST', `/databases/${databaseId}/imports/${uploadId}/finish`, { body: { replace: false }, }); const { job: done } = await panel.jobs.wait(job.id); ``` **Response** - Start: `201 Created` with `{ uploadId, chunkBytes, size }`, message `Upload started`. - Each piece: `200 OK` with `{ received, size }`. - Finish: `202 Accepted` with the `IMPORT_DATABASE` job, message `Importing into the database`. Its output is `{ name, sizeBytes, replaced, compressed }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `DATABASE_NOT_READY` | The database is not active on its server. | | 409 | `AGENT_OUTDATED` | The agent cannot import into databases (before 0.43.0). | | 409 | `OFFSET_MISMATCH` | A piece was sent for the wrong offset. `details.expected` is where to continue. | | 409 | `UPLOAD_INCOMPLETE` | Finish was called before every byte arrived. `details.received` says how many have. | | 409 | `UPLOAD_FINISHED` | The upload is already finished. | | 413 | `FILE_TOO_LARGE` | The file is larger than `VAULTPANEL_FILE_UPLOAD_MAX_MB`. | | 413 | `CHUNK_TOO_LARGE` | A piece is larger than `chunkBytes`. | | 422 | `VALIDATION_ERROR` | An empty file, or a name that does not end in `.sql` or `.sql.gz`. | The job fails with `NOT_A_SQL_FILE` for a file that is not SQL or gzip, `DATABASE_CLIENT_TOO_OLD` when the server's `mysql` client has no sandbox mode, and `IMPORT_FAILED` when a statement fails: what came before it is imported, and the error says why it stopped. To export a database, [back it up](https://docs.vaultpanel.net/api-reference/backups#back-up-now) and [download the backup](https://docs.vaultpanel.net/api-reference/backups#download-a-backup). ## List database users `GET /api/v1/database-users` — Permission: databases.read — Token scope: read Users, by username, each with the databases it can reach. Supports the [list parameters](https://docs.vaultpanel.net/api-reference#lists-and-pagination). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Matches the username. | | `serverId` | string | No | Users on one server. | | `sort` | string | No | `username` (default, ascending) or `createdAt`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/database-users \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.databases.users.list(); ``` **Response** `200 OK`: `{ items: [user], pagination }`. ## Create a database user `POST /api/v1/database-users` — Permission: databases.manage — Token scope: manage Creates a user (`CREATE_DATABASE_USER`) with access to the given databases on the same server. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string | Yes | The server. | | `username` | string | Yes | 2 to 32 lowercase letters, digits and underscores, starting with a letter. | | `password` | string | No | 12 to 72 letters, digits or the symbols `! # % + , . : = ? @ ^ _ ~ -`. Generated when left out. | | `privileges` | string | No | `all` (default) or `readonly`. | | `databaseIds` | string[] | No | Up to 50 databases on the same server. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/database-users \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"serverId":"1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b","username":"reports","privileges":"readonly","databaseIds":["8d7c6b5a-4938-4271-a6b5-c4d3e2f1a0b9"]}' ``` **JavaScript** ```js const { user, password } = await panel.databases.users.create({ serverId, username: 'reports', privileges: 'readonly', databaseIds: [databaseId], }); ``` **Response** `202 Accepted` with `{ user, job, password }`. `password` is the generated password, shown once, or `null` when you gave one. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SERVER_NOT_READY`, `DATABASE_SERVER_NOT_INSTALLED`, `AGENT_OUTDATED` | As for [Create a database](https://docs.vaultpanel.net/api-reference/databases#create-a-database). | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more database users. | | 422 | `VALIDATION_ERROR` | An invalid or taken username, an invalid password, or a database on another server. | ## Update a database user `PATCH /api/v1/database-users/:id` — Permission: databases.manage — Token scope: manage Changes a user's password, access or databases (`UPDATE_DATABASE_USER`). `databaseIds` replaces the list. Send at least one field, and not both `password` and `generatePassword`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | No | A new password, with the same rules as for create. | | `generatePassword` | boolean | No | Generate a new password and return it once. | | `privileges` | string | No | `all` or `readonly`. | | `databaseIds` | string[] | No | Up to 50 databases on the same server. | **Example request** **cURL** ```bash curl -X PATCH https://panel.example.com/api/v1/database-users/b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \ -d '{"generatePassword":true}' ``` **JavaScript** ```js const { password } = await panel.databases.users.update(userId, { generatePassword: true }); ``` **Response** `202 Accepted` with `{ user, job, password }`. `password` is set only with `generatePassword`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `DATABASE_USER_NOT_READY` | The user was never created on the server. Delete it and create it again. | | 409 | `DATABASE_BUSY` | Another change to this user is running. | | 422 | `VALIDATION_ERROR` | Nothing to update, both password fields, or an invalid value. | ## Delete a database user `DELETE /api/v1/database-users/:id` — Permission: databases.manage — Token scope: manage Drops the user on the server (`DELETE_DATABASE_USER`). Its databases stay. **Example request** **cURL** ```bash curl -X DELETE https://panel.example.com/api/v1/database-users/b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.databases.users.remove(userId); ``` **Response** `202 Accepted` with `{ user, job }`. ## Reveal a user's password `POST /api/v1/database-users/:id/password` — Permission: databases.manage — Token scope: manage The user's current password and how to connect, decrypted on request. Every reveal is recorded in the audit log. **Example request** **cURL** ```bash curl -X POST https://panel.example.com/api/v1/database-users/b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/password \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { connectionUrl } = await panel.databases.users.password(userId); ``` **Response** `200 OK` ```json { "success": true, "data": { "username": "shop", "password": "k2Vb9…", "host": "127.0.0.1", "port": 3306, "connectionUrl": "mysql://shop:k2Vb9…@127.0.0.1:3306/shop" }, "message": "OK", "requestId": "…" } ``` `connectionUrl` names the user's first database, or is `null` when it has none. --- # Containers URL: https://docs.vaultpanel.net/api-reference/containers > API reference for Docker containers - deploying, changing, redeploying and removing containers, any container or image on a server, and Docker itself. The `/containers` endpoints manage Docker containers from public images. `/containers/:id` are the containers VaultPanel deployed; `/containers/servers/:serverId/...` reach every container on a server, VaultPanel's or not, and Docker itself. Changes and reads on a server are jobs for its agent, which talks to Docker's API, never a shell. The server's agent must be 0.10.0 or newer. Hosting customers have no access (`403 FORBIDDEN`). For the workflow, see [Containers](https://docs.vaultpanel.net/guides/applications/containers). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/containers/servers` | [List servers with Docker](https://docs.vaultpanel.net/api-reference/containers#list-servers-with-docker) | | GET | `/api/v1/containers` | [List containers](https://docs.vaultpanel.net/api-reference/containers#list-containers) | | POST | `/api/v1/containers` | [Deploy a container](https://docs.vaultpanel.net/api-reference/containers#deploy-a-container) | | GET | `/api/v1/containers/:id` | [Get a container](https://docs.vaultpanel.net/api-reference/containers#get-a-container) | | PATCH | `/api/v1/containers/:id` | [Change a container](https://docs.vaultpanel.net/api-reference/containers#change-a-container) | | DELETE | `/api/v1/containers/:id` | [Remove a container](https://docs.vaultpanel.net/api-reference/containers#remove-a-container) | | GET | `/api/v1/containers/:id/environment` | [Get environment variables](https://docs.vaultpanel.net/api-reference/containers#get-environment-variables) | | POST | `/api/v1/containers/:id/redeploy` | [Redeploy a container](https://docs.vaultpanel.net/api-reference/containers#redeploy-a-container) | | POST | `/api/v1/containers/:id/:action` | [Start, stop or restart a container](https://docs.vaultpanel.net/api-reference/containers#start-stop-or-restart-a-container) | | POST | `/api/v1/containers/servers/:serverId/docker/status` | [Read Docker's state](https://docs.vaultpanel.net/api-reference/containers#read-dockers-state) | | POST | `/api/v1/containers/servers/:serverId/docker/install` | [Install or start Docker](https://docs.vaultpanel.net/api-reference/containers#install-or-start-docker) | | POST | `/api/v1/containers/servers/:serverId/containers/list` | [List every container on a server](https://docs.vaultpanel.net/api-reference/containers#list-every-container-on-a-server) | | POST | `/api/v1/containers/servers/:serverId/containers/:ref/logs` | [Read a container's logs](https://docs.vaultpanel.net/api-reference/containers#read-a-containers-logs) | | POST | `/api/v1/containers/servers/:serverId/containers/:ref/inspect` | [Inspect a container](https://docs.vaultpanel.net/api-reference/containers#inspect-a-container) | | POST | `/api/v1/containers/servers/:serverId/containers/:ref/:action` | [Act on any container](https://docs.vaultpanel.net/api-reference/containers#act-on-any-container) | | POST | `/api/v1/containers/servers/:serverId/containers/:ref/remove` | [Remove any container](https://docs.vaultpanel.net/api-reference/containers#remove-any-container) | | POST | `/api/v1/containers/servers/:serverId/images/list` | [List images](https://docs.vaultpanel.net/api-reference/containers#list-images) | | POST | `/api/v1/containers/servers/:serverId/images/pull` | [Pull an image](https://docs.vaultpanel.net/api-reference/containers#pull-an-image) | | POST | `/api/v1/containers/servers/:serverId/images/remove` | [Remove an image](https://docs.vaultpanel.net/api-reference/containers#remove-an-image) | ## How changes work Deploying or changing a container keeps the change in `pending` until its `CONTAINER_DEPLOY` job succeeds. If the new container does not stay up for `healthCheckSeconds`, the agent puts the old one back, and the record keeps its old settings with `lastError`. Only one change runs at a time per container. The server-level requests (everything under `/containers/servers/:serverId/`) return the queued job with `202 Accepted`. When the job succeeds, its `output` holds the answer: wait for it with [`GET /api/v1/jobs/:id`](https://docs.vaultpanel.net/api-reference/jobs) or `panel.jobs.wait()`. These errors can come from most endpoints on this page: | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No container or server with this id. | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `AGENT_OUTDATED` | The server's agent is older than 0.10.0. | | 409 | `DOCKER_NOT_INSTALLED`, `DOCKER_NOT_RUNNING` | Docker is missing or stopped on the server (deploying, changing, pulling and removing images). | | 409 | `CONTAINER_BUSY` | A deployment or removal of this container is still running (`details.jobId`). | | 409 | `PROTECTED_CONTAINER` | The container runs VaultPanel's own database or Redis; it cannot be stopped, restarted or removed from the panel. | | 409 | `DUPLICATE_OPERATION` | The same job is already queued or running (`details.jobId`). | ## The container object | Field | Type | Description | | --- | --- | --- | | `id`, `serverId`, `serverName` | string | The container record and its server. | | `name` | string | 3 to 32 lowercase letters, digits and dashes, starting with a letter. Containers on the `vaultpanel` Docker network reach each other by name. | | `image` | string | Such as `nginx:1.27`, `ghcr.io/owner/app:latest` or `redis`. | | `ports` | object[] | `{ address, hostPort, containerPort, protocol }`. | | `volumes` | object[] | `{ volume, path, readOnly }`: a named Docker volume mounted at a path. | | `restartPolicy` | string | `unless-stopped`, `always`, `on-failure` or `no`. | | `memoryMb`, `cpuPercent` | integer or null | Limits; `cpuPercent` 100 is one core. | | `command` | string or null | The command run instead of the image's own. | | `healthCheckSeconds` | integer | How long a new container must stay up. | | `envKeys` | string[] | Variable names only. Values: [Get environment variables](https://docs.vaultpanel.net/api-reference/containers#get-environment-variables). | | `status` | string | `deploying`, `active`, `failed` (first deployment failed) or `removing`. | | `state`, `stateDetail`, `stateCheckedAt` | | What Docker last reported: `running`, `exited`… | | `dockerId`, `deployedAt` | | Docker's id for the container, and when it was last deployed. | | `pending` | object or null | The image and settings being deployed. | | `lastJobId`, `lastError` | | The last job, and `{ code, message }` of the last failure. | ## List servers with Docker `GET /api/v1/containers/servers` — Permission: containers.read — Token scope: read Returns every server with what its agent last said about Docker, container counts, how many containers VaultPanel deployed there, and whether its agent can manage containers (`supported`). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.containers.servers(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "web-1", "status": "online", "isLocal": true, "agentVersion": "0.41.0", "supported": true, "docker": { "installed": true, "running": true, "source": "package", "service": "docker", "version": "28.1.1" }, "containers": { "total": 4, "running": 4 }, "deployed": 2, "protectedPorts": [3307, 6379], "lastSeenAt": "2026-11-10T10:15:02.000Z" } ] }, "message": "OK", "requestId": "…" } ``` ## List containers `GET /api/v1/containers` — Permission: containers.read — Token scope: read Returns the containers VaultPanel deployed, a page at a time. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | No | Only containers on this server. | | `search` | string | No | Part of the name, up to 100 characters. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `name` (default) or `createdAt`; `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/containers?serverId=9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, pagination } = await panel.containers.list({ serverId }); ``` **Response** `200 OK`: `{ items, pagination }` of [container objects](https://docs.vaultpanel.net/api-reference/containers#the-container-object). ## Deploy a container `POST /api/v1/containers` — Permission: containers.manage — Token scope: manage Deploys a new container. Host ports are checked against apps, other containers, SSH, the panel's own port, VaultPanel's database and Redis, and 80 and 443 when NGINX is installed. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | The server. | | `name` | string | Yes | 3 to 32 lowercase letters, digits and dashes, starting with a letter. Unique on the server. | | `image` | string | Yes | Image reference, up to 255 characters. | | `ports` | object[] | No | Up to 10 `{ address, hostPort, containerPort, protocol }`. `address` is `127.0.0.1` (default, this server only, for a reverse proxy) or `0.0.0.0` (public: Docker opens it even when the firewall has no rule). `protocol` is `tcp` (default) or `udp`. | | `volumes` | object[] | No | Up to 10 `{ volume, path, readOnly }`. `volume` is lowercase letters, digits and dashes; `path` an absolute path inside the container. | | `env` | object[] | No | Up to 100 `{ key, value }`. Keys: letters, digits and underscores, not starting with a digit. Values up to 8192 characters. | | `restartPolicy` | string | No | `unless-stopped` (default), `always`, `on-failure` or `no`. | | `memoryMb` | integer or null | No | 32 to 262144. | | `cpuPercent` | integer or null | No | 5 to 6400 (100 is one core). | | `command` | string or null | No | One line, up to 1000 characters, split into arguments like a shell would but never run through one. Empty uses the image's command. | | `healthCheckSeconds` | integer | No | 3 to 300. Default 10. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "uptime", "image": "louislam/uptime-kuma:1", "ports": [{ "address": "127.0.0.1", "hostPort": 3001, "containerPort": 3001 }], "volumes": [{ "volume": "uptime-data", "path": "/app/data" }], "memoryMb": 512 }' ``` **JavaScript** ```js const { container, job } = await panel.containers.create({ serverId: '9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c', name: 'uptime', image: 'louislam/uptime-kuma:1', ports: [{ address: '127.0.0.1', hostPort: 3001, containerPort: 3001 }], volumes: [{ volume: 'uptime-data', path: '/app/data' }], memoryMb: 512, }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "container": { "id": "6b7c8d9e-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "uptime", "image": "louislam/uptime-kuma:1", "ports": [{ "address": "127.0.0.1", "hostPort": 3001, "containerPort": 3001, "protocol": "tcp" }], "volumes": [{ "volume": "uptime-data", "path": "/app/data", "readOnly": false }], "restartPolicy": "unless-stopped", "memoryMb": 512, "cpuPercent": null, "command": null, "healthCheckSeconds": 10, "envKeys": [], "status": "deploying", "state": null, "pending": null, "lastError": null }, "job": { "id": "…", "type": "CONTAINER_DEPLOY", "status": "queued" } }, "message": "Deploying the container", "requestId": "…" } ``` **Errors**: those [above](https://docs.vaultpanel.net/api-reference/containers#how-changes-work), and `422 VALIDATION_ERROR` for a name already used on the server, a host port already in use or reserved (the error names what uses it), a volume or path used twice, a variable listed twice, or another invalid field. ## Get a container `GET /api/v1/containers/:id` — Permission: containers.read — Token scope: read Returns one [container object](https://docs.vaultpanel.net/api-reference/containers#the-container-object). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const container = await panel.containers.get(containerId); ``` **Response** `200 OK`: the container. ## Change a container `PATCH /api/v1/containers/:id` — Permission: containers.manage — Token scope: manage Changes the container and deploys a replacement. Every field of [Deploy a container](https://docs.vaultpanel.net/api-reference/containers#deploy-a-container) except `serverId` and `name` may be given; `env`, when given, replaces every variable. Send at least one field besides `pull`. | Extra field | Type | Description | | --- | --- | --- | | `pull` | boolean | Pull the image again even when it is already on the server. Default `false`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "image": "louislam/uptime-kuma:2", "pull": true }' ``` **JavaScript** ```js const { container, job } = await panel.containers.update(containerId, { image: 'louislam/uptime-kuma:2', pull: true, }); ``` **Response** `202 Accepted`: `{ container, job }` with the change in `pending`, message `Deploying the change`. ## Remove a container `DELETE /api/v1/containers/:id` — Permission: containers.manage — Token scope: manage Removes the container and its record (`CONTAINER_REMOVE`). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `removeVolumes` | boolean | No | Also delete its volumes and their data. Default `false`. | **Example request** **cURL** ```bash curl -X DELETE \ "https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e?removeVolumes=true" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.containers.remove(containerId, { removeVolumes: true }); ``` **Response** `202 Accepted`: `{ container, job }` with status `removing`, message `Removing the container`. ## Get environment variables `GET /api/v1/containers/:id/environment` — Permission: containers.manage — Token scope: manage Returns the values of the container's variables. Values are stored encrypted, and every read is recorded in the audit log. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e/environment \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { variables } = await panel.containers.environment(containerId); ``` **Response** `200 OK` ```json { "success": true, "data": { "variables": [{ "key": "TZ", "value": "Europe/Berlin" }] }, "message": "OK", "requestId": "…" } ``` ## Redeploy a container `POST /api/v1/containers/:id/redeploy` — Permission: containers.manage — Token scope: manage Recreates the container with the same settings, pulling its image again by default, which picks up a new build of the same tag. Also retries a failed first deployment. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `pull` | boolean | No | Pull the image first. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e/redeploy \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "pull": true }' ``` **JavaScript** ```js const { job } = await panel.containers.redeploy(containerId, { pull: true }); ``` **Response** `202 Accepted`: `{ container, job }`, message `Redeploying the container`. ## Start, stop or restart a container `POST /api/v1/containers/:id/:action` — Permission: containers.operate — Token scope: deploy `:action` is `start`, `stop` or `restart`. Returns the queued job (`CONTAINER_START`, `CONTAINER_STOP` or `CONTAINER_RESTART`). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e/restart \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.restart(containerId); ``` **Response** `202 Accepted`: the job, message `Starting the container`, `Stopping the container` or `Restarting the container`. ## Read Docker's state `POST /api/v1/containers/servers/:serverId/docker/status` — Permission: containers.read — Token scope: read Queues a `DOCKER_STATUS` job that reads whether Docker is installed and running on the server, and its version. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/docker/status \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.docker(serverId); const done = await panel.jobs.wait(job.id); console.log(done.output); ``` **Response** `202 Accepted`: the job, message `Reading Docker’s status`. ## Install or start Docker `POST /api/v1/containers/servers/:serverId/docker/install` — Permission: containers.manage — Token scope: manage Queues a `DOCKER_INSTALL` job that installs Docker, or starts it when it is installed but stopped. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/docker/install \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.installDocker(serverId); ``` **Response** `202 Accepted`: the job, message `Installing or starting Docker`. ## List every container on a server `POST /api/v1/containers/servers/:serverId/containers/list` — Permission: containers.read — Token scope: read Queues a `CONTAINER_LIST` job: every container Docker runs on the server, whether VaultPanel deployed it or not, in the job's `output`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/containers/list \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.list(serverId); const { output } = await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: the job, message `Listing containers`. In the following server-level endpoints, `:ref` is a container's Docker ID (12 to 64 hexadecimal characters) or its name. ## Read a container's logs `POST /api/v1/containers/servers/:serverId/containers/:ref/logs` — Permission: containers.logs — Token scope: logs Queues a `CONTAINER_LOGS` job with the container's last lines of output. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `lines` | integer | No | 10 to 2000. Default 200. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/containers/uptime/logs \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "lines": 500 }' ``` **JavaScript** ```js const job = await panel.containers.onServer.logs(serverId, 'uptime', { lines: 500 }); const { output } = await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: the job, message `Reading the logs`. ## Inspect a container `POST /api/v1/containers/servers/:serverId/containers/:ref/inspect` — Permission: containers.read — Token scope: read Queues a `CONTAINER_INSPECT` job with the container's configuration and state in its `output`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/containers/uptime/inspect \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.inspect(serverId, 'uptime'); ``` **Response** `202 Accepted`: the job, message `Reading the container`. ## Act on any container `POST /api/v1/containers/servers/:serverId/containers/:ref/:action` — Permission: containers.operate — Token scope: deploy Starts, stops or restarts any container on the server. `:action` is `start`, `stop` or `restart`. VaultPanel's own database and Redis containers cannot be stopped or restarted. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/containers/3f2a1b0c9d8e/stop \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.act(serverId, '3f2a1b0c9d8e', 'stop'); ``` **Response** `202 Accepted`: the job. ## Remove any container `POST /api/v1/containers/servers/:serverId/containers/:ref/remove` — Permission: containers.manage — Token scope: manage Removes any container on the server. Removing a container VaultPanel deployed removes its record too, keeping its volumes. VaultPanel's own database and Redis containers cannot be removed. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/containers/3f2a1b0c9d8e/remove \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.request('POST', `/containers/servers/${serverId}/containers/3f2a1b0c9d8e/remove`); ``` **Response** `202 Accepted`: the job, message `Removing the container`. ## List images `POST /api/v1/containers/servers/:serverId/images/list` — Permission: containers.read — Token scope: read Queues an `IMAGE_LIST` job with the server's images in its `output`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/images/list \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const job = await panel.containers.onServer.images(serverId); ``` **Response** `202 Accepted`: the job, message `Listing images`. ## Pull an image `POST /api/v1/containers/servers/:serverId/images/pull` — Permission: containers.manage — Token scope: manage Queues an `IMAGE_PULL` job. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `image` | string | Yes | Image reference, such as `nginx:1.27`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/images/pull \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "image": "nginx:1.27" }' ``` **JavaScript** ```js const job = await panel.containers.onServer.pullImage(serverId, { image: 'nginx:1.27' }); ``` **Response** `202 Accepted`: the job, message `Pulling the image`. ## Remove an image `POST /api/v1/containers/servers/:serverId/images/remove` — Permission: containers.manage — Token scope: manage Queues an `IMAGE_REMOVE` job. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `imageId` | string | Yes | The full image id: `sha256:` and 64 hexadecimal characters. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/containers/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/images/remove \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "imageId": "sha256:3b25b682ea82b2db3cc4fd48db818be788ee3f902ac7378090cf2624ec2442df" }' ``` **JavaScript** ```js const job = await panel.request('POST', `/containers/servers/${serverId}/images/remove`, { body: { imageId: 'sha256:3b25b682ea82b2db3cc4fd48db818be788ee3f902ac7378090cf2624ec2442df' }, }); ``` **Response** `202 Accepted`: the job, message `Removing the image`. --- # DNS URL: https://docs.vaultpanel.net/api-reference/dns > API reference for DNS zones served by BIND on your servers, their records, customer name servers and the Cloudflare and Namecheap DNS providers. DNS zones are served by BIND on one of the panel's servers. The panel keeps each zone's records: every change raises the zone's serial and sends the whole zone to the server in a `DNS_ZONE_APPLY` job, and a zone whose records would not load is refused before it is sent. DNS providers hold Cloudflare or Namecheap credentials used to issue wildcard certificates for domains whose DNS is hosted there. `/dns` is for staff: hosting customers are refused with `403 FORBIDDEN` and see their own zones through [`GET /api/v1/hosting/me/dns`](https://docs.vaultpanel.net/api-reference/hosting#get-your-dns). For concepts and the panel workflow, see [DNS zones](https://docs.vaultpanel.net/guides/dns-and-email/dns-zones) and [DNS providers](https://docs.vaultpanel.net/guides/dns-and-email/dns-providers). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/dns/zones` | [List zones](https://docs.vaultpanel.net/api-reference/dns#list-zones) | | POST | `/api/v1/dns/zones` | [Create a zone](https://docs.vaultpanel.net/api-reference/dns#create-a-zone) | | GET | `/api/v1/dns/zones/:id` | [Get a zone](https://docs.vaultpanel.net/api-reference/dns#get-a-zone) | | PATCH | `/api/v1/dns/zones/:id` | [Update a zone](https://docs.vaultpanel.net/api-reference/dns#update-a-zone) | | DELETE | `/api/v1/dns/zones/:id` | [Delete a zone](https://docs.vaultpanel.net/api-reference/dns#delete-a-zone) | | POST | `/api/v1/dns/zones/:id/apply` | [Apply a zone again](https://docs.vaultpanel.net/api-reference/dns#apply-a-zone-again) | | POST | `/api/v1/dns/zones/:id/check` | [Check name servers in public DNS](https://docs.vaultpanel.net/api-reference/dns#check-name-servers-in-public-dns) | | POST | `/api/v1/dns/zones/:id/records` | [Add a record](https://docs.vaultpanel.net/api-reference/dns#add-a-record) | | PATCH | `/api/v1/dns/zones/:id/records/:recordId` | [Update a record](https://docs.vaultpanel.net/api-reference/dns#update-a-record) | | DELETE | `/api/v1/dns/zones/:id/records/:recordId` | [Delete a record](https://docs.vaultpanel.net/api-reference/dns#delete-a-record) | | PUT | `/api/v1/dns/servers/:id/customers` | [Set customer name servers](https://docs.vaultpanel.net/api-reference/dns#set-customer-name-servers) | | GET | `/api/v1/dns/providers` | [List DNS providers](https://docs.vaultpanel.net/api-reference/dns#list-dns-providers) | | POST | `/api/v1/dns/providers` | [Add a DNS provider](https://docs.vaultpanel.net/api-reference/dns#add-a-dns-provider) | | GET | `/api/v1/dns/providers/:id` | [Get a DNS provider](https://docs.vaultpanel.net/api-reference/dns#get-a-dns-provider) | | PUT | `/api/v1/dns/providers/:id` | [Update a DNS provider](https://docs.vaultpanel.net/api-reference/dns#update-a-dns-provider) | | DELETE | `/api/v1/dns/providers/:id` | [Delete a DNS provider](https://docs.vaultpanel.net/api-reference/dns#delete-a-dns-provider) | ## The zone object | Field | Type | Description | | --- | --- | --- | | `id` | string (UUID) | Zone id. | | `serverId`, `serverName` | string | The server whose BIND serves the zone. | | `domain` | string | The zone's domain, such as `example.com`. | | `customerId` | string or null | The hosting account the zone was added for automatically, if any. | | `status` | string | `creating` (first apply running), `active`, `failed` (first apply failed) or `deleting`. | | `defaultTtl` | integer | Default TTL in seconds. | | `soaEmail` | string | The SOA contact address (`hostmaster@` unless set). | | `serial`, `appliedSerial` | integer | The zone's serial, and the serial the server confirmed. | | `appliedAt` | string or null | When the server last confirmed the zone. | | `pending` | boolean | `true` while the server does not have the latest changes yet. | | `applying` | boolean | `true` while a `DNS_ZONE_APPLY` job is queued or running. | | `recordCount` | integer | Number of records. | | `records` | array | Only on single-zone responses: every [record](https://docs.vaultpanel.net/api-reference/dns#the-record-object). | | `nameservers` | array | Only on single-zone responses: the zone's `@` NS records as `{ host, inZone, addresses }`, what to enter at the registrar. | | `delegation` | object or null | The last [name server check](https://docs.vaultpanel.net/api-reference/dns#check-name-servers-in-public-dns): `{ status, nameservers, detail, checkedAt }`. | | `lastJobId` | string or null | The last job sent for the zone. | | `lastError` | object or null | `{ code, message }` of the last failed job. | | `createdAt`, `updatedAt` | string | ISO 8601 timestamps. | ## The record object | Field | Type | Description | | --- | --- | --- | | `id` | string (UUID) | Record id. | | `name` | string | Name relative to the zone: `@` for the domain itself, `www`, `mail`… | | `fullName` | string | The full name, such as `www.example.com`. | | `type` | string | `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `NS`, `SRV` or `CAA`. | | `ttl` | integer or null | TTL in seconds, or `null` for the zone's default. | | `value` | string | Address, host name or text. | | `priority` | integer or null | `MX` and `SRV` only. | | `weight`, `port` | integer or null | `SRV` only. | | `tag` | string or null | `CAA` only: `issue`, `issuewild` or `iodef`. | ## List zones `GET /api/v1/dns/zones` — Permission: dns.read — Token scope: read Returns zones a page at a time, without their records (`recordCount` gives the number). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Part of the domain, up to 100 characters. | | `serverId` | string (UUID) | No | Only zones on this server. | | `page`, `pageSize` | integer | No | Page number from 1, and 1 to 100 items per page (default 25). | | `sort` | string | No | `domain` (default) or `createdAt`. | | `order` | string | No | `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/dns/zones?search=example" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, pagination } = await panel.dns.zones({ search: 'example' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "domain": "example.com", "customerId": null, "status": "active", "defaultTtl": 3600, "soaEmail": "hostmaster@example.com", "serial": 2026111002, "appliedSerial": 2026111002, "appliedAt": "2026-11-10T09:12:44.000Z", "pending": false, "applying": false, "recordCount": 9, "delegation": null, "lastJobId": "d3c1b2a0-7e6f-4a5b-8c9d-0e1f2a3b4c5d", "lastError": null, "createdAt": "2026-11-10T09:12:30.000Z", "updatedAt": "2026-11-10T09:12:44.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "0f6c1d9e-…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Missing `dns.read`, or a hosting customer. | | 422 | `VALIDATION_ERROR` | A query parameter is invalid. | ## Create a zone `POST /api/v1/dns/zones` — Permission: dns.manage — Token scope: manage Adds a zone on a server whose DNS server is set up, with default records, and sends it to the server. The default records are an `NS` record for each name server, `A` (and `AAAA` with `ipv6`) records for `@`, `www` and each name server inside the domain, and with `mailRecords` a `mail` address record, an `MX` record (priority 10, `mail.`) and the SPF record `v=spf1 a mx ~all`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | The server whose BIND serves the zone. | | `domain` | string | Yes | The domain. A final dot is removed. | | `ipv4` | string | No | Where the domain and `www` point. Defaults to the server's public IPv4 address. | | `ipv6` | string or null | No | An IPv6 address to add `AAAA` records for. | | `nameservers` | string[] | No | 1 to 4 name servers. Defaults to `ns1.` and `ns2.`. | | `mailRecords` | boolean | No | Also add the `mail`, `MX` and SPF records. Default `true`. | | `defaultTtl` | integer | No | 60 to 604800 seconds. Default 3600. | | `soaEmail` | string | No | SOA contact. Default `hostmaster@`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "domain": "example.com" }' ``` **JavaScript** ```js const { zone, job } = await panel.dns.createZone({ serverId: '9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c', domain: 'example.com', }); ``` **Response** `202 Accepted` The new zone (with `records` and `nameservers`) and the `DNS_ZONE_APPLY` job that sends it. ```json { "success": true, "data": { "zone": { "id": "4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f", "domain": "example.com", "status": "creating", "serial": 2026111001, "appliedSerial": null, "pending": true, "applying": true, "recordCount": 9, "records": [ { "id": "…", "name": "@", "fullName": "example.com", "type": "NS", "ttl": null, "value": "ns1.example.com", "priority": null, "weight": null, "port": null, "tag": null } ], "nameservers": [ { "host": "ns1.example.com", "inZone": true, "addresses": ["203.0.113.10"] }, { "host": "ns2.example.com", "inZone": true, "addresses": ["203.0.113.10"] } ] }, "job": { "id": "d3c1b2a0-7e6f-4a5b-8c9d-0e1f2a3b4c5d", "type": "DNS_ZONE_APPLY", "status": "queued", "resource": { "type": "dns_zone", "id": "4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f" } } }, "message": "Adding the zone to the server", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `AGENT_OUTDATED` | The server's agent is too old to serve DNS zones. | | 409 | `DNS_NOT_SET_UP` | BIND is not set up on the server yet. | | 422 | `VALIDATION_ERROR` | Invalid fields, the server does not exist, a zone for the domain already exists, the panel knows no public address for the server and none was given, or the default records would not load. | ## Get a zone `GET /api/v1/dns/zones/:id` — Permission: dns.read — Token scope: read Returns one zone with its `records` and `nameservers`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const zone = await panel.dns.zone('4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f'); ``` **Response** `200 OK`: the [zone object](https://docs.vaultpanel.net/api-reference/dns#the-zone-object) with `records` and `nameservers`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | ## Update a zone `PATCH /api/v1/dns/zones/:id` — Permission: dns.manage — Token scope: manage Changes the zone's default TTL or SOA contact, raises the serial and sends the zone again. Send at least one field. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `defaultTtl` | integer | No | 60 to 604800 seconds. | | `soaEmail` | string | No | SOA contact, such as `hostmaster@example.com`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "defaultTtl": 300 }' ``` **JavaScript** ```js const { zone, job } = await panel.dns.updateZone(zoneId, { defaultTtl: 300 }); ``` **Response** `202 Accepted`: `{ zone, job }`. `job` is `null` when an apply is already on its way: the change is sent right after it. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | | 409 | `DNS_ZONE_DELETING` | The zone is being deleted. | | 422 | `VALIDATION_ERROR` | No field given, or a field is invalid. | ## Delete a zone `DELETE /api/v1/dns/zones/:id` — Permission: dns.manage — Token scope: manage Marks the zone `deleting` and queues a `DNS_ZONE_REMOVE` job that removes it from BIND. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { zone, job } = await panel.dns.removeZone(zoneId); ``` **Response** `202 Accepted`: `{ zone, job }` with the zone in status `deleting`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | | 409 | `DNS_ZONE_DELETING` | The zone is already being deleted (`details.jobId` when known). | ## Apply a zone again `POST /api/v1/dns/zones/:id/apply` — Permission: dns.manage — Token scope: manage Sends the zone to the server again, for example after a failed apply or to put back a zone file someone changed by hand. Clears the last error, and moves a `failed` zone back to `creating`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/apply \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { zone, job } = await panel.dns.apply(zoneId); ``` **Response** `202 Accepted`: `{ zone, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | | 409 | `DNS_ZONE_DELETING` | The zone is being deleted. | | 409 | `DNS_ZONE_BUSY` | An apply is running right now (`details.jobId`). | ## Check name servers in public DNS `POST /api/v1/dns/zones/:id/check` — Permission: dns.read — Token scope: read Asks public DNS which name servers the domain has and compares them with the zone's `@` NS records. The result is saved on the zone as `delegation`. | `delegation.status` | Meaning | | --- | --- | | `ok` | Public DNS lists exactly the zone's name servers. | | `partial` | Some, but not all, of the listed name servers are the zone's. | | `elsewhere` | None of the listed name servers are the zone's. | | `unresolved` | Public DNS has no name servers for the domain (not registered yet, or not published). | | `error` | The lookup failed; try again in a minute. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/check \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { zone, expected } = await panel.dns.check(zoneId); console.log(zone.delegation.status); ``` **Response** `200 OK` ```json { "success": true, "data": { "zone": { "id": "4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f", "domain": "example.com", "delegation": { "status": "elsewhere", "nameservers": ["ns1.registrar-dns.net", "ns2.registrar-dns.net"], "detail": "Public DNS lists ns1.registrar-dns.net, ns2.registrar-dns.net. Set the domain's name servers to ns1.example.com, ns2.example.com at its registrar.", "checkedAt": "2026-11-10T09:30:00.000Z" } }, "expected": ["ns1.example.com", "ns2.example.com"] }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | ## Add a record `POST /api/v1/dns/zones/:id/records` — Permission: dns.manage — Token scope: manage Adds a record, raises the serial and sends the zone. Names may be relative (`www`) or full (`www.example.com`); host names may end with a dot. A zone holds up to 500 records. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Record name, up to 253 characters. `@` for the domain itself. | | `type` | string | Yes | `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `NS`, `SRV` or `CAA`. | | `value` | string | Yes | Address, host name or text (up to 2048 characters). | | `ttl` | integer or null | No | 60 to 604800 seconds; `null` uses the zone's default. | | `priority` | integer or null | No | 0 to 65535. `MX` and `SRV`. | | `weight` | integer or null | No | 0 to 65535. `SRV`. | | `port` | integer or null | No | 0 to 65535. `SRV`. | | `tag` | string or null | No | `CAA`: `issue` (default), `issuewild` or `iodef`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/records \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "blog", "type": "CNAME", "value": "example.com" }' ``` **JavaScript** ```js const { record, zone, job } = await panel.dns.addRecord(zoneId, { name: 'blog', type: 'CNAME', value: 'example.com', }); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "record": { "id": "7a8b9c0d-…", "name": "blog", "fullName": "blog.example.com", "type": "CNAME", "ttl": null, "value": "example.com", "priority": null, "weight": null, "port": null, "tag": null }, "zone": { "id": "4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f", "serial": 2026111003, "pending": true }, "job": { "id": "…", "type": "DNS_ZONE_APPLY", "status": "queued" } }, "message": "Record added", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone with this id. | | 409 | `DNS_ZONE_DELETING` | The zone is being deleted. | | 422 | `VALIDATION_ERROR` | The record is invalid, or the zone with it would not load (for example a `CNAME` next to other records of the same name, or more than 500 records). | ## Update a record `PATCH /api/v1/dns/zones/:id/records/:recordId` — Permission: dns.manage — Token scope: manage Changes any of the record's fields (the same fields as [Add a record](https://docs.vaultpanel.net/api-reference/dns#add-a-record), all optional; send at least one). The result is checked with the rest of the zone before it is saved. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/records/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ttl": 300 }' ``` **JavaScript** ```js const { record } = await panel.dns.updateRecord(zoneId, recordId, { ttl: 300 }); ``` **Response** `202 Accepted`: `{ record, zone, job }`, message `Record saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone, or no record with this id in the zone. | | 409 | `DNS_ZONE_DELETING` | The zone is being deleted. | | 422 | `VALIDATION_ERROR` | No field given, or the changed record or zone is invalid. | ## Delete a record `DELETE /api/v1/dns/zones/:id/records/:recordId` — Permission: dns.manage — Token scope: manage Deletes the record, raises the serial and sends the zone. Refused when the zone would not load without it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/records/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { zone, job } = await panel.dns.removeRecord(zoneId, recordId); ``` **Response** `202 Accepted`: `{ zone, job }`, message `Record deleted`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No zone, or no record with this id in the zone. | | 409 | `DNS_ZONE_DELETING` | The zone is being deleted. | | 422 | `VALIDATION_ERROR` | The zone would be invalid without the record. | ## Set customer name servers `PUT /api/v1/dns/servers/:id/customers` — Permission: dns.manage — Token scope: manage Sets what hosting customers whose account is on this server are told about DNS: the name servers to enter at their registrar, and whether each new customer domain (a registered domain such as `example.com`, not a subdomain) automatically gets a zone on this server. Zones added this way are removed with the account. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `nameservers` | string[] | Yes | Up to 4 host names. An empty list clears them. | | `autoZones` | boolean | Yes | Add a zone for each new customer domain. Needs BIND set up on the server. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/customers \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "nameservers": ["ns1.example.net", "ns2.example.net"], "autoZones": true }' ``` **JavaScript** ```js await panel.request('PUT', `/dns/servers/${serverId}/customers`, { body: { nameservers: ['ns1.example.net', 'ns2.example.net'], autoZones: true }, }); ``` **Response** `200 OK` ```json { "success": true, "data": { "nameservers": ["ns1.example.net", "ns2.example.net"], "autoZones": true }, "message": "Saved", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No server with this id. | | 409 | `SERVER_NOT_READY`, `AGENT_OUTDATED`, `DNS_NOT_SET_UP` | `autoZones` is `true` but the server cannot serve zones. | | 422 | `VALIDATION_ERROR` | More than 4 name servers, or an invalid host name. | ## List DNS providers `GET /api/v1/dns/providers` — Permission: dns.read — Token scope: read Returns every DNS provider account with `certificates`: how many active certificates of live websites renew through it. Secrets are never returned. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/providers \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/dns/providers'); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f", "name": "Cloudflare (main)", "type": "cloudflare", "typeLabel": "Cloudflare", "username": null, "certificates": 2, "createdAt": "2026-10-31T08:00:00.000Z", "updatedAt": "2026-10-31T08:00:00.000Z" } ] }, "message": "OK", "requestId": "…" } ``` ## Add a DNS provider `POST /api/v1/dns/providers` — Permission: dns.manage — Token scope: manage Saves a provider account. The secret is stored encrypted and sent to a server only inside the job that issues a certificate. Using a provider needs agent 0.38.0 or newer on the server that issues the certificate. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 60 letters, digits, spaces and `. _ ( ) -`, starting with a letter or digit. Unique. | | `type` | string | Yes | `cloudflare` or `namecheap`. | | `username` | string | Namecheap | Your Namecheap user name (the API user). Ignored for Cloudflare. | | `secret` | string | Yes | A Cloudflare API token with the **Zone > DNS > Edit** permission, or a Namecheap API key. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/providers \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Cloudflare (main)", "type": "cloudflare", "secret": "'"$CLOUDFLARE_API_TOKEN"'" }' ``` **JavaScript** ```js const { provider } = await panel.request('POST', '/dns/providers', { body: { name: 'Cloudflare (main)', type: 'cloudflare', secret: process.env.CLOUDFLARE_API_TOKEN }, }); ``` **Response** `201 Created`: `{ provider }`, message `DNS provider added`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | A missing or malformed secret, a missing Namecheap user name, or a name another provider has. | ## Get a DNS provider `GET /api/v1/dns/providers/:id` — Permission: dns.read — Token scope: read Returns `{ provider }`, the same object as in the list. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/providers/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { provider } = await panel.request('GET', `/dns/providers/${providerId}`); ``` **Response** `200 OK`: `{ provider }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No provider with this id. | ## Update a DNS provider `PUT /api/v1/dns/providers/:id` — Permission: dns.manage — Token scope: manage Renames the provider or replaces its credentials. Send the same fields as [Add a DNS provider](https://docs.vaultpanel.net/api-reference/dns#add-a-dns-provider): `type` must stay the same, and a blank or missing `secret` keeps the saved one. Servers keep the copy they received until a certificate is issued again. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/providers/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Cloudflare", "type": "cloudflare" }' ``` **JavaScript** ```js await panel.request('PUT', `/dns/providers/${providerId}`, { body: { name: 'Cloudflare', type: 'cloudflare' }, }); ``` **Response** `200 OK`: `{ provider }`, message `DNS provider saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No provider with this id. | | 422 | `VALIDATION_ERROR` | The type changed, a field is invalid, or the name is taken. | ## Delete a DNS provider `DELETE /api/v1/dns/providers/:id` — Permission: dns.manage — Token scope: manage Deletes the provider. Refused while active certificates renew through it: issue them again another way, or turn HTTPS off on those websites, first. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/dns/providers/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('DELETE', `/dns/providers/${providerId}`); ``` **Response** `200 OK`: `data` is `null`, message `DNS provider removed`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No provider with this id. | | 409 | `DNS_PROVIDER_IN_USE` | Certificates renew through it (`details.certificates`). | --- # Email URL: https://docs.vaultpanel.net/api-reference/mail > API reference for email hosting on your servers with Postfix, Dovecot and OpenDKIM - mail servers, spam filtering, email domains, mailboxes, forwarders and webmail updates. Email hosting runs Postfix, Dovecot and OpenDKIM on your servers. Each server that hosts email has one mail server with a host name such as `mail.example.com`. The panel keeps its domains, mailboxes and forwarders: every change raises the mail server's serial and sends the whole set to the agent in a `MAIL_APPLY` job. Mailbox passwords are hashed by the panel (SHA512-CRYPT); only the hash ever reaches the server. `/mail` is for staff: hosting customers are refused with `403 FORBIDDEN`. For the workflow in the panel, see [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/mail/servers` | [List mail servers](https://docs.vaultpanel.net/api-reference/mail#list-mail-servers) | | POST | `/api/v1/mail/servers` | [Set up a mail server](https://docs.vaultpanel.net/api-reference/mail#set-up-a-mail-server) | | POST | `/api/v1/mail/servers/:serverId/apply` | [Apply the settings again](https://docs.vaultpanel.net/api-reference/mail#apply-the-settings-again) | | POST | `/api/v1/mail/servers/:serverId/check` | [Check the host name in public DNS](https://docs.vaultpanel.net/api-reference/mail#check-the-host-name-in-public-dns) | | POST | `/api/v1/mail/servers/:serverId/usage` | [Refresh mailbox sizes](https://docs.vaultpanel.net/api-reference/mail#refresh-mailbox-sizes) | | PUT | `/api/v1/mail/servers/:serverId/spam` | [Set spam filtering](https://docs.vaultpanel.net/api-reference/mail#set-spam-filtering) | | GET | `/api/v1/mail/domains` | [List email domains](https://docs.vaultpanel.net/api-reference/mail#list-email-domains) | | POST | `/api/v1/mail/domains` | [Add an email domain](https://docs.vaultpanel.net/api-reference/mail#add-an-email-domain) | | GET | `/api/v1/mail/domains/:id` | [Get an email domain](https://docs.vaultpanel.net/api-reference/mail#get-an-email-domain) | | DELETE | `/api/v1/mail/domains/:id` | [Remove an email domain](https://docs.vaultpanel.net/api-reference/mail#remove-an-email-domain) | | POST | `/api/v1/mail/domains/:id/dns` | [Add the DNS records to the zone](https://docs.vaultpanel.net/api-reference/mail#add-the-dns-records-to-the-zone) | | POST | `/api/v1/mail/domains/:id/check` | [Check the domain's records in public DNS](https://docs.vaultpanel.net/api-reference/mail#check-the-domains-records-in-public-dns) | | POST | `/api/v1/mail/domains/:id/mailboxes` | [Add a mailbox](https://docs.vaultpanel.net/api-reference/mail#add-a-mailbox) | | PATCH | `/api/v1/mail/domains/:id/mailboxes/:itemId` | [Update a mailbox](https://docs.vaultpanel.net/api-reference/mail#update-a-mailbox) | | DELETE | `/api/v1/mail/domains/:id/mailboxes/:itemId` | [Delete a mailbox](https://docs.vaultpanel.net/api-reference/mail#delete-a-mailbox) | | POST | `/api/v1/mail/domains/:id/forwarders` | [Add a forwarder](https://docs.vaultpanel.net/api-reference/mail#add-a-forwarder) | | PATCH | `/api/v1/mail/domains/:id/forwarders/:itemId` | [Update a forwarder](https://docs.vaultpanel.net/api-reference/mail#update-a-forwarder) | | DELETE | `/api/v1/mail/domains/:id/forwarders/:itemId` | [Delete a forwarder](https://docs.vaultpanel.net/api-reference/mail#delete-a-forwarder) | | POST | `/api/v1/cms/installs/:id/webmail/update` | [Check for or install a webmail update](https://docs.vaultpanel.net/api-reference/mail#check-for-or-install-a-webmail-update) | | PUT | `/api/v1/cms/installs/:id/webmail/auto-update` | [Turn automatic webmail updates on or off](https://docs.vaultpanel.net/api-reference/mail#turn-automatic-webmail-updates-on-or-off) | Changes return `202 Accepted` with the `job` that sends them. `job` is `null` when an apply is already on its way: the change is sent right after it. ## Objects **Mail server** | Field | Type | Description | | --- | --- | --- | | `id`, `serverId` | string | The mail server, and the server it runs on. | | `hostname` | string | The host name mail clients and other mail servers use. | | `status` | string | `setting_up`, `active` or `failed`. | | `tls` | object or null | The certificate the agent reported for the host name. | | `serial`, `appliedSerial`, `appliedAt` | | The settings' serial, the serial the server confirmed and when. | | `pending` | boolean | The server does not have the latest changes yet. | | `applying`, `settingUp` | boolean | A `MAIL_APPLY` or `MAIL_SETUP` job is queued or running. | | `spamFilter` | object | Spam filtering as the server last applied it: `{ enabled, junkScore, rejectScore }`. The scores are `null` until it was first turned on. | | `spamChanging` | boolean | A `MAIL_SPAM` job is queued or running. | | `checks`, `checkedAt` | object | The last [host name check](https://docs.vaultpanel.net/api-reference/mail#check-the-host-name-in-public-dns). | | `lastJobId`, `lastError` | | The last job, and `{ code, message }` of the last failure. | **Email domain**: `id`, `serverId`, `serverName`, `hostname` (its mail server's), `domain`, `status` (`active` or `deleting`), `autoDns` (records are kept in the panel's DNS zone), `dkimSelector` (`vaultpanel`), `dkimReady` (the server made the DKIM key), `mailboxCount`, `forwarderCount`, `createdAt`. A single domain also has `mailboxes`, `forwarders`, `mailServer`, `client` (the settings for mail apps) and `dns` (the records it needs, each with a `state` of `ok`, `different`, `missing` or `no_zone`, and `dkimPending`). **Mailbox**: `id`, `domainId`, `localPart`, `address`, `displayName`, `quotaMb`, `enabled`, `usedBytes` and `usageCheckedAt` (from the last [size refresh](https://docs.vaultpanel.net/api-reference/mail#refresh-mailbox-sizes)), `createdAt`, `updatedAt`. **Forwarder**: `id`, `domainId`, `localPart`, `address`, `destinations`, `createdAt`, `updatedAt`. ## List mail servers `GET /api/v1/mail/servers` — Permission: mail.read — Token scope: read Returns every server with its mail server, if it has one: `serverId`, `serverName`, `serverStatus`, `agent` (what the agent reports about mail software, `null` when the agent is too old to host email), `addresses` (`{ ipv4, ipv6 }`), `suggestedHostname`, `domainCount` and `mailServer`. `webmail` lists the Roundcube installs from the app installer, oldest first, each with `id` (the installed app's id), `url`, `status`, `websiteId`, `websiteName`, `serverId`, `version`, `latestVersion`, `updateAvailable`, `updateCheckedAt`, `autoUpdate`, `lastError`, `lastJobId` and `updating` (a check or update is queued or running). See [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.mail.servers(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "serverStatus": "online", "addresses": { "ipv4": "203.0.113.10", "ipv6": null }, "suggestedHostname": "web-1.example.com", "domainCount": 1, "mailServer": { "id": "61f0a2b3-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "hostname": "mail.example.com", "status": "active", "serial": 12, "appliedSerial": 12, "pending": false, "applying": false, "settingUp": false, "spamFilter": { "enabled": true, "junkScore": 6, "rejectScore": 15 }, "spamChanging": false, "lastError": null } } ], "webmail": [ { "id": "3c9d1e7f-…", "url": "https://webmail.example.com", "status": "installed", "websiteId": "7a2b4c6d-…", "websiteName": "webmail", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "version": "1.6.9", "latestVersion": "1.6.10", "updateAvailable": true, "updateCheckedAt": "2026-11-10T03:00:00.000Z", "autoUpdate": false, "lastError": null, "lastJobId": "…", "updating": false } ] }, "message": "OK", "requestId": "…" } ``` ## Set up a mail server `POST /api/v1/mail/servers` — Permission: mail.manage — Token scope: manage Installs and configures the mail software on a server (a `MAIL_SETUP` job), or sets it up again with a new host name. When the panel runs the DNS zone for the host name and the zone has no address for it yet, an `A` (and `AAAA`) record for the server is added. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | The server. | | `hostname` | string | Yes | The mail host name, such as `mail.example.com`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "hostname": "mail.example.com" }' ``` **JavaScript** ```js const { mailServer, job } = await panel.mail.setupServer({ serverId: '9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c', hostname: 'mail.example.com', }); ``` **Response** `202 Accepted`: `{ mailServer, job }`, message `Setting up the mail server`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SERVER_NOT_READY` | The server has no connected agent yet. | | 409 | `AGENT_OUTDATED` | The server's agent is too old to host email. | | 409 | `MAIL_BUSY` | A set-up is already running (`details.jobId`). | | 422 | `VALIDATION_ERROR` | Invalid host name, or the server does not exist. | ## Apply the settings again `POST /api/v1/mail/servers/:serverId/apply` — Permission: mail.manage — Token scope: manage Sends every domain, mailbox and forwarder of the server again, for example after a failure or to put back files someone changed by hand. Clears the last error. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/apply \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('POST', `/mail/servers/${serverId}/apply`); ``` **Response** `202 Accepted`: `{ mailServer, job }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MAIL_NOT_SET_UP` | The server has no mail server set up. | | 409 | `MAIL_BUSY` | A set-up or apply is running (`details.jobId`). | ## Check the host name in public DNS `POST /api/v1/mail/servers/:serverId/check` — Permission: mail.read — Token scope: read Asks public DNS whether the host name points at the server (`forward`) and whether the server's IPv4 address points back at the host name (`reverse`, which many receiving servers check). The result is saved as the mail server's `checks`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/check \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { mailServer } = await panel.request('POST', `/mail/servers/${serverId}/check`); ``` **Response** `200 OK` ```json { "success": true, "data": { "mailServer": { "hostname": "mail.example.com", "checks": { "hostname": "mail.example.com", "address": "203.0.113.10", "forward": { "ok": true, "found": ["203.0.113.10"] }, "reverse": { "ok": false, "found": ["203-0-113-10.provider.example"] } }, "checkedAt": "2026-11-10T10:00:00.000Z" } }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MAIL_NOT_SET_UP` | The server has no mail server set up. | ## Refresh mailbox sizes `POST /api/v1/mail/servers/:serverId/usage` — Permission: mail.read — Token scope: read Queues a `MAIL_USAGE` job that asks the server how much mail each mailbox holds. When it finishes, each mailbox's `usedBytes` and `usageCheckedAt` are updated. If the same job is already running, its id is returned. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/usage \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.request('POST', `/mail/servers/${serverId}/usage`); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: `{ job }`, message `Checking mailbox sizes`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MAIL_NOT_SET_UP` | The server has no mail server set up. | ## Set spam filtering `PUT /api/v1/mail/servers/:serverId/spam` — Permission: mail.manage — Token scope: manage Turns spam filtering on or off on a mail server (a `MAIL_SPAM` job, agent 0.45.0 or newer). When it is on, Rspamd checks every incoming message: at or above the junk score it goes to the mailbox's `Junk` folder, at or above the reject score the mail server refuses it. Turning it on installs Rspamd and the Dovecot Sieve plugin when needed; turning it off stops Rspamd. The mail server's `spamFilter` changes once the job succeeds. See [Spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | On or off. | | `junkScore` | integer | No | 1 to 50. Keeps the current value when left out, else 6. | | `rejectScore` | integer | No | 5 to 100, higher than `junkScore`. Keeps the current value when left out, else 15. | No other fields are accepted. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/servers/9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c/spam \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "junkScore": 6, "rejectScore": 15 }' ``` **JavaScript** ```js const { mailServer, job } = await panel.request('PUT', `/mail/servers/${serverId}/spam`, { body: { enabled: true, junkScore: 6, rejectScore: 15 }, }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: `{ mailServer, job }`, message `Turning spam filtering on` or `Turning spam filtering off`. The job's output is `{ spam: { enabled, junkScore, rejectScore, on } }`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `MAIL_NOT_SET_UP` | The server has no mail server set up. | | 409 | `MAIL_BUSY` | A set-up or spam filter change is running (`details.jobId`). | | 409 | `AGENT_OUTDATED` | The server's agent is older than 0.45.0. | | 422 | `VALIDATION_ERROR` | A score out of range, `rejectScore` not higher than `junkScore`, or an unknown field. | ## List email domains `GET /api/v1/mail/domains` — Permission: mail.read — Token scope: read Returns email domains a page at a time, with their mailbox and forwarder counts. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Part of the domain, up to 100 characters. | | `serverId` | string (UUID) | No | Only domains on this server. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `domain` (default) or `createdAt`; `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/mail/domains?serverId=9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.mail.domains({ serverId }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "a1b2c3d4-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "hostname": "mail.example.com", "domain": "example.com", "status": "active", "autoDns": true, "dkimSelector": "vaultpanel", "dkimReady": true, "mailboxCount": 3, "forwarderCount": 1, "createdAt": "2026-11-01T12:00:00.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` ## Add an email domain `POST /api/v1/mail/domains` — Permission: mail.manage — Token scope: manage Adds a domain to a server's mail server. With `addDnsRecords` (the default), the panel puts the `MX`, SPF and DMARC records into its DNS zone for the domain, replacing an existing `MX` and SPF record, and adds the DKIM record once the server has made the key. A server hosts email for up to 200 domains. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | A server with a mail server set up. | | `domain` | string | Yes | The email domain, such as `example.com`. | | `addDnsRecords` | boolean | No | Add the records to the panel's DNS zone for the domain. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "domain": "example.com" }' ``` **JavaScript** ```js const { domain, job, dnsZone } = await panel.mail.createDomain({ serverId: '9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c', domain: 'example.com', }); ``` **Response** `202 Accepted`: `{ domain, job, dnsZone }`. `dnsZone` is `{ id, domain, added }` when records went into a panel zone, otherwise `null`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `SERVER_NOT_READY`, `AGENT_OUTDATED` | The server cannot host email. | | 409 | `MAIL_NOT_SET_UP` | The server has no mail server set up. | | 422 | `VALIDATION_ERROR` | The domain already has email in the panel, the server already has 200 domains, or a field is invalid. | ## Get an email domain `GET /api/v1/mail/domains/:id` — Permission: mail.read — Token scope: read Returns the domain with its mailboxes, forwarders, mail server, mail app settings and the DNS records it needs. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const domain = await panel.mail.domain(domainId); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "domain": "example.com", "hostname": "mail.example.com", "status": "active", "dkimReady": true, "mailboxes": [ { "id": "…", "localPart": "hello", "address": "hello@example.com", "displayName": "Hello", "quotaMb": 1024, "enabled": true, "usedBytes": 5242880, "usageCheckedAt": "2026-11-10T10:05:00.000Z" } ], "forwarders": [ { "id": "…", "localPart": "sales", "address": "sales@example.com", "destinations": ["team@example.org"] } ], "client": { "hostname": "mail.example.com", "incoming": [ { "protocol": "IMAP", "port": 993, "security": "SSL/TLS" }, { "protocol": "POP3", "port": 995, "security": "SSL/TLS" } ], "outgoing": [ { "protocol": "SMTP", "port": 587, "security": "STARTTLS" }, { "protocol": "SMTP", "port": 465, "security": "SSL/TLS" } ], "username": "The full email address" }, "dns": { "zone": { "id": "4f0c2a8e-…", "domain": "example.com" }, "records": [ { "name": "@", "type": "MX", "value": "mail.example.com", "priority": 10, "purpose": "mx", "state": "ok" }, { "name": "@", "type": "TXT", "value": "v=spf1 mx ~all", "purpose": "spf", "state": "ok" }, { "name": "_dmarc", "type": "TXT", "value": "v=DMARC1; p=none", "purpose": "dmarc", "state": "ok" } ], "dkimPending": false } }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No email domain with this id. | ## Remove an email domain `DELETE /api/v1/mail/domains/:id` — Permission: mail.manage — Token scope: manage Marks the domain `deleting` and sends the change. By default the domain's stored mail is deleted from the server too. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `deleteMail` | `true` or `false` | No | Delete the stored mail. Default `true`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d?deleteMail=false" \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.mail.removeDomain(domainId, { deleteMail: 'false' }); ``` **Response** `202 Accepted`: `{ domain, job }`, message `Removing the domain`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No email domain with this id. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is already being removed. | ## Add the DNS records to the zone `POST /api/v1/mail/domains/:id/dns` — Permission: mail.manage, dns.manage — Token scope: manage Puts the domain's `MX`, SPF, DKIM (when ready) and DMARC records into the panel's DNS zone for the domain now, replacing an existing `MX` record and SPF, DKIM or DMARC record of the same kind, and turns `autoDns` on. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/dns \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { dnsZone } = await panel.request('POST', `/mail/domains/${domainId}/dns`); ``` **Response** `202 Accepted`: `{ domain, dnsZone: { id, domain, added, removed }, job }`, message `Records added to the DNS zone`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No email domain with this id. | | 409 | `NO_DNS_ZONE` | The panel does not run DNS for the domain: add the records where its DNS is hosted. | ## Check the domain's records in public DNS `POST /api/v1/mail/domains/:id/check` — Permission: mail.read — Token scope: read Looks up each record the domain needs in public DNS. Each record gets `public: { found, state }` with `state` `ok`, `different`, `missing` or `error`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/check \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { records } = await panel.mail.checkDns(domainId); ``` **Response** `200 OK` ```json { "success": true, "data": { "records": [ { "name": "@", "type": "MX", "value": "mail.example.com", "priority": 10, "purpose": "mx", "public": { "found": ["mail.example.com"], "state": "ok" } }, { "name": "_dmarc", "type": "TXT", "value": "v=DMARC1; p=none", "purpose": "dmarc", "public": { "found": [], "state": "missing" } } ], "checkedAt": "2026-11-10T10:10:00.000Z" }, "message": "OK", "requestId": "…" } ``` ## Add a mailbox `POST /api/v1/mail/domains/:id/mailboxes` — Permission: mail.manage — Token scope: manage Adds a mailbox. When no password is given, the panel generates one and returns it in this response only. A server holds up to 2000 mailboxes. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `localPart` | string | Yes | The part before `@`. Must not be an existing mailbox or forwarder. | | `password` | string | No | 10 to 128 characters, one line. Generated when left out. | | `displayName` | string or null | No | Up to 100 characters. | | `quotaMb` | integer | No | 0 to 1048576. Default 1024. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/mailboxes \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "localPart": "hello", "displayName": "Hello", "quotaMb": 2048 }' ``` **JavaScript** ```js const { mailbox, password } = await panel.mail.createMailbox(domainId, { localPart: 'hello', displayName: 'Hello', quotaMb: 2048, }); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "mailbox": { "id": "…", "localPart": "hello", "address": "hello@example.com", "displayName": "Hello", "quotaMb": 2048, "enabled": true, "usedBytes": null }, "password": "kq3T9vX2mPz7Lw4Rb8Ns", "domain": { "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "domain": "example.com" }, "job": { "id": "…", "type": "MAIL_APPLY", "status": "queued" } }, "message": "Mailbox added", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No email domain with this id. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | | 422 | `VALIDATION_ERROR` | The address is already a mailbox or forwarder, the server has 2000 mailboxes, or a field is invalid. | ## Update a mailbox `PATCH /api/v1/mail/domains/:id/mailboxes/:itemId` — Permission: mail.manage — Token scope: manage Changes a mailbox. Send at least one field. Use either `password` or `generatePassword`, not both; a generated password is returned in this response only. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | No | A new password, 10 to 128 characters. | | `generatePassword` | boolean | No | Generate a new password. | | `displayName` | string or null | No | Up to 100 characters. | | `quotaMb` | integer | No | 0 to 1048576. | | `enabled` | boolean | No | `false` turns the mailbox off. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/mailboxes/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9 \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "generatePassword": true }' ``` **JavaScript** ```js const { password } = await panel.mail.updateMailbox(domainId, mailboxId, { generatePassword: true }); ``` **Response** `202 Accepted`: `{ mailbox, password, domain, job }`; `password` only with `generatePassword`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such domain or mailbox. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | | 422 | `VALIDATION_ERROR` | No field given, both `password` and `generatePassword`, or a field is invalid. | ## Delete a mailbox `DELETE /api/v1/mail/domains/:id/mailboxes/:itemId` — Permission: mail.manage — Token scope: manage Deletes the mailbox. By default its stored mail is deleted from the server too. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `deleteMail` | `true` or `false` | No | Delete the stored mail. Default `true`. | **Example request** **cURL** ```bash curl -X DELETE \ https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/mailboxes/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9 \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.mail.removeMailbox(domainId, mailboxId); ``` **Response** `202 Accepted`: `{ domain, job }`, message `Mailbox deleted`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such domain or mailbox. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | ## Add a forwarder `POST /api/v1/mail/domains/:id/forwarders` — Permission: mail.manage — Token scope: manage Adds an address that forwards mail to other addresses. A server holds up to 2000 forwarders. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `localPart` | string | Yes | The part before `@`. Must not be an existing mailbox or forwarder. | | `destinations` | string[] | Yes | 1 to 20 email addresses. Duplicates are dropped; the forwarder's own address is refused. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/forwarders \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "localPart": "sales", "destinations": ["team@example.org"] }' ``` **JavaScript** ```js const { forwarder } = await panel.mail.createForwarder(domainId, { localPart: 'sales', destinations: ['team@example.org'], }); ``` **Response** `202 Accepted`: `{ forwarder, domain, job }`, message `Forwarder added`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No email domain with this id. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | | 422 | `VALIDATION_ERROR` | The address is taken, a destination is invalid or is the forwarder itself, or the server has 2000 forwarders. | ## Update a forwarder `PATCH /api/v1/mail/domains/:id/forwarders/:itemId` — Permission: mail.manage — Token scope: manage Replaces the forwarder's destinations. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `destinations` | string[] | Yes | 1 to 20 email addresses. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/forwarders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "destinations": ["team@example.org", "boss@example.org"] }' ``` **JavaScript** ```js await panel.request('PATCH', `/mail/domains/${domainId}/forwarders/${forwarderId}`, { body: { destinations: ['team@example.org', 'boss@example.org'] }, }); ``` **Response** `202 Accepted`: `{ forwarder, domain, job }`, message `Forwarder saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such domain or forwarder. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | | 422 | `VALIDATION_ERROR` | A destination is invalid or is the forwarder itself. | ## Delete a forwarder `DELETE /api/v1/mail/domains/:id/forwarders/:itemId` — Permission: mail.manage — Token scope: manage Deletes the forwarder. **Example request** **cURL** ```bash curl -X DELETE \ https://panel.example.com/api/v1/mail/domains/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/forwarders/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.mail.removeForwarder(domainId, forwarderId); ``` **Response** `202 Accepted`: `{ domain, job }`, message `Forwarder deleted`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such domain or forwarder. | | 409 | `MAIL_DOMAIN_DELETING` | The domain is being removed. | ## Check for or install a webmail update `POST /api/v1/cms/installs/:id/webmail/update` — Permission: websites.manage — Token scope: manage Checks a Roundcube from the app installer for a newer stable release, or updates it (a `WEBMAIL_UPDATE` job, agent 0.46.0 or newer). `:id` is the installed app's id, as in the `webmail` list of [List mail servers](https://docs.vaultpanel.net/api-reference/mail#list-mail-servers). An update downloads the newest release from GitHub, checks it against its SHA-256, copies it over the old one with Roundcube's `bin/installto.sh` (settings, logs and data kept) and updates its tables. It never goes to an older version: when the installed one is already the newest, the job only reports the versions. The panel also checks every Roundcube about once a day by itself. See [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail#updates). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `check` | boolean | No | `true` only checks for a newer release. Default `false`: update. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cms/installs/3c9d1e7f-2a4b-4c6d-8e0f-1a2b3c4d5e6f/webmail/update \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "check": false }' ``` **JavaScript** ```js const { install, job } = await panel.request('POST', `/cms/installs/${installId}/webmail/update`, { body: { check: false }, }); ``` **Response** `202 Accepted`: `{ install, job }`, message `Updating Roundcube` or `Checking for a newer Roundcube`. The job's output is `{ installed, previous, latest, updateAvailable, updated }`; when it finishes, the install's `version`, `latestVersion` and `updateCheckedAt` follow it. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No installed app with this id. | | 409 | `NOT_WEBMAIL` | The installed app is not Roundcube. | | 409 | `CMS_BUSY` | Roundcube is not installed yet, or is being removed. | | 409 | `WEBSITE_NOT_PHP` | The website is no longer a PHP site. | | 409 | `AGENT_OUTDATED` | The server's agent is older than 0.46.0. | ## Turn automatic webmail updates on or off `PUT /api/v1/cms/installs/:id/webmail/auto-update` — Permission: websites.manage — Token scope: manage With `autoUpdate` on, the panel's daily check updates this Roundcube when it finds a newer release, instead of only reporting it. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `autoUpdate` | boolean | Yes | Update automatically. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cms/installs/3c9d1e7f-2a4b-4c6d-8e0f-1a2b3c4d5e6f/webmail/auto-update \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "autoUpdate": true }' ``` **JavaScript** ```js const { install } = await panel.request('PUT', `/cms/installs/${installId}/webmail/auto-update`, { body: { autoUpdate: true }, }); ``` **Response** `200 OK`: `{ install }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No installed app with this id. | | 409 | `NOT_WEBMAIL` | The installed app is not Roundcube. | --- # Backups URL: https://docs.vaultpanel.net/api-reference/backups > API reference for backing up websites, apps and databases, restoring and downloading backups, backup schedules, and S3 or SFTP backup storage. A backup is a copy of a website's files, an app's live release or a database dump, written by the server's agent. It stays on the server (in `/var/backups/vaultpanel`, readable by root only), and can also be copied to an S3-compatible bucket or another server over SFTP. Backups, restores and downloads are agent jobs tied to the backup. Hosting customers reach `/backups` and `/backup-schedules` for what their own account owns (anything else is `404`); `/backup-storage` is for staff. For the workflow, see [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups) and [Backup storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/backups` | [List backups](https://docs.vaultpanel.net/api-reference/backups#list-backups) | | POST | `/api/v1/backups` | [Back up now](https://docs.vaultpanel.net/api-reference/backups#back-up-now) | | GET | `/api/v1/backups/:id` | [Get a backup](https://docs.vaultpanel.net/api-reference/backups#get-a-backup) | | DELETE | `/api/v1/backups/:id` | [Delete a backup](https://docs.vaultpanel.net/api-reference/backups#delete-a-backup) | | POST | `/api/v1/backups/:id/restore` | [Restore a backup](https://docs.vaultpanel.net/api-reference/backups#restore-a-backup) | | POST | `/api/v1/backups/:id/download` | [Prepare a download](https://docs.vaultpanel.net/api-reference/backups#prepare-a-download) | | GET | `/api/v1/backups/:id/download` | [Download a backup](https://docs.vaultpanel.net/api-reference/backups#download-a-backup) | | GET | `/api/v1/backup-schedules` | [List schedules](https://docs.vaultpanel.net/api-reference/backups#list-schedules) | | PUT | `/api/v1/backup-schedules` | [Save a schedule](https://docs.vaultpanel.net/api-reference/backups#save-a-schedule) | | DELETE | `/api/v1/backup-schedules/:id` | [Delete a schedule](https://docs.vaultpanel.net/api-reference/backups#delete-a-schedule) | | GET | `/api/v1/backup-storage` | [List storage](https://docs.vaultpanel.net/api-reference/backups#list-storage) | | POST | `/api/v1/backup-storage` | [Add storage](https://docs.vaultpanel.net/api-reference/backups#add-storage) | | GET | `/api/v1/backup-storage/:id` | [Get storage](https://docs.vaultpanel.net/api-reference/backups#get-storage) | | PUT | `/api/v1/backup-storage/:id` | [Update storage](https://docs.vaultpanel.net/api-reference/backups#update-storage) | | DELETE | `/api/v1/backup-storage/:id` | [Delete storage](https://docs.vaultpanel.net/api-reference/backups#delete-storage) | | POST | `/api/v1/backup-storage/:id/test` | [Check storage](https://docs.vaultpanel.net/api-reference/backups#check-storage) | ## The backup object | Field | Type | Description | | --- | --- | --- | | `id`, `serverId`, `serverName` | string | The backup and its server. | | `resource` | object | `{ type, id, name, exists }`: `website`, `application` or `database`. `exists` is `false` once it was deleted. | | `status` | string | `creating`, `completed`, `failed`, `deleting` or `missing` (the file was removed by hand). | | `trigger` | string | `manual`, `schedule` or `pre_restore` (the safety copy taken before a restore). | | `scheduleId` | string or null | The schedule that made it. | | `filePath` | string or null | Where it is on the server. | | `localCopy` | boolean | `false` when it is kept only in its storage. | | `storage` | object or null | `{ id, name, key, stored, error }` when it is copied to a storage. | | `sizeBytes`, `sha256` | | Size and checksum, once completed. | | `jobId` | string | The job that made it. | | `error` | object or null | `{ code, message }` when it failed. | | `completedAt`, `lastRestoredAt` | string or null | Timestamps. | | `download` | object | `{ ready, until, jobId }`: a copy prepared on the panel for downloading. | | `createdBy` | object or null | `{ id, email }`. | ## List backups `GET /api/v1/backups` — Permission: backups.read — Token scope: read Returns backups a page at a time, newest first. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | No | Only backups on this server. | | `resourceType`, `resourceId` | string | No | Only backups of this website, app or database. | | `includeDatabases` | boolean | No | With a website or app, also list the backups of the databases linked to it. | | `status` | string | No | A backup status. | | `trigger` | string | No | `manual`, `schedule` or `pre_restore`. | | `storageId` | string (UUID) | No | Only backups copied to this storage. | | `search` | string | No | Part of the website, app or database name. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `createdAt` (default) or `size`; `desc` (default) or `asc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/backups?resourceType=website&resourceId=1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d&includeDatabases=true" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.backups.list({ resourceType: 'website', resourceId: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', includeDatabases: true, }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "f0e1d2c3-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "resource": { "type": "website", "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "name": "example-com", "exists": true }, "status": "completed", "trigger": "schedule", "scheduleId": "5a6b7c8d-…", "filePath": "/var/backups/vaultpanel/site/example-com/f0e1d2c3-….tar.gz", "localCopy": true, "storage": null, "sizeBytes": 48234496, "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "jobId": "…", "error": null, "completedAt": "2026-11-10T03:00:41.000Z", "lastRestoredAt": null, "download": { "ready": false, "until": null, "jobId": null }, "createdBy": null } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` ## Back up now `POST /api/v1/backups` — Permission: backups.create — Token scope: manage Starts a backup (`CREATE_BACKUP`). A website backup holds every file in the site's folder; an app backup the live release, shared files, `.env` and deploy key; a database backup a compressed SQL dump of the whole database. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `resourceType` | string | Yes | `website`, `application` or `database`. | | `resourceId` | string (UUID) | Yes | Its id. | | `storageId` | string (UUID) or null | No | Also copy the backup to this storage. Default `null` (on the server only). Not available to hosting customers. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backups \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "resourceType": "database", "resourceId": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b" }' ``` **JavaScript** ```js const { backup, job } = await panel.backups.create({ resourceType: 'database', resourceId: '7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b', }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: `{ backup, job }` with the backup in status `creating`, message `Backing up`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | A hosting customer asked for a storage. | | 404 | `NOT_FOUND` | No such website, app or database, or not yours. | | 409 | `BACKUP_RUNNING` | A backup of it is already running (`details.jobId`). | | 409 | `RESOURCE_NOT_READY` | The website, app or database is not ready (still being created, or failed). | | 409 | `STORAGE_NOT_CHECKED` | An SFTP storage was never checked, so its host key is unknown. | | 409 | `AGENT_OUTDATED` | Copying to storage needs agent 0.13.0 or newer. | | 422 | `VALIDATION_ERROR` | The storage no longer exists, or a field is invalid. | ## Get a backup `GET /api/v1/backups/:id` — Permission: backups.read — Token scope: read Returns the backup with its last 20 `restores`: `{ id, backupId, jobId, safetyBackupId, status, error, requestedBy, createdAt, finishedAt }`, `status` being `running`, `succeeded` or `failed`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backups/f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const backup = await panel.backups.get(backupId); ``` **Response** `200 OK`: the [backup object](https://docs.vaultpanel.net/api-reference/backups#the-backup-object) with `restores`. ## Delete a backup `DELETE /api/v1/backups/:id` — Permission: backups.manage — Token scope: manage Deletes a completed backup's file on the server, and its copy in storage, with a `DELETE_BACKUP` job. Failed and missing backups have no file and are removed at once (`job` is `null`). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backups/f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.backups.remove(backupId); ``` **Response** `202 Accepted`: `{ job }`, message `Deleting the backup`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No backup with this id. | | 409 | `BACKUP_BUSY` | The backup is still being written, deleted or restored. | ## Restore a backup `POST /api/v1/backups/:id/restore` — Permission: backups.manage — Token scope: manage Puts a completed backup back in place of the current files or data (`RESTORE_BACKUP`). By default the current state is backed up first, so the restore can be undone. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `safetyBackup` | boolean | No | Back up the current state first. Default `true`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backups/f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f/restore \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "safetyBackup": true }' ``` **JavaScript** ```js const { restore, job } = await panel.backups.restore(backupId, { safetyBackup: true }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted` ```json { "success": true, "data": { "restore": { "id": "2b3c4d5e-…", "backupId": "f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f", "jobId": "…", "safetyBackupId": "6c7d8e9f-…", "status": "running", "error": null, "requestedBy": null, "createdAt": "2026-11-10T11:00:00.000Z", "finishedAt": null }, "job": { "id": "…", "type": "RESTORE_BACKUP", "status": "queued" } }, "message": "Restoring", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No backup with this id. | | 409 | `BACKUP_NOT_RESTORABLE` | The backup is not completed. | | 409 | `RESOURCE_DELETED` | The website, app or database was deleted; download the backup instead. | | 409 | `RESOURCE_NOT_READY` | The website, app or database is not ready. | | 409 | `RESTORE_RUNNING` | A restore of the same website, app or database is running. | ## Prepare a download `POST /api/v1/backups/:id/download` — Permission: backups.manage — Token scope: manage Downloads go through the panel: this copies the backup from the server to the panel (`UPLOAD_BACKUP`), where it is kept for 6 hours. When a copy is already there, it answers `200` with `ready: true`; otherwise `202` with the job to wait for (or the job already copying it). Backups larger than `VAULTPANEL_BACKUP_DOWNLOAD_MAX_MB` (10240 MB by default) cannot be downloaded through the panel. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backups/f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f/download \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const prepared = await panel.request('POST', `/backups/${backupId}/download`); if (!prepared.ready) await panel.jobs.wait(prepared.job.id); ``` **Response** `202 Accepted`, message `Copying the backup to the panel` ```json { "success": true, "data": { "ready": false, "job": { "id": "…", "type": "UPLOAD_BACKUP", "status": "queued" } }, "message": "Copying the backup to the panel", "requestId": "…" } ``` or `200 OK` with `{ "ready": true, "backup": { … } }`, message `Ready to download`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `BACKUP_NOT_READY` | The backup is not completed. | | 409 | `BACKUP_TOO_LARGE` | Larger than the panel accepts; the message says where to copy it from instead. | ## Download a backup `GET /api/v1/backups/:id/download` — Permission: backups.manage — Token scope: manage Sends the prepared copy as a file (`Cache-Control: no-store`), named after the website, app or database and the time: a `.tar.gz` for websites and apps, `.sql.gz` for databases. Each download is recorded in the audit log. **Example request** **cURL** ```bash curl -OJ https://panel.example.com/api/v1/backups/f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f/download \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js import { writeFile } from 'node:fs/promises'; const res = await fetch(`https://panel.example.com/api/v1/backups/${backupId}/download`, { headers: { Authorization: `Bearer ${process.env.VAULTPANEL_TOKEN}` }, }); if (!res.ok) throw new Error(`Download failed: ${res.status}`); await writeFile('backup.tar.gz', Buffer.from(await res.arrayBuffer())); ``` **Response** `200 OK`: the file. Errors use the usual JSON envelope. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `DOWNLOAD_NOT_READY` | No prepared copy, or it expired: [prepare the download](https://docs.vaultpanel.net/api-reference/backups#prepare-a-download) again. | ## List schedules `GET /api/v1/backup-schedules` — Permission: backups.read — Token scope: read Returns backup schedules a page at a time, next to run first. Each website, app or database has at most one. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | No | Only schedules on this server. | | `resourceType`, `resourceId` | string | No | The schedule of this website, app or database. | | `includeDatabases` | boolean | No | With a website or app, also the schedules of its linked databases. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `nextRunAt` (default) or `createdAt`; `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-schedules \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.backups.schedules.list(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "5a6b7c8d-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "resource": { "type": "website", "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "name": "example-com" }, "schedule": "0 3 * * *", "description": "Every day at 03:00", "timezone": "Europe/Berlin", "keepCount": 7, "storage": null, "lastStorageError": null, "enabled": true, "nextRunAt": "2026-11-11T02:00:00.000Z", "lastRunAt": "2026-11-10T02:00:00.000Z", "lastBackupId": "f0e1d2c3-…", "lastBackupStatus": "completed", "createdAt": "2026-10-20T09:00:00.000Z", "updatedAt": "2026-10-20T09:00:00.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` ## Save a schedule `PUT /api/v1/backup-schedules` — Permission: backups.manage — Token scope: manage Creates the schedule of a website, app or database, or replaces it. After each scheduled backup, the oldest scheduled backups beyond `keepCount` are deleted. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `resourceType` | string | Yes | `website`, `application` or `database`. | | `resourceId` | string (UUID) | Yes | Its id. | | `schedule` | string | Yes | A five-field cron expression, such as `0 3 * * *`. | | `timezone` | string | No | An IANA time zone. Default `UTC`. | | `keepCount` | integer | No | 1 to 100 scheduled backups kept. Default 7. | | `enabled` | boolean | No | Default `true`. | | `storageId` | string (UUID) or null | No | Also copy each backup to this storage. Hosting customers keep the destination staff chose. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-schedules \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "resourceType": "website", "resourceId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "schedule": "0 3 * * *", "timezone": "Europe/Berlin", "keepCount": 7 }' ``` **JavaScript** ```js const { schedule } = await panel.backups.schedules.save({ resourceType: 'website', resourceId: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', schedule: '0 3 * * *', timezone: 'Europe/Berlin', keepCount: 7, }); ``` **Response** `200 OK`: `{ schedule }`, message `Schedule saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such website, app or database, or not yours. | | 409 | `STORAGE_NOT_CHECKED`, `AGENT_OUTDATED` | The storage cannot be used from this server yet. | | 422 | `VALIDATION_ERROR` | An invalid cron expression or time zone, or another invalid field. | ## Delete a schedule `DELETE /api/v1/backup-schedules/:id` — Permission: backups.manage — Token scope: manage Deletes the schedule. Backups it made are kept. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-schedules/5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.backups.schedules.remove(scheduleId); ``` **Response** `200 OK`: `data` is `null`, message `Schedule removed`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No schedule with this id. | ## The storage object | Field | Type | Description | | --- | --- | --- | | `id`, `name` | string | The storage. | | `type` | string | `s3` or `sftp`. | | `provider`, `providerLabel` | string | `aws`, `b2`, `wasabi`, `r2` or `other`, or `sftp`. | | `endpoint`, `region`, `bucket`, `prefix`, `pathStyle`, `accessKeyId` | | S3 connection. The secret key is never returned. | | `host`, `port`, `username`, `path` | | SFTP connection. | | `publicKey` | string | SFTP: the key pair the panel made; add this public key to the backup user's `authorized_keys`. | | `hostKeyFingerprint` | string or null | SFTP: the backup server's host key, pinned at the first check. | | `keepLocal` | boolean | Also keep each backup on its server. | | `insecure` | boolean | The S3 endpoint uses plain `http://`. | | `test` | object or null | The last check: `{ status, message, jobId, testedAt }`. | | `usage` | object | `{ backups, bytes, schedules }` kept in or using it. | ## List storage `GET /api/v1/backup-storage` — Permission: backups.read — Token scope: read Returns every storage with its `usage`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.backups.storage.list(); ``` **Response** `200 OK`: `{ items }` of [storage objects](https://docs.vaultpanel.net/api-reference/backups#the-storage-object). ## Add storage `POST /api/v1/backup-storage` — Permission: settings.manage — Token scope: full Adds an S3-compatible bucket or an SFTP server. For SFTP, the panel makes a key pair and returns its `publicKey`; nothing secret is sent. **Request body (S3)** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | No | `s3` (default). | | `name` | string | Yes | Up to 100 characters, unique. | | `provider` | string | No | `aws`, `b2`, `wasabi`, `r2` or `other` (default). | | `endpoint` | string | Depends | The service's address, such as `https://s3.us-east-1.amazonaws.com`: no folder or bucket in it. May be blank for providers whose address follows from the region. | | `region` | string | Yes | Such as `us-east-1` (`auto` for R2). | | `bucket` | string | Yes | 3 to 63 letters, digits, dots and hyphens. | | `prefix` | string | No | A folder inside the bucket. Default `vaultpanel`. | | `pathStyle` | boolean | No | Path-style addressing (MinIO, R2). Default `false`. | | `accessKeyId` | string | Yes | The access key ID. | | `secretAccessKey` | string | Yes | The secret key. | | `keepLocal` | boolean | No | Also keep each backup on its server. Default `false`. | **Request body (SFTP)** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | Yes | `sftp`. | | `name` | string | Yes | Up to 100 characters, unique. | | `host` | string | Yes | Host name or IP address. | | `port` | integer | No | Default 22. | | `username` | string | Yes | A user made for backups on that server, not `root`. | | `path` | string | No | A folder in the user's home, or an absolute one; created when needed. Default `vaultpanel-backups`. | | `keepLocal` | boolean | No | Also keep each backup on its server. Default `false`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "s3", "name": "Backblaze", "provider": "b2", "region": "us-west-004", "bucket": "example-backups", "accessKeyId": "'"$B2_KEY_ID"'", "secretAccessKey": "'"$B2_APPLICATION_KEY"'" }' ``` **JavaScript** ```js const { storage } = await panel.backups.storage.create({ type: 'sftp', name: 'Backup server', host: 'backup.example.com', username: 'backups', }); console.log(storage.publicKey); // add to ~backups/.ssh/authorized_keys ``` **Response** `201 Created`: `{ storage }`, message `Storage added`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | A missing secret key or endpoint, a name another storage has, or another invalid field. | ## Get storage `GET /api/v1/backup-storage/:id` — Permission: backups.read — Token scope: read Returns `{ storage }` with its `usage`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage/0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { storage } = await panel.backups.storage.get(storageId); ``` **Response** `200 OK`: `{ storage }`. ## Update storage `PUT /api/v1/backup-storage/:id` — Permission: settings.manage — Token scope: full Saves the storage with the same fields as [Add storage](https://docs.vaultpanel.net/api-reference/backups#add-storage). `type` cannot change, and a blank `secretAccessKey` keeps the saved one. For SFTP, `trustNewHostKey: true` forgets the pinned host key so the next check trusts the new one; changing the host or port does the same. A changed connection is unchecked until the next [check](https://docs.vaultpanel.net/api-reference/backups#check-storage). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage/0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "sftp", "name": "Backup server", "host": "backup2.example.com", "username": "backups" }' ``` **JavaScript** ```js await panel.backups.storage.update(storageId, { type: 'sftp', name: 'Backup server', host: 'backup2.example.com', username: 'backups', }); ``` **Response** `200 OK`: `{ storage }`, message `Storage saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No storage with this id. | | 422 | `VALIDATION_ERROR` | The type changed, a name another storage has, or another invalid field. | ## Delete storage `DELETE /api/v1/backup-storage/:id` — Permission: settings.manage — Token scope: full Deletes the storage. Refused while backups are kept there or schedules use it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage/0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.backups.storage.remove(storageId); ``` **Response** `200 OK`: `data` is `null`, message `Storage removed`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No storage with this id. | | 409 | `STORAGE_IN_USE` | Backups are kept there or schedules use it (`details` has `backups`, `bytes` and `schedules`). | ## Check storage `POST /api/v1/backup-storage/:id/test` — Permission: settings.manage — Token scope: full Queues a `TEST_BACKUP_STORAGE` job: the server writes a small test file to the storage and reads it back. For SFTP, the first check pins the backup server's host key. The result is saved as the storage's `test`. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | Yes | The server to check from. Needs agent 0.13.0 or newer. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/backup-storage/0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f/test \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c" }' ``` **JavaScript** ```js const { job } = await panel.backups.storage.test(storageId, { serverId }); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: `{ job }`, message `Checking the storage`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No storage with this id. | | 409 | `AGENT_OUTDATED` | The server's agent is older than 0.13.0. | | 422 | `VALIDATION_ERROR` | The server does not exist. | --- # Cron jobs URL: https://docs.vaultpanel.net/api-reference/cron-jobs > API reference for cron jobs that run as a website's or app's own Linux user - creating, changing, running now and reading their run history. A cron job runs one or more commands on a schedule as the Linux user of a website or app. It is installed on the server by a job, then run by the server's own cron daemon, so it keeps running while the panel is down; the agent reports each run with its next request. Commands run in order, without a shell. The last 50 runs of each job are kept, with up to 16 KB of output each. Hosting customers reach the cron jobs of their own websites and apps, and creating one counts against their plan. For the workflow, see [Cron jobs](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/cron-jobs` | [List cron jobs](https://docs.vaultpanel.net/api-reference/cron-jobs#list-cron-jobs) | | POST | `/api/v1/cron-jobs` | [Create a cron job](https://docs.vaultpanel.net/api-reference/cron-jobs#create-a-cron-job) | | GET | `/api/v1/cron-jobs/:id` | [Get a cron job](https://docs.vaultpanel.net/api-reference/cron-jobs#get-a-cron-job) | | PATCH | `/api/v1/cron-jobs/:id` | [Update a cron job](https://docs.vaultpanel.net/api-reference/cron-jobs#update-a-cron-job) | | DELETE | `/api/v1/cron-jobs/:id` | [Delete a cron job](https://docs.vaultpanel.net/api-reference/cron-jobs#delete-a-cron-job) | | POST | `/api/v1/cron-jobs/:id/run` | [Run a cron job now](https://docs.vaultpanel.net/api-reference/cron-jobs#run-a-cron-job-now) | | GET | `/api/v1/cron-jobs/:id/runs` | [List runs](https://docs.vaultpanel.net/api-reference/cron-jobs#list-runs) | ## The cron job object | Field | Type | Description | | --- | --- | --- | | `id`, `serverId`, `serverName` | string | The cron job and its server. | | `serverTimezone` | string or null | The server's time zone: schedules run in it. | | `owner` | object | `{ type, id, name }`: the website or app, and the Linux user it runs as. | | `name` | string | Up to 100 characters. | | `schedule`, `description` | string | The cron expression, and in words (`Every day at 03:00`). | | `commands` | string | One command per line. | | `workingDir` | string | The folder inside the site or app it starts in; empty for its home folder. | | `timeoutSeconds` | integer | A run is stopped after this long. | | `enabled` | boolean | Paused when `false`. | | `appEnv` | boolean | Apps only: load the app's environment variables. | | `status` | string | `creating`, `active`, `updating`, `deleting` or `failed`. | | `pending` | object or null | Settings being sent to the server. | | `lastJobId`, `lastError` | | The last job, and `{ code, message }` of its failure. | | `lastRun` | object or null | `{ at, status, exitCode, durationMs }`. | ## List cron jobs `GET /api/v1/cron-jobs` — Permission: cron.read — Token scope: read Returns cron jobs a page at a time. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `serverId` | string (UUID) | No | Only cron jobs on this server. | | `ownerType`, `ownerId` | string | No | Only cron jobs of this `website` or `application`. | | `search` | string | No | Part of the name or of the Linux user's name. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `name` (default), `createdAt` or `lastRunAt`; `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/cron-jobs?ownerType=application&ownerId=3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.cronJobs.list({ ownerType: 'application', ownerId: appId }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "8f9a0b1c-…", "serverId": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "serverName": "web-1", "serverTimezone": "UTC", "owner": { "type": "application", "id": "3e4f5a6b-7c8d-4e9f-a0b1-c2d3e4f5a6b7", "name": "shop-api" }, "name": "Nightly cleanup", "schedule": "0 3 * * *", "description": "Every day at 03:00", "commands": "node scripts/cleanup.js", "workingDir": "current", "timeoutSeconds": 3600, "enabled": true, "appEnv": true, "status": "active", "pending": null, "lastJobId": "…", "lastError": null, "lastRun": { "at": "2026-11-10T03:00:00.000Z", "status": "succeeded", "exitCode": 0, "durationMs": 1840 }, "createdAt": "2026-10-12T09:00:00.000Z", "updatedAt": "2026-10-12T09:00:05.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` ## Create a cron job `POST /api/v1/cron-jobs` — Permission: cron.manage — Token scope: manage Creates a cron job and installs it on the website's or app's server (`CREATE_CRON`). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `ownerType` | string | Yes | `website` or `application`. | | `ownerId` | string (UUID) | Yes | The website or app it runs as. | | `name` | string | Yes | Up to 100 characters. | | `schedule` | string | Yes | A five-field cron expression, such as `*/15 * * * *`. | | `commands` | string | Yes | Up to 10 lines of up to 500 characters, one command per line, run in order without a shell. | | `workingDir` | string | No | A folder inside the site or app, such as `current` or `public`. Default: its home folder. | | `timeoutSeconds` | integer | No | 10 to 86400. Default 3600. | | `enabled` | boolean | No | Default `true`. | | `appEnv` | boolean | No | Apps only: load the app's environment variables. Default `false`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cron-jobs \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "ownerType": "website", "ownerId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "name": "WordPress cron", "schedule": "*/15 * * * *", "commands": "php wp-cron.php", "workingDir": "public" }' ``` **JavaScript** ```js const { cronJob, job } = await panel.cronJobs.create({ ownerType: 'website', ownerId: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d', name: 'WordPress cron', schedule: '*/15 * * * *', commands: 'php wp-cron.php', workingDir: 'public', }); ``` **Response** `202 Accepted`: `{ cronJob, job }` with the cron job in status `creating`, message `Saving the cron job on the server`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such website or app, or not yours. | | 409 | `RESOURCE_NOT_READY` | The website or app is not ready. | | 409 | `QUOTA_REACHED` | A hosting customer's plan allows no more cron jobs (`details: { kind, limit, used }`). | | 422 | `VALIDATION_ERROR` | An invalid schedule or command, `appEnv` on a website, or another invalid field. | ## Get a cron job `GET /api/v1/cron-jobs/:id` — Permission: cron.read — Token scope: read Returns one [cron job object](https://docs.vaultpanel.net/api-reference/cron-jobs#the-cron-job-object). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cron-jobs/8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const cronJob = await panel.cronJobs.get(cronJobId); ``` **Response** `200 OK`: the cron job. ## Update a cron job `PATCH /api/v1/cron-jobs/:id` — Permission: cron.manage — Token scope: manage Changes any of `name`, `schedule`, `commands`, `workingDir`, `timeoutSeconds`, `enabled` and `appEnv` (send at least one). A change to the name alone, or no change at all, answers `200 OK` with `job: null`; anything else sends the cron job to the server again and answers `202 Accepted` with the job. A cron job whose creation failed is created again with the new settings. Set `enabled` to `false` to pause it. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cron-jobs/8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": false }' ``` **JavaScript** ```js const { cronJob, job } = await panel.cronJobs.update(cronJobId, { enabled: false }); ``` **Response** `202 Accepted` with `{ cronJob, job }` (message `Saving the cron job on the server`), or `200 OK` with `job: null` (message `Saved`). **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No cron job with this id. | | 409 | `CRON_JOB_BUSY` | A change to it is still running (`details.jobId`). | | 409 | `RESOURCE_NOT_READY` | Its website or app is not ready. | | 422 | `VALIDATION_ERROR` | No field given, or the result is invalid. | ## Delete a cron job `DELETE /api/v1/cron-jobs/:id` — Permission: cron.manage — Token scope: manage Removes the cron job from its server (`DELETE_CRON`) and from the panel. A cron job whose creation failed is removed from the panel at once. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cron-jobs/8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.cronJobs.remove(cronJobId); ``` **Response** `202 Accepted`: `{ job }`, message `Deleting the cron job`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No cron job with this id. | | 409 | `CRON_JOB_BUSY` | A change to it is still running. | ## Run a cron job now `POST /api/v1/cron-jobs/:id/run` — Permission: cron.run — Token scope: deploy Runs the cron job once now (`RUN_CRON`), as its own user. The run is recorded in its history with the trigger `manual`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/cron-jobs/8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c/run \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { job } = await panel.cronJobs.run(cronJobId); await panel.jobs.wait(job.id); ``` **Response** `202 Accepted`: `{ job }`, message `Running`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No cron job with this id. | | 409 | `CRON_JOB_NOT_READY` | It is not set up on its server (save it again), or a change to it is still running. | | 409 | `DUPLICATE_OPERATION` | A run started from the panel is already queued or running. | ## List runs `GET /api/v1/cron-jobs/:id/runs` — Permission: cron.read — Token scope: read Returns the cron job's runs, newest first, with their output. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `succeeded`, `failed`, `timed_out` or `skipped` (the previous run was still going). | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `order` | string | No | `desc` (default) or `asc` by start time. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/cron-jobs/8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c/runs?status=failed" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.cronJobs.runs(cronJobId, { status: 'failed' }); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": 1042, "cronJobId": "8f9a0b1c-2d3e-4f5a-8b6c-7d8e9f0a1b2c", "trigger": "schedule", "status": "failed", "exitCode": 1, "startedAt": "2026-11-10T03:00:00.000Z", "finishedAt": "2026-11-10T03:00:02.000Z", "durationMs": 1950, "output": "Error: connect ECONNREFUSED 127.0.0.1:3306\n", "outputTruncated": false, "jobId": null } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` `trigger` is `schedule` (started by the server's cron daemon) or `manual` (started from the panel). --- # Webhooks URL: https://docs.vaultpanel.net/api-reference/webhooks > API reference for outgoing webhooks - creating JSON, Slack and Discord webhooks, rotating signing secrets, sending tests and reading or redelivering deliveries. Webhooks send panel events to another service: signed JSON for your own code, or a chat message for Slack or Discord. Each event becomes one delivery per webhook that wants it, kept in the database so it survives a restart and retried when it fails. A delivery that gets no `2xx` answer within 10 seconds is retried after 1 minute, 5 minutes and 30 minutes. The payload, headers and how to verify the `X-VaultPanel-Signature` of a JSON delivery are described in [Webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks). Webhooks that carry a plugin's events are managed on the plugin instead; see [Plugins](https://docs.vaultpanel.net/api-reference/plugins). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/webhooks` | [List webhooks](https://docs.vaultpanel.net/api-reference/webhooks#list-webhooks) | | POST | `/api/v1/webhooks` | [Create a webhook](https://docs.vaultpanel.net/api-reference/webhooks#create-a-webhook) | | GET | `/api/v1/webhooks/:id` | [Get a webhook](https://docs.vaultpanel.net/api-reference/webhooks#get-a-webhook) | | PATCH | `/api/v1/webhooks/:id` | [Update a webhook](https://docs.vaultpanel.net/api-reference/webhooks#update-a-webhook) | | DELETE | `/api/v1/webhooks/:id` | [Delete a webhook](https://docs.vaultpanel.net/api-reference/webhooks#delete-a-webhook) | | POST | `/api/v1/webhooks/:id/test` | [Send a test](https://docs.vaultpanel.net/api-reference/webhooks#send-a-test) | | GET | `/api/v1/webhooks/:id/deliveries` | [List deliveries](https://docs.vaultpanel.net/api-reference/webhooks#list-deliveries) | | POST | `/api/v1/webhooks/:id/deliveries/:deliveryId/redeliver` | [Redeliver](https://docs.vaultpanel.net/api-reference/webhooks#redeliver) | ## Events | Event | When | | --- | --- | | `backup.succeeded` | A backup finished. | | `backup.failed` | A backup failed. | | `restore.succeeded` | A restore finished. | | `restore.failed` | A restore failed. | | `cron.failed` | A cron job failed or timed out. | | `deployment.succeeded` | A deployment went live. | | `deployment.failed` | A deployment failed. | | `alert.firing` | An alert started firing. | | `alert.resolved` | An alert resolved. | | `server.offline` | A server went offline. | | `server.online` | A server came back online. | | `ssl.expiring` | An SSL certificate is close to expiring. | | `ssl.expired` | An SSL certificate expired. | | `ssl.renew_failed` | Automatic SSL renewal failed. | Test deliveries use the event `webhook.test`. ## The webhook object | Field | Type | Description | | --- | --- | --- | | `id`, `name` | string | The webhook. | | `host` | string | Where it sends, such as `https://hooks.slack.com`. Lists never include the full URL: chat webhook URLs are secrets. | | `url` | string | Only in [Get a webhook](https://docs.vaultpanel.net/api-reference/webhooks#get-a-webhook). | | `format` | string | `json` (signed), `slack` or `discord`. | | `events` | string[] | The [events](https://docs.vaultpanel.net/api-reference/webhooks#events) it receives. | | `enabled` | boolean | Paused when `false`. | | `lastDelivery` | object or null | `{ at, status }`. | | `createdAt`, `updatedAt` | string | Timestamps. | ## List webhooks `GET /api/v1/webhooks` — Permission: webhooks.manage — Token scope: manage Returns your webhooks a page at a time, without plugin webhooks. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `name` (default) or `createdAt`; `asc` (default) or `desc`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.webhooks.list(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "4d5e6f7a-…", "name": "Ops channel", "host": "https://hooks.slack.com", "format": "slack", "events": ["backup.failed", "alert.firing", "server.offline"], "enabled": true, "lastDelivery": { "at": "2026-11-10T09:55:01.000Z", "status": "succeeded" }, "createdAt": "2026-10-04T12:00:00.000Z", "updatedAt": "2026-10-04T12:00:00.000Z" } ], "pagination": { "page": 1, "pageSize": 25, "total": 1, "totalPages": 1 } }, "message": "OK", "requestId": "…" } ``` ## Create a webhook `POST /api/v1/webhooks` — Permission: webhooks.manage — Token scope: manage Creates a webhook and returns its signing secret (`whsec_…`), which is shown only in this response. JSON deliveries are signed with it; Slack and Discord messages are unsigned, since their URL is the secret. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 100 characters. | | `url` | string | Yes | A full `http` or `https` URL, up to 2000 characters, without `user:password@`. | | `format` | string | No | `json` (default), `slack` or `discord`. | | `events` | string[] | Yes | At least one [event](https://docs.vaultpanel.net/api-reference/webhooks#events). | | `enabled` | boolean | No | Default `true`. | Deliveries to private network addresses are refused unless the panel's `.env` sets `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE=true`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Deploy tracker", "url": "https://hooks.example.com/vaultpanel", "format": "json", "events": ["deployment.succeeded", "deployment.failed"] }' ``` **JavaScript** ```js const { webhook, secret } = await panel.webhooks.create({ name: 'Deploy tracker', url: 'https://hooks.example.com/vaultpanel', format: 'json', events: ['deployment.succeeded', 'deployment.failed'], }); // Store `secret` now: it is not shown again. ``` **Response** `201 Created` ```json { "success": true, "data": { "webhook": { "id": "4d5e6f7a-…", "name": "Deploy tracker", "host": "https://hooks.example.com", "format": "json", "events": ["deployment.succeeded", "deployment.failed"], "enabled": true, "lastDelivery": null }, "secret": "whsec_…" }, "message": "Webhook added", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | Not a full `http` or `https` URL, credentials in the URL, no events, or an unknown event. | ## Get a webhook `GET /api/v1/webhooks/:id` — Permission: webhooks.manage — Token scope: manage Returns the webhook with its full `url`. The secret is never returned again. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const webhook = await panel.webhooks.get(webhookId); ``` **Response** `200 OK`: the [webhook object](https://docs.vaultpanel.net/api-reference/webhooks#the-webhook-object) with `url`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No webhook with this id. | | 409 | `PLUGIN_WEBHOOK` | It carries a plugin's events: manage it on the plugin. | ## Update a webhook `PATCH /api/v1/webhooks/:id` — Permission: webhooks.manage — Token scope: manage Changes any of `name`, `url`, `format`, `events` and `enabled`. With `rotateSecret: true`, a new signing secret replaces the old one at once and is returned in this response only. Send at least one change. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "rotateSecret": true }' ``` **JavaScript** ```js const { webhook, secret } = await panel.webhooks.update(webhookId, { rotateSecret: true }); ``` **Response** `200 OK`: `{ webhook }`, plus `secret` when it was rotated; message `Saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No webhook with this id. | | 409 | `PLUGIN_WEBHOOK` | It carries a plugin's events. | | 422 | `VALIDATION_ERROR` | Nothing to update, or an invalid field. | ## Delete a webhook `DELETE /api/v1/webhooks/:id` — Permission: webhooks.manage — Token scope: manage Deletes the webhook. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.webhooks.remove(webhookId); ``` **Response** `200 OK`: `data` is `null`, message `Webhook deleted`. ## Send a test `POST /api/v1/webhooks/:id/test` — Permission: webhooks.manage — Token scope: manage Sends a `webhook.test` event now, once, and returns the delivery with its outcome. A failed test is not retried. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a/test \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { delivery } = await panel.webhooks.test(webhookId); console.log(delivery.status, delivery.responseStatus); ``` **Response** `200 OK` ```json { "success": true, "data": { "delivery": { "id": "9a0b1c2d-…", "webhookId": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a", "event": "webhook.test", "status": "succeeded", "attempts": 1, "nextAttemptAt": null, "responseStatus": 200, "error": null, "durationMs": 184, "payload": { "event": "webhook.test", "occurredAt": "2026-11-10T11:30:00.000Z", "data": { "webhook": { "id": "4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a", "name": "Deploy tracker" }, "message": "This is a test from VaultPanel." } }, "createdAt": "2026-11-10T11:30:00.000Z", "deliveredAt": "2026-11-10T11:30:00.000Z" } }, "message": "OK", "requestId": "…" } ``` ## List deliveries `GET /api/v1/webhooks/:id/deliveries` — Permission: webhooks.manage — Token scope: manage Returns the webhook's deliveries, newest first, with their payloads and outcomes. Deliveries are kept for 30 days. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `pending` (still being tried), `succeeded` or `failed`. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `order` | string | No | `desc` (default) or `asc` by creation time. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a/deliveries?status=failed" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.webhooks.deliveries(webhookId, { status: 'failed' }); ``` **Response** `200 OK`: `{ items, pagination }` of deliveries, as in [Send a test](https://docs.vaultpanel.net/api-reference/webhooks#send-a-test). ## Redeliver `POST /api/v1/webhooks/:id/deliveries/:deliveryId/redeliver` — Permission: webhooks.manage — Token scope: manage Sends a finished delivery again, now, with the same payload, and returns its new outcome. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/webhooks/4d5e6f7a-8b9c-4d0e-8f1a-2b3c4d5e6f7a/deliveries/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c2d/redeliver \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { delivery } = await panel.request('POST', `/webhooks/${webhookId}/deliveries/${deliveryId}/redeliver`); ``` **Response** `200 OK`: `{ delivery }`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such webhook or delivery. | | 409 | `DELIVERY_PENDING` | The delivery is still being tried. | --- # AI assistant URL: https://docs.vaultpanel.net/api-reference/assistant > API reference for the AI assistant - provider settings, the free model on the panel's server, conversations, and approving the changes it proposes. The assistant answers questions about your servers by reading their status and logs through the panel, with the permissions of the person who asked, and proposes changes that run only when that person approves them. Questions are answered by the panel's worker, so the worker must be running. Settings need `settings.manage`; everything else needs `assistant.use` (owners, admins, developers and viewers; never hosting customers). Conversations belong to the person who started them: anyone else gets `404`. For the concepts, see [AI assistant](https://docs.vaultpanel.net/guides/ai-assistant), [Providers](https://docs.vaultpanel.net/guides/ai-assistant/providers) and [Free model on this server](https://docs.vaultpanel.net/guides/ai-assistant/local-model). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/assistant/status` | [Get the status](https://docs.vaultpanel.net/api-reference/assistant#get-the-status) | | GET | `/api/v1/assistant/settings` | [Get the settings](https://docs.vaultpanel.net/api-reference/assistant#get-the-settings) | | PUT | `/api/v1/assistant/settings` | [Save the settings](https://docs.vaultpanel.net/api-reference/assistant#save-the-settings) | | POST | `/api/v1/assistant/settings/test` | [Test a provider](https://docs.vaultpanel.net/api-reference/assistant#test-a-provider) | | GET | `/api/v1/assistant/local-model` | [Get the local model's state](https://docs.vaultpanel.net/api-reference/assistant#get-the-local-models-state) | | POST | `/api/v1/assistant/local-model/install` | [Install a local model](https://docs.vaultpanel.net/api-reference/assistant#install-a-local-model) | | POST | `/api/v1/assistant/local-model/remove` | [Remove a local model](https://docs.vaultpanel.net/api-reference/assistant#remove-a-local-model) | | POST | `/api/v1/assistant/local-model/uninstall` | [Remove Ollama](https://docs.vaultpanel.net/api-reference/assistant#remove-ollama) | | GET | `/api/v1/assistant/conversations` | [List conversations](https://docs.vaultpanel.net/api-reference/assistant#list-conversations) | | POST | `/api/v1/assistant/conversations` | [Start a conversation](https://docs.vaultpanel.net/api-reference/assistant#start-a-conversation) | | GET | `/api/v1/assistant/conversations/:id` | [Get a conversation](https://docs.vaultpanel.net/api-reference/assistant#get-a-conversation) | | POST | `/api/v1/assistant/conversations/:id/messages` | [Ask a follow-up](https://docs.vaultpanel.net/api-reference/assistant#ask-a-follow-up) | | POST | `/api/v1/assistant/conversations/:id/retry` | [Retry a failed answer](https://docs.vaultpanel.net/api-reference/assistant#retry-a-failed-answer) | | DELETE | `/api/v1/assistant/conversations/:id` | [Delete a conversation](https://docs.vaultpanel.net/api-reference/assistant#delete-a-conversation) | | POST | `/api/v1/assistant/actions/:id/approve` | [Approve a proposed change](https://docs.vaultpanel.net/api-reference/assistant#approve-a-proposed-change) | | POST | `/api/v1/assistant/actions/:id/cancel` | [Cancel a proposed change](https://docs.vaultpanel.net/api-reference/assistant#cancel-a-proposed-change) | ## Providers | `provider` | Description | | --- | --- | | `anthropic` | Claude through the Anthropic API. Needs an API key. Default model `claude-opus-5-5`. | | `openai` | OpenAI, or any service with an OpenAI-compatible chat API (Ollama, vLLM…). The model must support tool calling. No default model; the key is optional. | | `local` | A small open model the panel installs on its own server with Ollama (agent 0.41.0 or newer). No API key; nothing leaves the server. Takes only a `model` from the panel's catalog. | ## Get the status `GET /api/v1/assistant/status` — Permission: assistant.use — Token scope: full Whether questions can be asked now. `enabled` is `true` only when the assistant is on and fully configured. `canConfigure` says whether you may change its settings. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/status \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const status = await panel.request('GET', '/assistant/status'); ``` **Response** `200 OK` ```json { "success": true, "data": { "enabled": true, "provider": "anthropic", "providerLabel": "Claude (Anthropic)", "model": "claude-opus-5-5", "canConfigure": true, "hourlyLimit": 60 }, "message": "OK", "requestId": "…" } ``` ## Get the settings `GET /api/v1/assistant/settings` — Permission: settings.manage — Token scope: full Returns the chosen provider's settings and, in `providers`, each provider's own model, address and whether it has a key. Keys are never returned, only their last four characters (`apiKeyHint`). `missing` says what is still needed before the assistant can be turned on, or `null`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/settings \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const settings = await panel.request('GET', '/assistant/settings'); ``` **Response** `200 OK` ```json { "success": true, "data": { "enabled": true, "provider": "anthropic", "model": "claude-opus-5-5", "baseUrl": null, "hasApiKey": true, "apiKeyHint": "…x9Qa", "missing": null, "providers": { "anthropic": { "model": "claude-opus-5-5", "baseUrl": null, "hasApiKey": true, "apiKeyHint": "…x9Qa" }, "openai": { "model": null, "baseUrl": null, "hasApiKey": false, "apiKeyHint": null }, "local": { "model": null, "baseUrl": null, "hasApiKey": false, "apiKeyHint": null } }, "updatedAt": "2026-11-10T08:00:00.000Z" }, "message": "OK", "requestId": "…" } ``` ## Save the settings `PUT /api/v1/assistant/settings` — Permission: settings.manage — Token scope: full Saves the settings of `provider` (or of the chosen provider when it is left out) and makes it the chosen one. Each provider keeps its own model, address and key, so switching back needs nothing again. All fields are optional. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | No | Turn the assistant on or off. | | `provider` | string | No | `anthropic`, `openai` or `local`. | | `model` | string | No | Up to 100 letters, digits and `. _ : / @ -`. For `local`, a model from the [catalog](https://docs.vaultpanel.net/api-reference/assistant#get-the-local-models-state). | | `baseUrl` | string or null | No | The provider's address, `http` or `https`, without credentials, query or fragment, such as `https://api.openai.com/v1`. Empty or `null` clears it. Ignored for `local`. | | `apiKey` | string or null | No | Sets that provider's key; `null` removes it; leaving it out keeps it. Ignored for `local`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/settings \ -X PUT \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true, "provider": "anthropic", "model": "claude-sonnet-5-5", "apiKey": "'"$ANTHROPIC_API_KEY"'" }' ``` **JavaScript** ```js await panel.request('PUT', '/assistant/settings', { body: { enabled: true, provider: 'anthropic', model: 'claude-sonnet-5-5', apiKey: process.env.ANTHROPIC_API_KEY }, }); ``` **Response** `200 OK`: the same data as [Get the settings](https://docs.vaultpanel.net/api-reference/assistant#get-the-settings), message `Assistant settings saved`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | Turning it on without a provider, a model, or a key for Claude; a `local` model not in the catalog; or an invalid field. | ## Test a provider `POST /api/v1/assistant/settings/test` — Permission: settings.manage — Token scope: full Sends one short request to a provider with the settings given, filling in what is left out from that provider's saved settings (its saved key is used when none is given). Nothing is saved. **Request body**: `provider`, `model`, `baseUrl` and `apiKey`, as in [Save the settings](https://docs.vaultpanel.net/api-reference/assistant#save-the-settings), all optional. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/settings/test \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "provider": "openai", "baseUrl": "http://10.0.0.5:11434/v1", "model": "qwen3.5:9b" }' ``` **JavaScript** ```js const result = await panel.request('POST', '/assistant/settings/test', { body: { provider: 'openai', baseUrl: 'http://10.0.0.5:11434/v1', model: 'qwen3.5:9b' }, }); ``` **Response** `200 OK`, message `The AI provider answered` ```json { "success": true, "data": { "ok": true, "provider": "openai", "model": "qwen3.5:9b", "latencyMs": 812 }, "message": "The AI provider answered", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `ASSISTANT_NOT_CONFIGURED` | No provider, model or required key. | | 502 | `PROVIDER_AUTH_FAILED`, `PROVIDER_MODEL_NOT_FOUND`, `PROVIDER_RATE_LIMITED`, `PROVIDER_UNREACHABLE`, `PROVIDER_TIMEOUT`, `PROVIDER_ERROR` | The provider refused the key, does not know the model, rate-limited, could not be reached, did not answer in time, or returned an error. | ## Get the local model's state `GET /api/v1/assistant/local-model` — Permission: settings.manage — Token scope: full The free model on the panel's own server: whether it can be installed there (`problem` says why not, otherwise `null`), Ollama's state, the installed models, the server's memory and free disk, the last install or removal job, and `catalog`, the models the panel offers with their download size and the memory they need. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/local-model \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const local = await panel.request('GET', '/assistant/local-model'); ``` **Response** `200 OK` ```json { "success": true, "data": { "server": { "id": "9b2e7c1a-0d3f-4e8b-a6c5-7d8e9f0a1b2c", "name": "This server", "status": "online" }, "problem": null, "installed": true, "running": true, "version": "0.40.16", "models": [{ "id": "qwen3.5:4b", "sizeBytes": 3400000000 }], "memory": { "totalBytes": 8589934592, "availableBytes": 5100000000 }, "diskFreeBytes": 64000000000, "lastJob": { "id": "…", "type": "LOCAL_AI_INSTALL", "status": "succeeded" }, "catalog": [ { "id": "qwen3.5:2b-q4_K_M", "label": "Qwen3.5 2B", "description": "The smallest and fastest. Simple answers; for servers with 4 GB of memory.", "downloadBytes": 1945781358, "memoryBytes": 2684354560, "license": "Apache 2.0", "thinks": false, "recommendable": true } ] }, "message": "OK", "requestId": "…" } ``` The catalog's model ids are `qwen3.5:2b-q4_K_M`, `granite4.1:3b`, `qwen3.5:4b` and `qwen3.5:9b`. ## Install a local model `POST /api/v1/assistant/local-model/install` — Permission: settings.manage — Token scope: full Queues a `LOCAL_AI_INSTALL` job on the panel's own server: the agent installs Ollama when it is missing, runs it as its own service on `127.0.0.1:21434`, and downloads the model. Then choose the `local` provider and the model in [Save the settings](https://docs.vaultpanel.net/api-reference/assistant#save-the-settings). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `model` | string | Yes | A model id from the catalog. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/local-model/install \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3.5:4b" }' ``` **JavaScript** ```js const job = await panel.request('POST', '/assistant/local-model/install', { body: { model: 'qwen3.5:4b' } }); await panel.jobs.wait(job.id, { timeoutMs: 30 * 60_000 }); ``` **Response** `202 Accepted`: the job, message `Installing the model on this server`. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `LOCAL_SERVER_MISSING` | The panel's own server is not connected. | | 409 | `LOCAL_MODEL_UNAVAILABLE` | Its agent is offline or older than 0.41.0, or the panel does not run on Linux. | | 422 | `VALIDATION_ERROR` | The model is not in the catalog. | ## Remove a local model `POST /api/v1/assistant/local-model/remove` — Permission: settings.manage — Token scope: full Queues a `LOCAL_AI_REMOVE` job that deletes one downloaded model. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `model` | string | Yes | A model id from the catalog. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/local-model/remove \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3.5:2b-q4_K_M" }' ``` **JavaScript** ```js await panel.request('POST', '/assistant/local-model/remove', { body: { model: 'qwen3.5:2b-q4_K_M' } }); ``` **Response** `202 Accepted`: the job, message `Removing the model`. **Errors**: those of [Install a local model](https://docs.vaultpanel.net/api-reference/assistant#install-a-local-model), and `409 LOCAL_MODEL_IN_USE` for the model the assistant answers with. ## Remove Ollama `POST /api/v1/assistant/local-model/uninstall` — Permission: settings.manage — Token scope: full Queues a `LOCAL_AI_UNINSTALL` job that removes every model and Ollama itself. No body. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/local-model/uninstall \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('POST', '/assistant/local-model/uninstall'); ``` **Response** `202 Accepted`: the job, message `Removing the models and Ollama`. **Errors**: `409 LOCAL_MODEL_IN_USE` while the assistant answers with the local provider, `409 LOCAL_SERVER_MISSING` or `LOCAL_MODEL_UNAVAILABLE`. ## The conversation object | Field | Type | Description | | --- | --- | --- | | `id`, `title` | string | The conversation; the title comes from the first question. | | `status` | string | `idle`, `thinking` (an answer is on its way) or `failed`. | | `activity` | string or null | What the assistant is doing, such as `Reading your question`. | | `error` | object or null | `{ code, message }` of a failed answer: `PROVIDER_AUTH_FAILED`, `PROVIDER_MODEL_NOT_FOUND`, `PROVIDER_RATE_LIMITED`, `PROVIDER_UNREACHABLE`, `PROVIDER_REFUSED`, `ASSISTANT_TIMEOUT`… | | `items` | array | Single conversation only: the transcript. | | `createdAt`, `updatedAt` | string | Timestamps. | In the transcript, a `user` item has `text`; an `assistant` item has `text`, `steps` (the checks it made: `{ label, failed, pending }`) and `actions`, the changes it proposed: | Action field | Description | | --- | --- | | `id`, `kind`, `label` | Such as `application.restart`, `Restart app`. | | `permission`, `dangerous` | The permission it needs, and whether it is a risky change. | | `params`, `target` | What it acts on: `target` is `{ type, id, label }`. | | `reason` | Why the assistant proposes it. | | `status` | `proposed`, `running`, `succeeded`, `failed`, `cancelled` or `expired`. | | `jobId`, `error`, `decidedAt` | The job it started, and its outcome. | The proposals the assistant can make are restarting, starting, stopping, deploying, rolling back an app and applying its saved settings; restarting or starting a service; turning a website on, retrying its setup or renewing its certificate; and installing software on a server. ## List conversations `GET /api/v1/assistant/conversations` — Permission: assistant.use — Token scope: full Returns your 100 most recently updated conversations, without their transcripts. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/assistant/conversations'); ``` **Response** `200 OK`: `{ items }` of [conversations](https://docs.vaultpanel.net/api-reference/assistant#the-conversation-object). ## Start a conversation `POST /api/v1/assistant/conversations` — Permission: assistant.use — Token scope: full Asks a first question. It returns at once with the conversation in status `thinking`: poll [Get a conversation](https://docs.vaultpanel.net/api-reference/assistant#get-a-conversation) until it is `idle` or `failed`. Each person may ask 60 questions an hour. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `question` | string | Yes | Up to 4000 characters. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "question": "Why is the shop-api app restarting?" }' ``` **JavaScript** ```js let convo = await panel.request('POST', '/assistant/conversations', { body: { question: 'Why is the shop-api app restarting?' }, }); while (convo.status === 'thinking') { await new Promise((r) => setTimeout(r, 2000)); convo = await panel.request('GET', `/assistant/conversations/${convo.id}`); } console.log(convo.items.at(-1).text); ``` **Response** `202 Accepted`: the conversation with its transcript, message `The assistant is looking into it`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | A hosting customer, or missing `assistant.use`. | | 409 | `ASSISTANT_NOT_CONFIGURED` | The assistant is off or not set up. | | 429 | `ASSISTANT_LIMIT` | 60 questions in the last hour. | | 503 | `QUEUE_UNAVAILABLE` | The panel could not hand the question to its worker (check Redis). | ## Get a conversation `GET /api/v1/assistant/conversations/:id` — Permission: assistant.use — Token scope: full Returns the conversation with its transcript and proposed changes. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations/0d1e2f3a-4b5c-4d6e-8f7a-8b9c0d1e2f3a \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const convo = await panel.request('GET', `/assistant/conversations/${conversationId}`); ``` **Response** `200 OK` ```json { "success": true, "data": { "id": "0d1e2f3a-4b5c-4d6e-8f7a-8b9c0d1e2f3a", "title": "Why is the shop-api app restarting?", "status": "idle", "activity": null, "error": null, "items": [ { "id": 41, "role": "user", "text": "Why is the shop-api app restarting?", "createdAt": "2026-11-10T12:00:00.000Z" }, { "id": 42, "role": "assistant", "text": "The app exits because it cannot reach its database…", "steps": [{ "label": "Read the app's error log", "failed": false, "pending": false }], "actions": [ { "id": "7f8a9b0c-…", "kind": "application.restart", "label": "Restart app", "permission": "applications.deploy", "dangerous": false, "target": { "type": "application", "id": "3e4f5a6b-…", "label": "shop-api on web-1" }, "reason": "Restart once the database is back.", "status": "proposed", "jobId": null, "error": null } ], "createdAt": "2026-11-10T12:00:09.000Z" } ], "createdAt": "2026-11-10T12:00:00.000Z", "updatedAt": "2026-11-10T12:00:20.000Z" }, "message": "OK", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such conversation, or someone else's. | ## Ask a follow-up `POST /api/v1/assistant/conversations/:id/messages` — Permission: assistant.use — Token scope: full Asks another question in the same conversation. One question at a time per conversation. **Request body**: `question`, as in [Start a conversation](https://docs.vaultpanel.net/api-reference/assistant#start-a-conversation). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations/0d1e2f3a-4b5c-4d6e-8f7a-8b9c0d1e2f3a/messages \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "question": "Is the database running now?" }' ``` **JavaScript** ```js await panel.request('POST', `/assistant/conversations/${conversationId}/messages`, { body: { question: 'Is the database running now?' }, }); ``` **Response** `202 Accepted`: the conversation, message `The assistant is looking into it`. **Errors**: those of [Start a conversation](https://docs.vaultpanel.net/api-reference/assistant#start-a-conversation), `404 NOT_FOUND`, and `409 ASSISTANT_BUSY` while it is still answering. ## Retry a failed answer `POST /api/v1/assistant/conversations/:id/retry` — Permission: assistant.use — Token scope: full Asks again after a `failed` answer, from where it stopped. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations/0d1e2f3a-4b5c-4d6e-8f7a-8b9c0d1e2f3a/retry \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('POST', `/assistant/conversations/${conversationId}/retry`); ``` **Response** `202 Accepted`: the conversation, message `Trying again`. **Errors**: `409 NOTHING_TO_RETRY` when the last answer did not fail, `409 ASSISTANT_BUSY`, and those of [Start a conversation](https://docs.vaultpanel.net/api-reference/assistant#start-a-conversation). ## Delete a conversation `DELETE /api/v1/assistant/conversations/:id` — Permission: assistant.use — Token scope: full Deletes the conversation with its messages and proposed changes. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/conversations/0d1e2f3a-4b5c-4d6e-8f7a-8b9c0d1e2f3a \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('DELETE', `/assistant/conversations/${conversationId}`); ``` **Response** `200 OK`: `data` is `null`, message `Conversation deleted`. ## Approve a proposed change `POST /api/v1/assistant/actions/:id/approve` — Permission: assistant.use — Token scope: full Runs a proposed change as you, through the same service call as the matching button in the panel, so your own permission for it is checked. Proposals expire after 60 minutes. The response is the action: when it could not start, its `status` is `failed` with the `error` (for example, a permission you lack) and the message is `The change could not start`; otherwise `running` with its `jobId`, and it moves to `succeeded` or `failed` when the job ends. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/actions/7f8a9b0c-1d2e-4f3a-8b4c-5d6e7f8a9b0c/approve \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const action = await panel.request('POST', `/assistant/actions/${actionId}/approve`); if (action.jobId) await panel.jobs.wait(action.jobId); ``` **Response** `200 OK`: the action, message `Change started` or `The change could not start`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such proposal, or not in your conversation. | | 409 | `ACTION_EXPIRED` | The proposal is more than 60 minutes old. | | 409 | `ACTION_NOT_PENDING` | It was already approved, cancelled or expired. | ## Cancel a proposed change `POST /api/v1/assistant/actions/:id/cancel` — Permission: assistant.use — Token scope: full Dismisses a proposal. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/assistant/actions/7f8a9b0c-1d2e-4f3a-8b4c-5d6e7f8a9b0c/cancel \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('POST', `/assistant/actions/${actionId}/cancel`); ``` **Response** `200 OK`: the action with status `cancelled`, message `Change cancelled`. **Errors**: `404 NOT_FOUND`, and `409 ACTION_NOT_PENDING` when it was already decided. --- # Hosting URL: https://docs.vaultpanel.net/api-reference/hosting > API reference for hosting plans, customer accounts, quotas, suspending and removing accounts, the financial report, billing API keys and a customer's own account. Hosting plans set what a customer may have: websites, subdomains, apps, databases, database users, cron jobs, disk space, and caps on each app's CPU and memory. Customers sign in to a panel that shows only their own account. The staff endpoints under `/hosting` manage plans, customers and the API keys billing systems use; `/hosting/me` is for the signed-in customer. Billing systems manage accounts through the separate [Billing API](https://docs.vaultpanel.net/api-reference/billing). For the concepts, see [Hosting plans and customers](https://docs.vaultpanel.net/guides/hosting-and-billing). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/hosting/me` | [Get your account](https://docs.vaultpanel.net/api-reference/hosting#get-your-account) | | GET | `/api/v1/hosting/me/dns` | [Get your DNS](https://docs.vaultpanel.net/api-reference/hosting#get-your-dns) | | POST | `/api/v1/hosting/me/dns/zones/:id/check` | [Check one of your zones](https://docs.vaultpanel.net/api-reference/hosting#check-one-of-your-zones) | | GET | `/api/v1/hosting/plans` | [List plans](https://docs.vaultpanel.net/api-reference/hosting#list-plans) | | POST | `/api/v1/hosting/plans` | [Create a plan](https://docs.vaultpanel.net/api-reference/hosting#create-a-plan) | | GET | `/api/v1/hosting/plans/:id` | [Get a plan](https://docs.vaultpanel.net/api-reference/hosting#get-a-plan) | | PATCH | `/api/v1/hosting/plans/:id` | [Update a plan](https://docs.vaultpanel.net/api-reference/hosting#update-a-plan) | | DELETE | `/api/v1/hosting/plans/:id` | [Delete a plan](https://docs.vaultpanel.net/api-reference/hosting#delete-a-plan) | | GET | `/api/v1/hosting/customers` | [List customers](https://docs.vaultpanel.net/api-reference/hosting#list-customers) | | POST | `/api/v1/hosting/customers` | [Create a customer](https://docs.vaultpanel.net/api-reference/hosting#create-a-customer) | | GET | `/api/v1/hosting/customers/:id` | [Get a customer](https://docs.vaultpanel.net/api-reference/hosting#get-a-customer) | | PATCH | `/api/v1/hosting/customers/:id` | [Update a customer](https://docs.vaultpanel.net/api-reference/hosting#update-a-customer) | | POST | `/api/v1/hosting/customers/:id/plan` | [Change the plan](https://docs.vaultpanel.net/api-reference/hosting#change-the-plan) | | POST | `/api/v1/hosting/customers/:id/suspend` | [Suspend an account](https://docs.vaultpanel.net/api-reference/hosting#suspend-an-account) | | POST | `/api/v1/hosting/customers/:id/unsuspend` | [Unsuspend an account](https://docs.vaultpanel.net/api-reference/hosting#unsuspend-an-account) | | POST | `/api/v1/hosting/customers/:id/terminate` | [Remove an account](https://docs.vaultpanel.net/api-reference/hosting#remove-an-account) | | POST | `/api/v1/hosting/customers/:id/password-reset` | [Create a password reset link](https://docs.vaultpanel.net/api-reference/hosting#create-a-password-reset-link) | | POST | `/api/v1/hosting/customers/:id/resources` | [Move a resource to a customer](https://docs.vaultpanel.net/api-reference/hosting#move-a-resource-to-a-customer) | | DELETE | `/api/v1/hosting/customers/:id/resources/:type/:resourceId` | [Take a resource back](https://docs.vaultpanel.net/api-reference/hosting#take-a-resource-back) | | GET | `/api/v1/hosting/reports/financial` | [Get the financial report](https://docs.vaultpanel.net/api-reference/hosting#get-the-financial-report) | | GET | `/api/v1/hosting/api-keys` | [List billing API keys](https://docs.vaultpanel.net/api-reference/hosting#list-billing-api-keys) | | POST | `/api/v1/hosting/api-keys` | [Create a billing API key](https://docs.vaultpanel.net/api-reference/hosting#create-a-billing-api-key) | | POST | `/api/v1/hosting/api-keys/:id/revoke` | [Revoke a billing API key](https://docs.vaultpanel.net/api-reference/hosting#revoke-a-billing-api-key) | ## Hosting customers and the API A hosting customer (role `customer`) can reach only `/auth`, `/api-tokens`, `/hosting/me`, and the website, subdomain, domain, certificate, app, deployment, CMS, database, database user, backup, backup schedule, cron job and job routes; everything else answers `403 FORBIDDEN`. There they see and change only what their account owns (anything else is `404`). Their creates are checked against their plan: | Status | Code | When | | --- | --- | --- | | 409 | `QUOTA_REACHED` | The plan's limit is reached (`details: { kind, limit, used }`), or the account is over its disk space. | | 409 | `NO_SERVER` | The account has no server. | | 403 | `ACCOUNT_SUSPENDED` | Signing in to a suspended or removed account. | ## Get your account `GET /api/v1/hosting/me` The signed-in customer's account: `customer`, `plan` (with its `limits` and `appCaps`), `usage`, `appCaps`, `ports` (the account's own app ports, each with the app on it or `null`) and `server` (its name, status, host name, addresses, time zone and installed software). Staff get `404`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/me \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { customer, plan, usage, ports } = await panel.hosting.me(); ``` **Response** `200 OK` ```json { "success": true, "data": { "customer": { "id": "c1d2e3f4-…", "name": "Ada Customer", "company": "Example Ltd", "email": "ada@example.org", "status": "active", "createdAt": "2026-10-05T10:00:00.000Z" }, "plan": { "id": "a0b1c2d3-…", "name": "Starter", "priceCents": 900, "currency": "USD", "billingCycle": "monthly", "limits": { "websites": 5, "subdomains": 10, "applications": 2, "databases": 5, "databaseUsers": 5, "cronJobs": 10, "diskMb": 10240 }, "appCaps": { "appMemoryMb": 512, "appCpuPercent": 100 } }, "usage": { "websites": 2, "subdomains": 1, "applications": 1, "databases": 2, "databaseUsers": 2, "cronJobs": 1, "diskMb": 812, "diskBytes": 851443712, "disk": { "websites": 402653184, "applications": 314572800, "databases": 134217728 }, "limits": { "websites": 5, "subdomains": 10, "applications": 2, "databases": 5, "databaseUsers": 5, "cronJobs": 10, "diskMb": 10240 }, "over": [] }, "appCaps": { "appMemoryMb": 512, "appCpuPercent": 100 }, "ports": [{ "port": 3001, "serverId": "9b2e7c1a-…", "application": { "id": "3e4f5a6b-…", "name": "shop-api" } }], "server": { "id": "9b2e7c1a-…", "name": "web-1", "status": "online", "hostname": "web-1", "publicIp": "203.0.113.10" } }, "message": "OK", "requestId": "…" } ``` ## Get your DNS `GET /api/v1/hosting/me/dns` The name servers to set at the registrar, whether new domains get a zone automatically, and the account's domains this panel answers for, with their name servers and last public DNS check. See [DNS](https://docs.vaultpanel.net/api-reference/dns) for the zone fields. Staff get `404`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/me/dns \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { nameservers, autoZones, zones } = await panel.request('GET', '/hosting/me/dns'); ``` **Response** `200 OK` ```json { "success": true, "data": { "nameservers": ["ns1.example.net", "ns2.example.net"], "autoZones": true, "zones": [ { "id": "4f0c2a8e-…", "domain": "example.org", "status": "active", "nameservers": [{ "host": "ns1.example.net", "inZone": false, "addresses": [] }], "delegation": { "status": "ok", "nameservers": ["ns1.example.net", "ns2.example.net"], "detail": null, "checkedAt": "2026-11-10T09:00:00.000Z" } } ] }, "message": "OK", "requestId": "…" } ``` ## Check one of your zones `POST /api/v1/hosting/me/dns/zones/:id/check` Checks one of the account's zones against public DNS, like [Check name servers in public DNS](https://docs.vaultpanel.net/api-reference/dns#check-name-servers-in-public-dns), and returns `{ zone }` in the shape above. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/me/dns/zones/4f0c2a8e-5b1d-4c47-9a53-1c2f3b4d5e6f/check \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { zone } = await panel.request('POST', `/hosting/me/dns/zones/${zoneId}/check`); ``` **Response** `200 OK`: `{ zone }`. **Errors**: `404 NOT_FOUND` for a zone that is not the account's. ## The plan object | Field | Type | Description | | --- | --- | --- | | `id`, `name`, `description` | string | The plan. | | `isActive` | boolean | Offered to new customers. | | `priceCents`, `currency`, `billingCycle` | | The price per cycle (`monthly`, `quarterly`, `yearly` or `free`). VaultPanel stores it to show it and hand it to billing systems; it takes no payments. | | `serverGroup` | object or null | New accounts go on a server of this group. | | `limits` | object | `websites`, `subdomains`, `applications`, `databases`, `databaseUsers`, `cronJobs` and `diskMb`. `null` is unlimited. | | `appCaps` | object | `appMemoryMb` (64 to 262144) and `appCpuPercent` (10 to 6400; 100 is one core) for each app. `null` is no cap. | | `customerCount` | integer | Customers on the plan. | ## List plans `GET /api/v1/hosting/plans` — Permission: customers.read — Token scope: read Returns every plan, by name. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/plans \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.hosting.plans(); ``` **Response** `200 OK`: `{ items }` of [plans](https://docs.vaultpanel.net/api-reference/hosting#the-plan-object). ## Create a plan `POST /api/v1/hosting/plans` — Permission: plans.manage — Token scope: customers **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 60 letters, numbers, spaces and `. _ - + ( ) &`. Unique. | | `description` | string | No | Up to 300 characters. | | `isActive` | boolean | No | Offered to new customers. Default `true`. | | `priceCents` | integer or null | No | 0 to 100000000. Default `null` (no price). | | `currency` | string | No | A 3-letter code. Default `USD`. | | `billingCycle` | string | No | `monthly` (default), `quarterly`, `yearly` or `free`. | | `serverGroupId` | string (UUID) or null | No | Put new accounts on a server of this group. | | `limits` | object | No | Any of the limits; 0 to 10000 (`diskMb` up to 100000000), or `null` for unlimited. | | `appCaps` | object | No | `appMemoryMb` and `appCpuPercent`, or `null`. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/plans \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Starter", "priceCents": 900, "currency": "USD", "billingCycle": "monthly", "limits": { "websites": 5, "applications": 2, "databases": 5, "diskMb": 10240 }, "appCaps": { "appMemoryMb": 512, "appCpuPercent": 100 } }' ``` **JavaScript** ```js const plan = await panel.hosting.createPlan({ name: 'Starter', priceCents: 900, limits: { websites: 5, applications: 2, databases: 5, diskMb: 10240 }, appCaps: { appMemoryMb: 512, appCpuPercent: 100 }, }); ``` **Response** `201 Created`: the plan, message `Plan created`. **Errors**: `422 VALIDATION_ERROR` for a name another plan has, an unknown server group, or another invalid field. ## Get a plan `GET /api/v1/hosting/plans/:id` — Permission: customers.read — Token scope: read **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/plans/a0b1c2d3-e4f5-4a6b-8c7d-8e9f0a1b2c3d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const plan = await panel.request('GET', `/hosting/plans/${planId}`); ``` **Response** `200 OK`: the plan. `404 NOT_FOUND` when there is none. ## Update a plan `PATCH /api/v1/hosting/plans/:id` — Permission: plans.manage — Token scope: customers Changes any of the fields of [Create a plan](https://docs.vaultpanel.net/api-reference/hosting#create-a-plan) (send at least one). New app caps reach each of the plan's apps on its next deploy or apply; `appsCapped` says how many apps are affected. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/plans/a0b1c2d3-e4f5-4a6b-8c7d-8e9f0a1b2c3d \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "limits": { "websites": 10 } }' ``` **JavaScript** ```js const { plan, appsCapped } = await panel.hosting.updatePlan(planId, { limits: { websites: 10 } }); ``` **Response** `200 OK`: `{ plan, appsCapped }`, message `Plan saved.` (plus how many apps get the new cap). ## Delete a plan `DELETE /api/v1/hosting/plans/:id` — Permission: plans.manage — Token scope: customers Deletes a plan no customer is on (removed accounts included). To stop offering a plan that has customers, set `isActive` to `false` instead. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/plans/a0b1c2d3-e4f5-4a6b-8c7d-8e9f0a1b2c3d \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.hosting.removePlan(planId); ``` **Response** `200 OK`: `data` is `null`, message `Plan deleted`. **Errors**: `404 NOT_FOUND`, and `409 PLAN_IN_USE` while customers are on it. ## The customer object | Field | Type | Description | | --- | --- | --- | | `id`, `name`, `company`, `email` | string | The account. | | `externalId` | string or null | The billing system's id for it (a WHMCS service id…). | | `status` | string | `active`, `suspended` or `terminated` (removed; kept for the record). | | `suspendReason`, `suspendedAt` | | Why and when it was suspended. | | `suspendedResources` | object or null | How many `websites`, `applications` and `cronJobs` suspending turned off. | | `terminatedAt`, `notes`, `createdVia` | | `createdVia` is `panel` or `api`. | | `plan` | object | `{ id, name }`. | | `server` | object or null | `{ id, name, status }`: where new websites and apps go. | | `userId`, `user` | | The sign-in account: `{ id, email, isActive, twoFactorEnabled, lastLoginAt }` on single-customer responses. | | `usage` | object | Counts, `diskBytes`, `diskMb`, `disk` per kind, the plan's `limits`, and `over`: the limits it is over (for example after moving to a smaller plan; nothing is deleted, new things are refused). | ## List customers `GET /api/v1/hosting/customers` — Permission: customers.read — Token scope: read Returns customers a page at a time, with their usage. Removed accounts are listed only with `status=terminated`. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Part of the name, email, company or external id. | | `status` | string | No | `active`, `suspended` or `terminated`. | | `planId`, `serverId` | string (UUID) | No | Only customers on this plan or server. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `createdAt` (default) or `name`; `desc` (default) or `asc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/hosting/customers?status=suspended" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.hosting.customers({ status: 'suspended' }); ``` **Response** `200 OK`: `{ items, pagination }` of [customers](https://docs.vaultpanel.net/api-reference/hosting#the-customer-object). ## Create a customer `POST /api/v1/hosting/customers` — Permission: customers.manage — Token scope: customers Creates the account and its sign-in. Without a password, an invite link is returned (and emailed when [panel email](https://docs.vaultpanel.net/api-reference/settings) is set up) so the customer chooses one. Without a server, the panel picks one: a connected server of the plan's server group (or any server), online first, then the one with the fewest customers. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 120 characters. | | `email` | string | Yes | Unique among accounts. | | `planId` | string (UUID) | Yes | A plan offered to new customers. | | `company` | string | No | Up to 120 characters. | | `serverId` | string (UUID) or null | No | A connected server. | | `externalId` | string | No | The billing system's id: letters, digits and `. _ : -`, up to 100. Unique. | | `password` | string | No | The account's password. | | `notes` | string | No | Up to 1000 characters, for staff. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Ada Customer", "email": "ada@example.org", "planId": "a0b1c2d3-e4f5-4a6b-8c7d-8e9f0a1b2c3d" }' ``` **JavaScript** ```js const { customer, inviteUrl } = await panel.hosting.createCustomer({ name: 'Ada Customer', email: 'ada@example.org', planId: 'a0b1c2d3-e4f5-4a6b-8c7d-8e9f0a1b2c3d', }); ``` **Response** `201 Created` ```json { "success": true, "data": { "customer": { "id": "c1d2e3f4-…", "name": "Ada Customer", "email": "ada@example.org", "status": "active", "plan": { "id": "a0b1c2d3-…", "name": "Starter" } }, "inviteUrl": "https://panel.example.com/reset-password#token=…", "inviteExpiresAt": "2026-11-17T12:00:00.000Z", "email": { "sent": true, "to": "ada@example.org" } }, "message": "Customer created. The invite link was emailed to ada@example.org.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `EXTERNAL_ID_TAKEN` | Another customer has this external id (`details.customerId`). | | 409 | `NO_SERVER` | No connected server to put the account on. | | 409 | `CONFLICT` | The email or external id was just taken. | | 422 | `VALIDATION_ERROR` | The email is taken, the plan is not offered to new customers, the server is not connected, or another invalid field. | ## Get a customer `GET /api/v1/hosting/customers/:id` — Permission: customers.read — Token scope: read Returns the customer with `planDetail` (the full plan), `resources` (its `websites`, `applications`, `databases` and `databaseUsers`, up to 500 each) and `ports` (its app ports). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const customer = await panel.hosting.customer(customerId); ``` **Response** `200 OK`: the customer with `planDetail`, `resources` and `ports`. `404 NOT_FOUND` when there is none. ## Update a customer `PATCH /api/v1/hosting/customers/:id` — Permission: customers.manage — Token scope: customers Changes any of `name`, `email`, `company`, `serverId`, `externalId` and `notes` (send at least one). The name and email also change on the sign-in account. Moving to another server moves the account's free app ports there. A removed account can change only its notes. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f \ -X PATCH \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "company": "Example Holdings Ltd" }' ``` **JavaScript** ```js await panel.hosting.updateCustomer(customerId, { company: 'Example Holdings Ltd' }); ``` **Response** `200 OK`: the customer, message `Customer saved`. **Errors**: `409 CUSTOMER_REMOVED`, `409 EXTERNAL_ID_TAKEN`, `422 VALIDATION_ERROR`. ## Change the plan `POST /api/v1/hosting/customers/:id/plan` — Permission: customers.manage — Token scope: customers Moves the account to another plan. Nothing is deleted when the account is over the new plan's limits: `over` lists them, and new things are refused until it is back under. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `planId` | string (UUID) | Yes | The new plan. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/plan \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "planId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e" }' ``` **JavaScript** ```js const { customer, over, appsCapped } = await panel.hosting.changePlan(customerId, newPlanId); ``` **Response** `200 OK`: `{ customer, over, appsCapped }`, message `Plan changed`. **Errors**: `409 CUSTOMER_REMOVED`, `422 VALIDATION_ERROR` for an unknown plan. ## Suspend an account `POST /api/v1/hosting/customers/:id/suspend` — Permission: customers.manage — Token scope: customers Signs the account out and refuses its sign-in, turns its websites off, stops its apps and pauses its cron jobs. Suspending again catches what was busy the first time. `warnings` lists anything that could not be turned off. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | string | No | Up to 300 characters. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/suspend \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "reason": "Invoice overdue" }' ``` **JavaScript** ```js const { customer, warnings } = await panel.hosting.suspend(customerId, 'Invoice overdue'); ``` **Response** `200 OK`: `{ customer, warnings }`, message `Account suspended`. **Errors**: `409 CUSTOMER_REMOVED`. ## Unsuspend an account `POST /api/v1/hosting/customers/:id/unsuspend` — Permission: customers.manage — Token scope: customers Lets the account sign in again and turns back on exactly what suspending turned off. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/unsuspend \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { customer, warnings } = await panel.hosting.unsuspend(customerId); ``` **Response** `200 OK`: `{ customer, warnings }`, message `Account unsuspended`. **Errors**: `409 NOT_SUSPENDED`. ## Remove an account `POST /api/v1/hosting/customers/:id/terminate` — Permission: customers.manage — Token scope: customers Closes the account's sign-in and deletes every cron job, app, website, database user, database and backup it owns (with their files), its backup schedules and the DNS zones added for it. The account record is kept with status `terminated`. Calling it again retries anything left. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/terminate \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { queued, warnings } = await panel.hosting.terminate(customerId); ``` **Response** `200 OK` ```json { "success": true, "data": { "customer": { "id": "c1d2e3f4-…", "status": "terminated", "terminatedAt": "2026-11-10T13:00:00.000Z" }, "queued": { "cronJobs": 1, "applications": 1, "websites": 2, "databaseUsers": 2, "databases": 2, "backups": 6 }, "warnings": [] }, "message": "Account removed. Its websites, apps and databases are being deleted.", "requestId": "…" } ``` ## Create a password reset link `POST /api/v1/hosting/customers/:id/password-reset` — Permission: customers.manage — Token scope: customers Creates a link for the customer to set a new password, emailed when panel email is set up. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/password-reset \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { resetUrl, expiresAt } = await panel.request('POST', `/hosting/customers/${customerId}/password-reset`); ``` **Response** `200 OK`: `{ resetUrl, expiresAt, email }`. **Errors**: `409 CUSTOMER_REMOVED`. ## Move a resource to a customer `POST /api/v1/hosting/customers/:id/resources` — Permission: customers.manage — Token scope: customers Gives an existing website, app, database or database user to the account, with what hangs off it (cron jobs, backups, schedules). Move an app rather than its website: the website goes with it. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | string | Yes | `website`, `application`, `database` or `database_user`. | | `resourceId` | string (UUID) | Yes | Its id. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/resources \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "website", "resourceId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d" }' ``` **JavaScript** ```js await panel.request('POST', `/hosting/customers/${customerId}/resources`, { body: { type: 'website', resourceId: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d' }, }); ``` **Response** `200 OK`: `{ customer }`, message `Moved to this customer`. **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such resource. | | 409 | `CUSTOMER_REMOVED` | The account was removed. | | 409 | `RESOURCE_OWNED` | It belongs to another customer: take it from that account first. | | 409 | `WEBSITE_OWNED_BY_APP` | The website serves an app: move the app instead. | | 409 | `PANEL_WEBSITE` | The website puts VaultPanel itself on its domain. | | 422 | `VALIDATION_ERROR` | A database user with access to another account's database, or an app on another customer's port. | ## Take a resource back `DELETE /api/v1/hosting/customers/:id/resources/:type/:resourceId` — Permission: customers.manage — Token scope: customers Takes a website, app, database or database user back from the account to staff. **Example request** **cURL** ```bash curl -X DELETE \ https://panel.example.com/api/v1/hosting/customers/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f/resources/website/1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('DELETE', `/hosting/customers/${customerId}/resources/website/${websiteId}`); ``` **Response** `200 OK`: `{ customer }`, message `Taken back from this customer`. **Errors**: `404 NOT_FOUND` when it is not this customer's, `409 WEBSITE_OWNED_BY_APP`. ## Get the financial report `GET /api/v1/hosting/reports/financial` — Permission: customers.read — Token scope: read What accounts are worth at their plans' prices: expected amounts, never payments (VaultPanel takes none). Currencies are never mixed. See [Financial report](https://docs.vaultpanel.net/guides/hosting-and-billing/financial-report). **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `months` | integer | No | 1 to 36. Default 12. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/hosting/reports/financial?months=6" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const report = await panel.request('GET', '/hosting/reports/financial', { query: { months: 6 } }); ``` **Response** `200 OK` ```json { "success": true, "data": { "generatedAt": "2026-11-10T13:00:00.000Z", "months": 6, "from": "2026-06-01T00:00:00.000Z", "summary": { "activeAccounts": 42, "suspendedAccounts": 3, "unpricedAccounts": 1, "newAccounts": 12, "removedAccounts": 2, "byCurrency": [{ "currency": "USD", "monthlyCents": 37800, "yearlyCents": 453600, "atRiskCents": 2700, "payingAccounts": 41 }] }, "plans": [ { "id": "a0b1c2d3-…", "name": "Starter", "isActive": true, "billingCycle": "monthly", "priceCents": 900, "currency": "USD", "monthlyCents": 900, "activeAccounts": 42, "suspendedAccounts": 3, "monthlyTotalCents": 37800, "atRiskCents": 2700 } ], "history": [ { "month": "2026-11", "newAccounts": 2, "removedAccounts": 0, "suspensions": 1, "accountsAtEnd": 45, "monthlyByCurrency": { "USD": 40500 } } ] }, "message": "OK", "requestId": "…" } ``` `monthlyCents` spreads a plan's price over one month (`0` for free plans, `null` without a price). `atRiskCents` is what suspended accounts would bring. `monthlyByCurrency` prices the accounts at the end of each month at their current plan. ## List billing API keys `GET /api/v1/hosting/api-keys` — Permission: billing.manage — Token scope: full Returns the `vpk_` keys billing systems use with the [Billing API](https://docs.vaultpanel.net/api-reference/billing), active ones first. The key itself is never returned again, only its `prefix`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/api-keys \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.request('GET', '/hosting/api-keys'); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "e5f6a7b8-…", "name": "WHMCS", "prefix": "vpk_Xr8kQ2mN", "scopes": ["billing"], "createdBy": { "id": "3c4d5e6f-…", "email": "owner@example.com" }, "lastUsedAt": "2026-11-10T12:58:00.000Z", "lastUsedIp": "198.51.100.20", "revokedAt": null, "createdAt": "2026-10-05T09:00:00.000Z" } ] }, "message": "OK", "requestId": "…" } ``` ## Create a billing API key `POST /api/v1/hosting/api-keys` — Permission: billing.manage — Token scope: full Creates a key. The key (`vpk_…`) is in this response only; the panel keeps only its hash. Up to 50 active keys. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 100 characters. | | `scopes` | string[] | No | `["billing"]` (the default and only scope): list plans, and create, suspend, unsuspend, change the plan of and remove customer accounts. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/api-keys \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "WHMCS" }' ``` **JavaScript** ```js const { apiKey, key } = await panel.request('POST', '/hosting/api-keys', { body: { name: 'WHMCS' } }); ``` **Response** `201 Created`: `{ apiKey, key }`, message `API key created. Copy it now: it is not shown again.` **Errors**: `409 TOO_MANY_KEYS` with 50 active keys. ## Revoke a billing API key `POST /api/v1/hosting/api-keys/:id/revoke` — Permission: billing.manage — Token scope: full Revokes a key at once. Revoking a revoked key changes nothing. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/hosting/api-keys/e5f6a7b8-c9d0-4e1f-a2b3-c4d5e6f7a8b9/revoke \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const apiKey = await panel.request('POST', `/hosting/api-keys/${keyId}/revoke`); ``` **Response** `200 OK`: the key with `revokedAt`, message `API key revoked`. **Errors**: `404 NOT_FOUND`. --- # Billing API URL: https://docs.vaultpanel.net/api-reference/billing > API reference for billing systems such as WHMCS and Blesta - plans, creating, suspending, upgrading and removing hosting accounts, passwords and single sign-on links. The billing API lets a billing system (WHMCS, Blesta or your own) manage hosting accounts. It authenticates with a billing API key, not a user: create one under **Hosting > Billing API** in the panel, or with [Create a billing API key](https://docs.vaultpanel.net/api-reference/hosting#create-a-billing-api-key). The key is shown once; the panel keeps only its hash. Every call is recorded in the audit log with the key as the actor. The ready-made [WHMCS module](https://docs.vaultpanel.net/guides/hosting-and-billing/whmcs) uses this API. For the concepts, see [Billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/billing/plans` | [List plans](https://docs.vaultpanel.net/api-reference/billing#list-plans) | | GET | `/api/v1/billing/accounts` | [List accounts](https://docs.vaultpanel.net/api-reference/billing#list-accounts) | | POST | `/api/v1/billing/accounts` | [Create an account](https://docs.vaultpanel.net/api-reference/billing#create-an-account) | | GET | `/api/v1/billing/accounts/:ref` | [Get an account](https://docs.vaultpanel.net/api-reference/billing#get-an-account) | | POST | `/api/v1/billing/accounts/:ref/suspend` | [Suspend an account](https://docs.vaultpanel.net/api-reference/billing#suspend-an-account) | | POST | `/api/v1/billing/accounts/:ref/unsuspend` | [Unsuspend an account](https://docs.vaultpanel.net/api-reference/billing#unsuspend-an-account) | | POST | `/api/v1/billing/accounts/:ref/plan` | [Change the plan](https://docs.vaultpanel.net/api-reference/billing#change-the-plan) | | POST | `/api/v1/billing/accounts/:ref/password` | [Set the password](https://docs.vaultpanel.net/api-reference/billing#set-the-password) | | POST | `/api/v1/billing/accounts/:ref/login` | [Create a sign-in link](https://docs.vaultpanel.net/api-reference/billing#create-a-sign-in-link) | | DELETE | `/api/v1/billing/accounts/:ref` | [Remove an account](https://docs.vaultpanel.net/api-reference/billing#remove-an-account) | ## Authentication Send the key as a bearer token. No cookie or CSRF token is involved. ```http Authorization: Bearer vpk_… ``` A missing, unknown or revoked key is refused with `401 UNAUTHENTICATED`. Each address may make 120 calls a minute (`429 RATE_LIMITED` beyond that). The `billing` scope allows reading and managing customer accounts and nothing else. `:ref` is the account's VaultPanel id (a UUID) or the `externalId` your billing system gave it when creating it, such as its WHMCS service id. The PHP examples on this page use this small helper: ```php $method, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, ]); $reply = json_decode((string) curl_exec($ch), true); curl_close($ch); if (!is_array($reply) || empty($reply['success'])) { throw new RuntimeException($reply['error']['message'] ?? 'VaultPanel could not be reached'); } return $reply['data']; } ``` ## List plans `GET /api/v1/billing/plans` — Auth: billing — Permission: customers.read Returns the plans offered to new accounts (`isActive` plans), by name, with their price, limits and app caps. See [the plan object](https://docs.vaultpanel.net/api-reference/hosting#the-plan-object). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/plans \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php $plans = vaultpanel('GET', '/plans')['items']; ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "a0b1c2d3-…", "name": "Starter", "description": "", "isActive": true, "priceCents": 900, "currency": "USD", "billingCycle": "monthly", "serverGroup": null, "limits": { "websites": 5, "subdomains": 10, "applications": 2, "databases": 5, "databaseUsers": 5, "cronJobs": 10, "diskMb": 10240 }, "appCaps": { "appMemoryMb": 512, "appCpuPercent": 100 } } ] }, "message": "OK", "requestId": "…" } ``` ## List accounts `GET /api/v1/billing/accounts` — Auth: billing — Permission: customers.read Returns accounts a page at a time with their `usage` (counts, `diskMb` and the plan's `limits`), for usage syncs. Removed accounts are listed only with `status=terminated`. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `search` | string | No | Part of the name, email, company or external id. | | `status` | string | No | `active`, `suspended` or `terminated`. | | `planId`, `serverId` | string (UUID) | No | Only accounts on this plan or server. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | | `sort`, `order` | string | No | `createdAt` (default) or `name`; `desc` (default) or `asc`. | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/billing/accounts?pageSize=100&page=1" \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php $page = 1; do { $data = vaultpanel('GET', '/accounts?' . http_build_query(['page' => $page, 'pageSize' => 100])); foreach ($data['items'] as $account) { // $account['externalId'], $account['usage']['diskMb'], $account['usage']['limits']['diskMb'] } $page++; } while ($page <= $data['pagination']['totalPages']); ``` **Response** `200 OK`: `{ items, pagination }` of [customers](https://docs.vaultpanel.net/api-reference/hosting#the-customer-object). ## Create an account `POST /api/v1/billing/accounts` — Auth: billing — Permission: customers.manage Creates the account and its sign-in, on a server the panel picks unless you give one. Without a password, the response carries an invite link for the customer to choose one. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Up to 120 characters. | | `email` | string | Yes | Unique among accounts. | | `plan` | string | Yes | A plan offered to new accounts, by id or exact name. | | `company` | string | No | Up to 120 characters. | | `externalId` | string | No | Your id for the account (letters, digits and `. _ : -`, up to 100), so you can use it as `:ref`. | | `serverId` | string (UUID) | No | A connected server. | | `password` | string | No | The account's password. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Ada Customer", "email": "ada@example.org", "plan": "Starter", "externalId": "whmcs-1042" }' ``` **PHP** ```php $created = vaultpanel('POST', '/accounts', [ 'name' => 'Ada Customer', 'email' => 'ada@example.org', 'plan' => 'Starter', 'externalId' => 'whmcs-1042', ]); $accountId = $created['customer']['id']; ``` **Response** `201 Created`: `{ customer, inviteUrl, inviteExpiresAt, email }`, message `Account created`. `inviteUrl` is `null` when a password was given. **Errors** | Status | Code | When | | --- | --- | --- | | 409 | `EXTERNAL_ID_TAKEN` | An account already has this external id; `details.customerId` is its id, so a retried create can find it. | | 409 | `NO_SERVER` | No connected server to put the account on. | | 422 | `VALIDATION_ERROR` | The email is taken, no plan has this id or name, the plan is not offered to new accounts, or another invalid field. | ## Get an account `GET /api/v1/billing/accounts/:ref` — Auth: billing — Permission: customers.read Returns the account with its usage, `planDetail`, `resources` and app `ports`, as in [Get a customer](https://docs.vaultpanel.net/api-reference/hosting#get-a-customer). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042 \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php $account = vaultpanel('GET', '/accounts/' . rawurlencode('whmcs-1042')); $diskMb = $account['usage']['diskMb']; ``` **Response** `200 OK`: the account. `404 NOT_FOUND` when no account has this id or external id. ## Suspend an account `POST /api/v1/billing/accounts/:ref/suspend` — Auth: billing — Permission: customers.manage Signs the account out and refuses its sign-in, turns its websites off, stops its apps and pauses its cron jobs. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `reason` | string | No | Up to 300 characters. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042/suspend \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" \ -H "Content-Type: application/json" \ -d '{ "reason": "Overdue on invoice 2291" }' ``` **PHP** ```php vaultpanel('POST', '/accounts/whmcs-1042/suspend', ['reason' => 'Overdue on invoice 2291']); ``` **Response** `200 OK`: `{ customer, warnings }`, message `Account suspended`. **Errors**: `404 NOT_FOUND`, `409 CUSTOMER_REMOVED`. ## Unsuspend an account `POST /api/v1/billing/accounts/:ref/unsuspend` — Auth: billing — Permission: customers.manage Lets the account sign in again and turns back on exactly what suspending turned off. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042/unsuspend \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php vaultpanel('POST', '/accounts/whmcs-1042/unsuspend'); ``` **Response** `200 OK`: `{ customer, warnings }`, message `Account unsuspended`. **Errors**: `404 NOT_FOUND`, `409 NOT_SUSPENDED`. ## Change the plan `POST /api/v1/billing/accounts/:ref/plan` — Auth: billing — Permission: customers.manage Moves the account to another plan (an upgrade or downgrade). Nothing is deleted when it is over the new plan's limits: `over` lists them and new things are refused until it is back under. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `plan` | string | Yes | The new plan, by id or exact name. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042/plan \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" \ -H "Content-Type: application/json" \ -d '{ "plan": "Business" }' ``` **PHP** ```php $result = vaultpanel('POST', '/accounts/whmcs-1042/plan', ['plan' => 'Business']); ``` **Response** `200 OK`: `{ customer, over, appsCapped }`, message `Plan changed`. **Errors**: `404 NOT_FOUND`, `409 CUSTOMER_REMOVED`, `422 VALIDATION_ERROR` when no plan has this id or name. ## Set the password `POST /api/v1/billing/accounts/:ref/password` — Auth: billing — Permission: customers.manage Sets the account's password and signs out its sessions. Without a password, it returns a link for the customer to choose one instead. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `password` | string | No | The new password. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042/password \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" \ -H "Content-Type: application/json" \ -d '{}' ``` **PHP** ```php $link = vaultpanel('POST', '/accounts/whmcs-1042/password', []); // $link['resetUrl'], $link['expiresAt'] ``` **Response** `200 OK`: `{ resetUrl, expiresAt, email }` (all `null` when a password was given), message `Password changed` or `Reset link created`. **Errors**: `404 NOT_FOUND`, `409 CUSTOMER_REMOVED`, `422 VALIDATION_ERROR` for a password that is too short or too long. ## Create a sign-in link `POST /api/v1/billing/accounts/:ref/login` — Auth: billing — Permission: customers.manage A one-time sign-in link for the account's owner, for a "Log in to VaultPanel" button in your client area. It works once, within two minutes, and signs in without the second factor (the key can already set the password). The link opens the panel's `/sso` page, which signs in with `POST /api/v1/auth/sso`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042/login \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php $link = vaultpanel('POST', '/accounts/whmcs-1042/login'); header('Location: ' . $link['url']); ``` **Response** `200 OK` ```json { "success": true, "data": { "url": "https://panel.example.com/sso#token=…", "expiresAt": "2026-11-10T13:02:00.000Z" }, "message": "Sign-in link created", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 404 | `NOT_FOUND` | No such account. | | 409 | `ACCOUNT_SUSPENDED` | The account is suspended, so its owner cannot sign in. | | 409 | `CUSTOMER_REMOVED` | The account was removed. | When the link is opened, `POST /api/v1/auth/sso` answers `LOGIN_LINK_INVALID` for a link that was used, expired or is unknown, and `ACCOUNT_SUSPENDED` when the account was suspended since. Invite and password reset links never accept a sign-in link's token. ## Remove an account `DELETE /api/v1/billing/accounts/:ref` — Auth: billing — Permission: customers.manage Closes the account's sign-in and deletes every website, app, database, database user, cron job and backup it owns. The account record is kept with status `terminated`. Calling it again retries anything left. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/billing/accounts/whmcs-1042 \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_BILLING_KEY" ``` **PHP** ```php $result = vaultpanel('DELETE', '/accounts/whmcs-1042'); // $result['queued'], $result['warnings'] ``` **Response** `200 OK`: `{ customer, queued, warnings }` as in [Remove an account](https://docs.vaultpanel.net/api-reference/hosting#remove-an-account), message `Account removed`. **Errors**: `404 NOT_FOUND`. --- # Plugins URL: https://docs.vaultpanel.net/api-reference/plugins > API reference for installing, approving, updating and removing plugins, their event deliveries, their pages in the panel, and plugin directories. Plugins add features and connect outside services without changing the panel. A plugin has a manifest that says what it is, which permissions it needs, which events it wants and whether it adds a page to the panel. An owner or admin reviews and approves it; the plugin then gets its own `vpp_` token and a signing secret, works through the REST API with the approved scopes only, and receives events signed like [webhooks](https://docs.vaultpanel.net/api-reference/webhooks). Everything here needs `plugins.manage` (owners and admins), except listing and opening plugin pages. Installing, updating a plugin's manifest, replacing its credentials and adding a directory mint credentials, so they are done in the panel by a signed-in person: an API token gets `403 FORBIDDEN`. How to write a plugin (the manifest, calling the API, verifying events and page links) is in [Plugins](https://docs.vaultpanel.net/developers/plugins). | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/plugins` | [List plugins](https://docs.vaultpanel.net/api-reference/plugins#list-plugins) | | GET | `/api/v1/plugins/pages` | [List plugin pages](https://docs.vaultpanel.net/api-reference/plugins#list-plugin-pages) | | POST | `/api/v1/plugins/preview` | [Preview a manifest](https://docs.vaultpanel.net/api-reference/plugins#preview-a-manifest) | | POST | `/api/v1/plugins` | [Install a plugin](https://docs.vaultpanel.net/api-reference/plugins#install-a-plugin) | | GET | `/api/v1/plugins/:id` | [Get a plugin](https://docs.vaultpanel.net/api-reference/plugins#get-a-plugin) | | PUT | `/api/v1/plugins/:id/manifest` | [Update a plugin](https://docs.vaultpanel.net/api-reference/plugins#update-a-plugin) | | POST | `/api/v1/plugins/:id/enable` | [Turn a plugin on](https://docs.vaultpanel.net/api-reference/plugins#turn-a-plugin-on-or-off) | | POST | `/api/v1/plugins/:id/disable` | [Turn a plugin off](https://docs.vaultpanel.net/api-reference/plugins#turn-a-plugin-on-or-off) | | POST | `/api/v1/plugins/:id/rotate-credentials` | [Replace the credentials](https://docs.vaultpanel.net/api-reference/plugins#replace-the-credentials) | | DELETE | `/api/v1/plugins/:id` | [Remove a plugin](https://docs.vaultpanel.net/api-reference/plugins#remove-a-plugin) | | GET | `/api/v1/plugins/:id/deliveries` | [List event deliveries](https://docs.vaultpanel.net/api-reference/plugins#list-event-deliveries) | | POST | `/api/v1/plugins/:id/test` | [Send a test event](https://docs.vaultpanel.net/api-reference/plugins#send-a-test-event) | | POST | `/api/v1/plugins/:id/deliveries/:deliveryId/redeliver` | [Redeliver an event](https://docs.vaultpanel.net/api-reference/plugins#redeliver-an-event) | | GET | `/api/v1/plugins/:id/launch` | [Open a plugin page](https://docs.vaultpanel.net/api-reference/plugins#open-a-plugin-page) | | GET | `/api/v1/plugins/directory` | [List directory plugins](https://docs.vaultpanel.net/api-reference/plugins#list-directory-plugins) | | POST | `/api/v1/plugins/directory/refresh` | [Read every directory again](https://docs.vaultpanel.net/api-reference/plugins#read-every-directory-again) | | POST | `/api/v1/plugins/directory/sources` | [Add a directory](https://docs.vaultpanel.net/api-reference/plugins#add-a-directory) | | POST | `/api/v1/plugins/directory/sources/:directoryId/refresh` | [Read a directory again](https://docs.vaultpanel.net/api-reference/plugins#read-a-directory-again) | | DELETE | `/api/v1/plugins/directory/sources/:directoryId` | [Remove a directory](https://docs.vaultpanel.net/api-reference/plugins#remove-a-directory) | ## Plugin tokens A plugin calls the API with its own token, sent like an API token: ```http Authorization: Bearer vpp_… ``` The token acts with the plugin's approved scopes only: `read`, `logs`, `deploy`, `manage`, `servers` or `customers`, never `full`, so a plugin can never manage users, roles, panel settings or other plugins. `GET /api/v1/auth/me` answers with `plugin` instead of `user`. A turned-off plugin's token is refused with `401 UNAUTHENTICATED`. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens) for what each scope allows. ## The plugin object | Field | Type | Description | | --- | --- | --- | | `id`, `slug` | string | The installation, and the manifest's `id`. | | `name`, `version`, `description`, `author`, `homepage` | string | From the manifest. | | `manifestUrl` | string or null | Where the manifest was read from; `null` when it was pasted. | | `scopes`, `permissionCount` | | The approved scopes, and how many permissions they cover. | | `events` | string[] | The events it receives. | | `webhook` | object or null | `{ url, lastDelivery }` when it receives events. | | `page` | object or null | `{ title, url, icon }` when it adds a page. | | `enabled` | boolean | Turned off plugins get no events and their token is refused. | | `tokenPrefix` | string | The start of its token; the token itself is never returned again. | | `installedBy`, `approvedAt` | | Who installed it and when its permissions were approved. | | `lastUsedAt`, `lastUsedIp`, `useCount` | | Its token's use. | | `update` | object or null | `{ version, directory }` when a directory lists a newer version. | ## List plugins `GET /api/v1/plugins` — Permission: plugins.manage — Token scope: full Returns installed plugins by name, never their credentials, and `max` (50). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items, max } = await panel.plugins.list(); ``` **Response** `200 OK` ```json { "success": true, "data": { "items": [ { "id": "2a3b4c5d-…", "slug": "status-board", "name": "Status Board", "version": "1.1.0", "manifestUrl": "https://status.example.com/manifest.json", "scopes": ["read"], "permissionCount": 16, "events": ["server.offline", "server.online"], "webhook": { "url": "https://status.example.com/events", "lastDelivery": { "at": "2026-11-10T09:55:01.000Z", "status": "succeeded" } }, "page": { "title": "Status Board", "url": "https://status.example.com/", "icon": "activity" }, "enabled": true, "tokenPrefix": "vpp_3kQ9xT2a", "update": null } ], "max": 50 }, "message": "OK", "requestId": "…" } ``` ## List plugin pages `GET /api/v1/plugins/pages` — Auth: session Any signed-in staff member: the pages of turned-on plugins they may open, for the sidebar. A page is shown only to people who hold every permission the plugin's scopes cover, so nobody gains anything by going through a plugin's page. API tokens get an empty list; hosting customers cannot reach `/plugins` (`403 FORBIDDEN`). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/pages \ -b "vp_session=…" ``` **JavaScript** ```js const { items } = await fetch('/api/v1/plugins/pages', { credentials: 'include' }) .then((r) => r.json()) .then((r) => r.data); ``` **Response** `200 OK`: `{ items: [{ id, slug, name, title, icon }] }`. ## Preview a manifest `POST /api/v1/plugins/preview` — Permission: plugins.manage — Token scope: full Checks a manifest and explains it before installing: which scopes and permissions it asks for, which of those your account does not have (`notGranted`), the events it wants and any its permissions do not cover, and warnings. `installed` is the plugin already installed with the same id, if any; `listedIn` lists the directory entries for the same id, with `extraPermissions` and `extraEvents` the manifest asks for beyond them. **Request body**: give one of the two. | Field | Type | Required | Description | | --- | --- | --- | --- | | `manifestUrl` | string | One of | A full `http` or `https` URL the panel fetches (up to 64 KB). | | `manifest` | object | One of | The manifest itself. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/preview \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "manifestUrl": "https://status.example.com/manifest.json" }' ``` **JavaScript** ```js const { manifest, review, installed } = await panel.plugins.preview({ manifestUrl: 'https://status.example.com/manifest.json', }); ``` **Response** `200 OK`: `{ manifest, manifestUrl, review: { scopes, permissions, notGranted, events, eventsNotCovered, warnings }, installed, listedIn }`. **Errors** | Status | Code | When | | --- | --- | --- | | 422 | `VALIDATION_ERROR` | The manifest is invalid; fields are reported under `manifest.`. Both or neither of `manifestUrl` and `manifest`. | | 422 | `MANIFEST_UNREACHABLE` | The manifest URL could not be fetched, is too large or resolves to an address plugins may not reach. | ## Install a plugin `POST /api/v1/plugins` — Auth: session — Permission: plugins.manage Installs a plugin and approves its permissions. `approvedPermissions` must repeat exactly the manifest's `permissions`: you approve the whole request, not a part. The response holds the plugin's token and signing secret, the only time they are shown; give them to the plugin. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `manifestUrl` or `manifest` | | Yes | As in [Preview a manifest](https://docs.vaultpanel.net/api-reference/plugins#preview-a-manifest). | | `approvedPermissions` | string[] | Yes | The manifest's `permissions`, exactly. | **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins \ -X POST \ -b "vp_session=…" \ -H "X-CSRF-Token: $CSRF_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "manifestUrl": "https://status.example.com/manifest.json", "approvedPermissions": ["read"] }' ``` **JavaScript** ```js // In the panel, signed in: API tokens cannot install plugins. const res = await fetch('/api/v1/plugins', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': csrfToken }, body: JSON.stringify({ manifestUrl: 'https://status.example.com/manifest.json', approvedPermissions: ['read'] }), }); const { plugin, credentials } = (await res.json()).data; ``` **Response** `201 Created` ```json { "success": true, "data": { "plugin": { "id": "2a3b4c5d-…", "slug": "status-board", "name": "Status Board", "enabled": true, "tokenPrefix": "vpp_3kQ9xT2a" }, "credentials": { "token": "vpp_…", "signingSecret": "whsec_…" } }, "message": "Plugin installed. Copy its token and signing secret now: they are not shown again.", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Called with an API token, or approving permissions your own account does not have. | | 409 | `PLUGIN_INSTALLED` | A plugin with the same id is installed: update it instead. | | 409 | `TOO_MANY_PLUGINS` | 50 plugins are installed. | | 422 | `VALIDATION_ERROR`, `MANIFEST_UNREACHABLE` | As in [Preview a manifest](https://docs.vaultpanel.net/api-reference/plugins#preview-a-manifest), or `approvedPermissions` does not match, or events its permissions do not cover. | ## Get a plugin `GET /api/v1/plugins/:id` — Permission: plugins.manage — Token scope: full Returns `{ plugin, manifest, review }`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { plugin, manifest, review } = await panel.plugins.get(pluginId); ``` **Response** `200 OK`. `404 NOT_FOUND` when there is none. ## Update a plugin `PUT /api/v1/plugins/:id/manifest` — Auth: session — Permission: plugins.manage Updates the plugin from a new manifest, with its permissions approved again. With neither `manifestUrl` nor `manifest`, the panel fetches the plugin's manifest URL again (a plugin installed from a pasted manifest needs the new one pasted). The manifest's `id` must stay the same. **Request body**: `manifestUrl` or `manifest` (optional), and `approvedPermissions` (required), as in [Install a plugin](https://docs.vaultpanel.net/api-reference/plugins#install-a-plugin). **Response** `200 OK`: `{ plugin }`, message `Plugin updated`. **Errors**: those of [Install a plugin](https://docs.vaultpanel.net/api-reference/plugins#install-a-plugin), and `422 VALIDATION_ERROR` when the manifest is for another plugin. ## Turn a plugin on or off `POST /api/v1/plugins/:id/enable` — Permission: plugins.manage — Token scope: full `POST /api/v1/plugins/:id/disable` — Permission: plugins.manage — Token scope: full A turned-off plugin receives no events, its page is hidden and its token is refused. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d/disable \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.plugins.disable(pluginId); await panel.plugins.enable(pluginId); ``` **Response** `200 OK`: `{ plugin }`, message `Plugin turned on` or `Plugin turned off`. ## Replace the credentials `POST /api/v1/plugins/:id/rotate-credentials` — Auth: session — Permission: plugins.manage Makes a new token and signing secret. The old ones stop working at once. **Response** `200 OK`: `{ plugin, credentials: { token, signingSecret } }`, message `New token and signing secret made. The old ones no longer work.` **Errors**: `403 FORBIDDEN` with an API token. ## Remove a plugin `DELETE /api/v1/plugins/:id` — Permission: plugins.manage — Token scope: full Removes the plugin and its token, with its events webhook and that webhook's deliveries. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.plugins.remove(pluginId); ``` **Response** `200 OK`: `data` is `null`, message `Plugin removed`. ## List event deliveries `GET /api/v1/plugins/:id/deliveries` — Permission: plugins.manage — Token scope: full The events sent to the plugin, newest first, in the same shape as [webhook deliveries](https://docs.vaultpanel.net/api-reference/webhooks#list-deliveries). A plugin's events webhook does not appear on the Webhooks page, and changing it there answers `409 PLUGIN_WEBHOOK`. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | No | `pending`, `succeeded` or `failed`. | | `page`, `pageSize` | integer | No | Page from 1; 1 to 100 per page (default 25). | **Example request** **cURL** ```bash curl "https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d/deliveries?status=failed" \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { items } = await panel.plugins.deliveries(pluginId, { status: 'failed' }); ``` **Response** `200 OK`: `{ items, pagination }`. ## Send a test event `POST /api/v1/plugins/:id/test` — Permission: plugins.manage — Token scope: full Sends a test event to the plugin now and returns `{ delivery }` with the outcome. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d/test \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { delivery } = await panel.plugins.test(pluginId); ``` **Response** `200 OK`: `{ delivery }`. **Errors**: `409 PLUGIN_DISABLED` for a turned-off plugin, `409 NO_EVENTS` when its manifest has no `webhookUrl` or no events. ## Redeliver an event `POST /api/v1/plugins/:id/deliveries/:deliveryId/redeliver` — Permission: plugins.manage — Token scope: full Sends a finished delivery again and returns `{ delivery }`. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d/deliveries/9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c2d/redeliver \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.request('POST', `/plugins/${pluginId}/deliveries/${deliveryId}/redeliver`); ``` **Response** `200 OK`: `{ delivery }`. **Errors**: `404 NOT_FOUND`, `409 PLUGIN_DISABLED`, `409 DELIVERY_PENDING` while it is still being tried. ## Open a plugin page `GET /api/v1/plugins/:id/launch` — Auth: session Any signed-in staff member who may see the plugin's page: the page's URL with `vp_` parameters naming the viewer and a signature (`vp_sig`, HMAC-SHA256 with the plugin's signing secret), good for 5 minutes. The panel opens it in a frame. See [Plugins](https://docs.vaultpanel.net/developers/plugins) for verifying it. **Query parameters** | Name | Type | Required | Description | | --- | --- | --- | --- | | `theme` | string | No | `light` (default) or `dark`, passed on as `vp_theme`. | **Response** `200 OK`: `{ plugin: { id, slug, name, title, icon }, url, origin }`. **Errors**: `404 NOT_FOUND` when the plugin is off, has no page, or you may not see it. ## List directory plugins `GET /api/v1/plugins/directory` — Permission: plugins.manage — Token scope: full Plugin directories are lists of plugins published as JSON by whoever maintains them. The panel reads each directory when it is added and again every 12 hours, keeping the last good copy. This returns `{ directories, items, categories, max }`: each item is a directory entry with its `directory`, `installed` (`{ id, version, enabled }` or `null`) and `updateAvailable`. Up to 10 directories; none is built in. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/directory \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js const { directories, items } = await panel.plugins.directory(); ``` **Response** `200 OK`. ## Read every directory again `POST /api/v1/plugins/directory/refresh` — Permission: plugins.manage — Token scope: full Reads every directory again and answers like [List directory plugins](https://docs.vaultpanel.net/api-reference/plugins#list-directory-plugins). **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/directory/refresh \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.plugins.refreshDirectories(); ``` **Response** `200 OK`. ## Add a directory `POST /api/v1/plugins/directory/sources` — Auth: session — Permission: plugins.manage Reads a directory and adds it. Nothing is saved when it cannot be read. The file may be up to 1 MB and lists up to 500 plugins; the format is in [Plugins](https://docs.vaultpanel.net/developers/plugins). **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | Yes | A full `http` or `https` URL. | **Response** `201 Created`: `{ directory }`, message `Plugin directory added`. **Errors** | Status | Code | When | | --- | --- | --- | | 403 | `FORBIDDEN` | Called with an API token. | | 409 | `DIRECTORY_ADDED` | It is already added. | | 409 | `TOO_MANY_DIRECTORIES` | 10 directories are added. | | 422 | `DIRECTORY_UNREACHABLE`, `VALIDATION_ERROR` | It could not be fetched, or is not a valid directory (fields under `directory.`). | ## Read a directory again `POST /api/v1/plugins/directory/sources/:directoryId/refresh` — Permission: plugins.manage — Token scope: full Reads one directory again. When it cannot be read, the answer is `422` with the reason, and the last good copy stays. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/directory/sources/8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e/refresh \ -X POST \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.plugins.refreshDirectory(directoryId); ``` **Response** `200 OK`: `{ directory }`, message `Plugin directory read again`. ## Remove a directory `DELETE /api/v1/plugins/directory/sources/:directoryId` — Permission: plugins.manage — Token scope: full Removes the directory. Plugins installed from it stay installed. **Example request** **cURL** ```bash curl https://panel.example.com/api/v1/plugins/directory/sources/8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e \ -X DELETE \ -H "Authorization: Bearer $VAULTPANEL_TOKEN" ``` **JavaScript** ```js await panel.plugins.removeDirectory(directoryId); ``` **Response** `200 OK`: `data` is `null`, message `Plugin directory removed`. --- # Agent protocol URL: https://docs.vaultpanel.net/api-reference/agent > How the VaultPanel agent talks to the panel - enrollment, Ed25519-signed requests, heartbeats, the job long poll, signed job envelopes and result reporting. The `/agent` endpoints are what the agent on each server uses to talk to the panel. They are documented for understanding and auditing how VaultPanel trusts its servers, not for building other clients: use the agent that ships with the panel. For installing and running the agent, see [Agent](https://docs.vaultpanel.net/developers/agent) and [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). > **Internal API:** These endpoints authenticate agents only. Session cookies, API tokens and billing keys are not accepted on them, and they may change between releases together with the agent. | Method | Path | Description | | --- | --- | --- | | GET | `/api/v1/agent/install.sh` | [The install script](https://docs.vaultpanel.net/api-reference/agent#download-the-agent) | | GET | `/api/v1/agent/package-rs/:arch` | [The agent program](https://docs.vaultpanel.net/api-reference/agent#download-the-agent) | | GET | `/api/v1/agent/panel-cert.pem` | [The panel's certificate](https://docs.vaultpanel.net/api-reference/agent#download-the-agent) | | POST | `/api/v1/agent/register` | [Register an agent](https://docs.vaultpanel.net/api-reference/agent#register-an-agent) | | POST | `/api/v1/agent/heartbeat` | [Send a heartbeat](https://docs.vaultpanel.net/api-reference/agent#send-a-heartbeat) | | GET | `/api/v1/agent/jobs/next` | [Wait for the next job](https://docs.vaultpanel.net/api-reference/agent#wait-for-the-next-job) | | POST | `/api/v1/agent/jobs/:id/start` | [Report a job started](https://docs.vaultpanel.net/api-reference/agent#report-a-job-started) | | POST | `/api/v1/agent/jobs/:id/logs` | [Send job logs](https://docs.vaultpanel.net/api-reference/agent#send-job-logs) | | POST | `/api/v1/agent/jobs/:id/result` | [Report a job's result](https://docs.vaultpanel.net/api-reference/agent#report-a-jobs-result) | | POST | `/api/v1/agent/backups/:id/chunks` | [Send a backup for download](https://docs.vaultpanel.net/api-reference/agent#transfer-files) | | GET | `/api/v1/agent/uploads/:id/chunks/:offset` | [Fetch an uploaded file](https://docs.vaultpanel.net/api-reference/agent#transfer-files) | | POST | `/api/v1/agent/downloads/:id/chunks` | [Send a file for download](https://docs.vaultpanel.net/api-reference/agent#transfer-files) | | POST | `/api/v1/agent/cron-runs` | [Report cron runs](https://docs.vaultpanel.net/api-reference/agent#report-cron-runs) | ## How the agent is trusted 1. An admin adds a server. The panel creates a one-time enrollment token (stored hashed, valid for 60 minutes by default) and an install command. 2. The install script downloads the agent from the panel, and the agent registers: it makes an Ed25519 key pair, sends the public key with the token, and receives its agent id and the panel's job-signing public key, which it pins. 3. Every later request is signed with the agent's private key. The panel stores only the public key, checks each signature, a clock window and a single-use nonce. 4. The agent connects out to the panel; servers need no inbound port. It sends a heartbeat every 15 seconds and long-polls for jobs. 5. Every job is a signed envelope. The agent refuses envelopes that are unsigned, tampered with, addressed to another server, expired or already run, checks the parameters again against its own allow-list, and runs fixed commands without a shell. Removing a server, or registering a new agent for it, revokes the old agent; a revoked agent stops. There is no endpoint that runs arbitrary commands, on the panel or the agent. ## Transport Agent endpoints from `/register` on require HTTPS, refused with `403 INSECURE_TRANSPORT` otherwise. Plain HTTP is accepted only straight over loopback (the agent on the panel's own server, never through a proxy), or when the panel's `.env` sets `VAULTPANEL_ALLOW_INSECURE_AGENTS` for development. With the panel's self-signed certificate, the install command carries the certificate's public key pin; the agent saves the certificate as `/etc/vaultpanel-agent/panel-ca.pem` and trusts exactly it. ## Signed requests Every endpoint after `/register` needs four headers: | Header | Value | | --- | --- | | `X-VaultPanel-Agent-Id` | The agent id from registration (a UUID). | | `X-VaultPanel-Timestamp` | The time in milliseconds since the Unix epoch. | | `X-VaultPanel-Nonce` | 16 to 64 random URL-safe characters, never reused. | | `X-VaultPanel-Signature` | The base64 Ed25519 signature of the signing string. | The signing string is five lines joined with `\n`: the method in capitals, the full path with its query (`/api/v1/agent/heartbeat`), the timestamp, the nonce, and the hex SHA-256 of the raw body (of an empty string when there is none). This is how the agent builds it: ```rust /// METHOD, PATH, TIMESTAMP, NONCE and the body's SHA-256, joined by " ". pub fn signing_string(method: &str, path: &str, timestamp: &str, nonce: &str, body: &[u8]) -> String { [method.to_ascii_uppercase().as_str(), path, timestamp, nonce, sha256_hex(body).as_str()].join(" ") } pub fn sign_request(agent_id: &str, key: &SigningKey, method: &str, path: &str, body: &[u8]) -> std::io::Result { let timestamp = now_ms().to_string(); // 18 random bytes as base64url: 24 characters of [A-Za-z0-9_-], never reused. let nonce = base64url_encode(&random_bytes::<18>()?); let message = signing_string(method, path, ×tamp, &nonce, body); let signature = base64_encode(&key.sign(message.as_bytes())); Ok(SignedHeaders { agent_id: agent_id.to_string(), timestamp, nonce, signature }) } ``` `SignedHeaders` carries the four values as the headers above. The panel refuses: | Status | Code | When | | --- | --- | --- | | 401 | `UNAUTHENTICATED` | A header is missing or malformed, the signature does not verify, or the nonce was already used (each is accepted once, for 15 minutes). | | 401 | `CLOCK_SKEW` | The timestamp is more than 5 minutes from the panel's clock: check the server's time. | | 401 | `AGENT_REVOKED` | The agent is not registered, was revoked, or its server was removed. | ## Download the agent `GET /api/v1/agent/install.sh` — Auth: public `GET /api/v1/agent/package-rs/:arch` — Auth: public `GET /api/v1/agent/panel-cert.pem` — Auth: public Public, and limited to 60 downloads a minute per address. `install.sh` is the agent installer the **Add server** command runs. `package-rs/x64` and `package-rs/arm64` are the agent itself, one program for each CPU type, with its version in `X-Agent-Version` and its SHA-256 in `X-Content-SHA256` so agent updates can check it (`404 AGENT_PACKAGE_MISSING` when the panel has no program for that CPU type). `panel-cert.pem` is the certificate the panel serves HTTPS with, with its public key pin in `X-Panel-Pin` (`404 NO_PANEL_CERTIFICATE` when the panel has no certificate of its own). ## Register an agent `POST /api/v1/agent/register` — Auth: Enrollment token in the body Exchanges a one-time enrollment token for an agent id. Limited to 30 attempts an hour per address. Registering again for the same server replaces, and revokes, its previous agent. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `enrollmentToken` | string | Yes | The token from the install command (`vpe_…`). | | `publicKey` | string | Yes | The agent's Ed25519 public key, PEM encoded. | | `agentVersion` | string | Yes | The agent's version. | | `system` | object | Yes | `hostname`, and optionally `os`, `kernel`, `architecture`, `cpuCores`, `memoryTotalBytes`, `diskTotalBytes`, `uptimeSeconds` and `timezone`. | **Response** `201 Created` ```json { "success": true, "data": { "agentId": "6f7a8b9c-…", "serverId": "9b2e7c1a-…", "panelPublicKey": "-----BEGIN PUBLIC KEY-----\n…\n-----END PUBLIC KEY-----\n", "heartbeatIntervalSeconds": 15 }, "message": "Agent registered", "requestId": "…" } ``` **Errors** | Status | Code | When | | --- | --- | --- | | 401 | `INVALID_ENROLLMENT_TOKEN` | The token is invalid, expired or already used. Every failure is recorded in the audit log. | | 403 | `INSECURE_TRANSPORT` | Not over HTTPS. | | 422 | `VALIDATION_ERROR` | `publicKey` is not a PEM Ed25519 key, or another invalid field. | ## Send a heartbeat `POST /api/v1/agent/heartbeat` — Auth: agent Sent every 15 seconds. It marks the server online and carries what the panel shows about it. Only `agentVersion` and `system` are required; the rest came with later agent versions and every few minutes. | Field | What it reports | | --- | --- | | `agentVersion`, `system` | As in registration. | | `metrics` | CPU, load, memory, swap, disk, network rates, process count and uptime. | | `services`, `filesystems` | Watched systemd services and mounted filesystems. | | `operations` | The operations this agent can run, so the panel offers only those. | | `webStack` | Installed software: NGINX, Certbot, PHP versions, Node.js, Python, PM2, MariaDB, BIND, the mail server, phpMyAdmin and more. | | `certificates`, `addresses` | Certificates on the server, and its IP addresses. | | `applications`, `databases` | App process states and database sizes. | | `backups`, `diskUsage` | Backup files present, and folder sizes. | | `security`, `selfCheck`, `docker` | The security summary, the [self-check](https://docs.vaultpanel.net/guides/servers/self-check) and Docker's state. | **Response** `200 OK` ```json { "success": true, "data": { "heartbeatIntervalSeconds": 15, "panel": { "url": "https://panel.example.com", "serverName": "web-1" } }, "message": "OK", "requestId": "…" } ``` ## Wait for the next job `GET /api/v1/agent/jobs/next` — Auth: agent A long poll: the panel holds the request for up to 20 seconds, answering as soon as a job is ready for this server, or with `204 No Content` when none came. Proxies in front of the panel must allow at least a 60-second read timeout. **Response** `200 OK` with a signed envelope: ```json { "success": true, "data": { "envelope": { "version": 1, "jobId": "e1f2a3b4-…", "operationId": "e1f2a3b4-…:1", "serverId": "9b2e7c1a-…", "type": "SERVICE_RESTART", "params": { "service": "nginx" }, "requestedBy": { "type": "user", "id": "3c4d5e6f-…" }, "attempt": 1, "timeoutSeconds": 120, "issuedAt": "2026-11-10T14:00:00.000Z", "expiresAt": "2026-11-10T14:02:00.000Z" }, "signature": "…" }, "message": "OK", "requestId": "…" } ``` `signature` is the base64 Ed25519 signature, with the panel's job-signing key, of the envelope as canonical JSON (keys sorted at every level, no spaces). An envelope is valid for 120 seconds. The agent verifies the signature with the key it pinned at registration, that `serverId` is its own, that it has not expired and that its `operationId` has not run before. ## Report a job started `POST /api/v1/agent/jobs/:id/start` — Auth: agent Moves a dispatched job to `running`. No body. **Response** `200 OK` with `data: null`. **Errors**: `404 NOT_FOUND` for a job of another server, `409 INVALID_JOB_STATE` when it is not dispatched (`details.status`). ## Send job logs `POST /api/v1/agent/jobs/:id/logs` — Auth: agent Appends output lines to a dispatched or running job, shown live in the panel. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `lines` | object[] | Yes | 1 to 200 `{ stream, message }`: `stream` is `stdout` or `stderr`, `message` up to 8000 characters. | **Response** `200 OK`: `{ accepted }`. A job keeps up to 5000 lines; past that, lines are dropped and a note is added. **Errors**: `404 NOT_FOUND`, `409 INVALID_JOB_STATE`. ## Report a job's result `POST /api/v1/agent/jobs/:id/result` — Auth: agent Finishes a job. The service that owns the job's record (a website, an app, a backup…) applies the result before the agent's next poll is answered, so a follow-up job always sees the result of the one before. **Request body** | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | string | Yes | `succeeded` or `failed`. | | `output` | any | No | The operation's result. Output over 256 KB is dropped and replaced by a note. | | `error` | object | No | `{ code, message }` for a failure. | **Response** `200 OK`, message `Result recorded`. **Errors**: `404 NOT_FOUND`, `409 INVALID_JOB_STATE`. ## Transfer files `POST /api/v1/agent/backups/:id/chunks` — Auth: agent `GET /api/v1/agent/uploads/:id/chunks/:offset` — Auth: agent `POST /api/v1/agent/downloads/:id/chunks` — Auth: agent Files move between a server and the panel in base64 pieces of up to 2 MiB, only while the job that moves them runs: - **Backups for download.** While an `UPLOAD_BACKUP` job runs, the agent posts the backup as `{ offset, data, final }`; the panel answers `{ received, final }`. Pieces must arrive in order (`409 OFFSET_MISMATCH` with `details.expected`), and no more data than the backup holds is accepted. - **Files uploaded to the panel.** While a `FILE_UPLOAD` (file manager), `IMPORT_DATABASE` (database import) or `MIGRATION_INSPECT` (cPanel backup) job runs, the agent fetches the uploaded file from the panel piece by piece; the panel answers `{ offset, data }` (`416 OFFSET_OUT_OF_RANGE` past the end). - **Downloads from the file manager.** While a `FILE_DOWNLOAD` job runs, the agent posts the file as `{ offset, data, final }`; the panel answers `{ received }`. Outside their job, these answer `409 NO_UPLOAD` or `409 NO_DOWNLOAD`. ## Report cron runs `POST /api/v1/agent/cron-runs` — Auth: agent Cron jobs are run by the server's own cron daemon, so they keep running while the panel is down. The agent reports the runs with this request: up to 100 at a time, each `{ runKey, cronId, trigger, status, exitCode, startedAt, finishedAt, durationMs, output }`. A run already recorded (same `runKey`) is skipped, so reporting again is safe. See [Cron jobs](https://docs.vaultpanel.net/api-reference/cron-jobs#list-runs). **Response** `200 OK`: `{ stored }`, the number of new runs recorded. --- # CLI overview URL: https://docs.vaultpanel.net/cli > Install the vaultpanel command-line tool, sign in with an API token, manage profiles for several panels, and use it in CI. `vaultpanel` does from a terminal what the panel does in a browser: list servers, create websites, deploy applications, run containers, take backups and follow jobs. It talks to the [REST API](https://docs.vaultpanel.net/api-reference) with an API token, so it needs no access to the servers themselves and can never do more than the person whose token it carries. The CLI is built on the [JavaScript SDK](https://docs.vaultpanel.net/developers/sdk) and has no other dependencies. ## Install **On the panel server** The CLI comes with every installed panel. On the panel's server, every `vaultpanel` command that is not one of the [server commands](https://docs.vaultpanel.net/cli/server-command) goes to the CLI: ```bash vaultpanel login --url https://panel.example.com vaultpanel servers list ``` **Another computer** On any computer with Node.js 22 or newer, the CLI is packaged as `@vaultpanel/cli`: ```bash npm install -g @vaultpanel/cli # then: vaultpanel --help npx @vaultpanel/cli --help # or without installing ``` > **Note:** On the panel's server, `vaultpanel help` and `vaultpanel version` are server commands: they show the server command's help and the installed panel version. Use `vaultpanel --help` for the CLI's own help. ## Sign in The CLI signs in with an API token, never with your password. ### Create a token In the panel, open **Users & Access > API Tokens** and click **New token**. Give it a **Name**, tick what it may do under **What it may do** (the token's scopes) and choose when it **Expires**. Copy the token: it is shown once. A token always acts as the person who made it, narrowed to its scopes. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens) for the scopes. ### Log in ```bash vaultpanel login --url https://panel.example.com ``` ```text API token: **************** ✓ Signed in to https://panel.example.com as you@example.com (token "Deploy script", profile "default") ``` `login` asks for the token without showing it, checks it against the panel and only then saves it. Tokens start with `vpt_`; anything else is refused before any request. ### Check who you are ```bash vaultpanel whoami ``` It shows the panel, the profile, your name and roles, the token's name and scopes, and how many permissions the token has. The CLI checks the panel's HTTPS certificate like any Node.js program and has no option to skip that check. Use an address with a trusted certificate, such as a [panel domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain#put-the-panel-on-a-domain). With the self-signed certificate of a new install, point Node.js at a copy of that certificate (`/etc/vaultpanel/tls/panel.crt` on the panel's server) with the standard `NODE_EXTRA_CA_CERTS` environment variable. ## Profiles A profile is a panel address and an API token. `login` saves to the `default` profile unless you name another one, so you can work with several panels: ```bash vaultpanel login --url https://staging.example.com --profile staging vaultpanel servers list --profile staging vaultpanel profiles # list saved profiles vaultpanel profiles --use staging # make it the default vaultpanel logout --profile staging # forget it ``` `logout` only removes the profile from the config file. The token stays valid until you revoke it in the panel. ### The config file Profiles are saved in `~/.config/vaultpanel/config.json`, or `$XDG_CONFIG_HOME/vaultpanel/config.json` when `XDG_CONFIG_HOME` is set. The file is written with mode `0600` (its folder `0700`) because it holds tokens. `VAULTPANEL_CONFIG` moves it anywhere else. ```json { "profiles": { "default": { "url": "https://panel.example.com", "token": "vpt_…" }, "staging": { "url": "https://staging.example.com", "token": "vpt_…" } }, "defaultProfile": "default" } ``` ## How the CLI finds the panel and token Each value comes from the first place that has it: | Value | 1. Flag | 2. Environment | 3. Profile | | --- | --- | --- | --- | | Panel address | `--url` | `VAULTPANEL_URL` | the profile's `url` | | API token | `--token` | `VAULTPANEL_TOKEN` | the profile's `token` | | Profile | `--profile` | `VAULTPANEL_PROFILE` | `defaultProfile` in the config file, else `default` | | Environment variable | What it does | | --- | --- | | `VAULTPANEL_URL` | The panel's address. With or without `/api/v1`; `https://` is assumed when no scheme is given. | | `VAULTPANEL_TOKEN` | An API token. | | `VAULTPANEL_PROFILE` | The profile to use. | | `VAULTPANEL_CONFIG` | The path of the config file. | | `XDG_CONFIG_HOME` | The base folder for the config file when `VAULTPANEL_CONFIG` is not set. | | `NO_COLOR` | Turns off colors in the output. | ## In CI Set `VAULTPANEL_URL` and `VAULTPANEL_TOKEN` and skip the config file entirely. Give the token only the scopes the job needs, such as **Deploy** for deployments: ```bash #!/usr/bin/env bash set -euo pipefail export VAULTPANEL_URL=https://panel.example.com export VAULTPANEL_TOKEN="$VAULTPANEL_DEPLOY_TOKEN" # scopes: deploy vaultpanel apps deploy api --watch ``` `--watch` follows the job and the command [exits non-zero](https://docs.vaultpanel.net/cli/output-and-exit-codes#exit-codes) if it fails, so the pipeline fails with it. ## Getting help ```bash vaultpanel --help # every command group and the global flags vaultpanel servers --help # the commands in one group vaultpanel apps deploy --help # one command vaultpanel --version # the CLI's version (the panel's version on the panel server) ``` Short flags: `-h` is `--help`, `-v` is `--version`, `-j` is `--json`, `-q` is `--quiet`, `-f` is `--force` and `-w` is `--watch`. The full list is in [Commands](https://docs.vaultpanel.net/cli/commands). --- # Commands URL: https://docs.vaultpanel.net/cli/commands > Every vaultpanel CLI command, subcommand and flag, with examples, grouped by what they manage. ```text vaultpanel [subcommand] [arguments] [flags] ``` Each command works through the [REST API](https://docs.vaultpanel.net/api-reference) with the token of the current [profile](https://docs.vaultpanel.net/cli#profiles), so it can do only what that token allows. This page covers `@vaultpanel/cli` 0.1.2. > **Note:** CLI 0.1.1 and older send several commands in a form the panel refuses or ignores: `servers services` without `--restart`, `websites ssl` without `--renew`, `websites logs`, `apps logs`, setting variables with `apps env`, `apps rollback` without `--release`, `databases create --user`, and ports and environment variables in `containers deploy`. These work from CLI 0.1.2. `vaultpanel --version` shows which version you have. ## Global flags These work with every command. | Flag | What it does | | --- | --- | | `--url ` | The panel's address. Overrides `VAULTPANEL_URL` and the profile. | | `--token ` | An API token. Overrides `VAULTPANEL_TOKEN` and the profile. | | `--profile ` | Which saved profile to use. | | `--json`, `-j` | Print what the API returned, as JSON, for scripts and `jq`. | | `--quiet`, `-q` | Only print what was asked for (no progress or success lines). | | `--help`, `-h` | Help for the CLI, a command group or one command. | | `--version`, `-v` | The CLI's version. | ## How arguments work **Names, not ids.** Commands take the name of a server, website, app, database, container or cron job: `vaultpanel apps deploy api` finds the app called `api`. An id (a UUID) is used as it is. A name is matched exactly first (ignoring case), then as part of a name. A name that matches more than one thing is an error, never a guess. The lookup reads the first 100 items of the list. **Destructive commands need `--force`.** Anything that deletes, removes, restores, reboots or stops a service refuses to run without it, so a typo in a script does not take a site down. **Long operations are jobs.** Creating websites, deployments, certificates, backups and container changes run in the panel's job queue. These commands print the job id; `--watch` (`-w`) follows the job, prints its log and exits non-zero if it does not succeed. See [jobs and waiting](https://docs.vaultpanel.net/cli/output-and-exit-codes#jobs-and-waiting). **Flag values.** Write `--name value` or `--name=value`. A value that starts with `-` needs the `--name=value` form. `--` ends the flags; everything after it is an argument. **Repeated flags.** From CLI 0.1.2, `--set`, `--unset`, `--env`, `--query`, `--port` and `--ports` can be given more than once, and every value is used: `--set A=1 --set B=2`. Any other flag holds one value: when it is repeated, the last one wins. **Aliases.** Some groups answer to other names too: | Alias | Command | | --- | --- | | `server` | `servers` | | `site`, `sites`, `website` | `websites` | | `app`, `applications` | `apps` | | `db`, `database` | `databases` | | `container`, `docker` | `containers` | | `backup` | `backups` | | `job` | `jobs` | | `alert` | `alerts` | | `token` | `tokens` | | `me` | `whoami` | A command group run without a subcommand, such as `vaultpanel servers`, prints the group's commands. ## Account and tokens ### `login` Save a panel address and API token as a profile. ```bash vaultpanel login [--url https://panel.example.com] [--token vpt_...] [--profile name] ``` Without `--token`, it asks for the token without showing it. The token is checked against the panel before it is saved. Without `--url`, it reuses the profile's saved address. The profile is `--profile`, else `VAULTPANEL_PROFILE`, else `default`. ### `logout` Forget a saved profile. The token stays valid until you revoke it in the panel. ```bash vaultpanel logout [--profile name] ``` ### `whoami` Who the token belongs to and what it may do: the panel, the profile, your name, email and roles, the token's name and scopes, and the number of permissions it has. ```bash vaultpanel whoami ``` ### `profiles` List saved profiles, or choose the default one. ```bash vaultpanel profiles [--use name] ``` | Flag | What it does | | --- | --- | | `--use ` | Make this profile the default. | ### `tokens` List your API tokens: name, prefix, owner, scopes, last use and state (active, revoked or expired). Create and revoke tokens in the panel under **Users & Access > API Tokens**. ```bash vaultpanel tokens [--all] [--scopes] ``` | Flag | What it does | | --- | --- | | `--all` | Everyone's tokens, for people allowed to see them. | | `--scopes` | The scopes this panel offers and what each allows, instead of tokens. | ## `dashboard` The dashboard numbers: how many servers are online and offline, websites (with how many certificates are expiring), applications, databases and firing alerts. ```bash vaultpanel dashboard ``` ## servers Servers, their state and the operations their agents can run. | Command | Does | | --- | --- | | `servers list` | List servers. | | `servers show ` | One server in detail. | | `servers add ` | Add a server and print the agent install command. | | `servers remove --force` | Remove a server from the panel. | | `servers operations` | The operation catalog agents can run. | | `servers run ` | Run one operation from the catalog. | | `servers reboot --force` | Reboot a server. | | `servers groups` | List server groups. | | `servers services [service]` | List services, check one, or restart, start or stop it. | ### `servers list` ```bash vaultpanel servers list [--search text] [--status online] [--page-size 25] ``` | Flag | What it does | | --- | --- | | `--search ` | Match the name, host name or public IP address. | | `--status ` | Only servers in this state: `pending`, `online`, `offline` or `disabled`. | | `--page-size ` | How many to list, up to 100. | Shows the name, status, agent version, CPU, memory, when the server was last seen and its id. ### `servers show` ```bash vaultpanel servers show ``` The name, id, status, agent version, operating system, host name, addresses, CPU and memory, whether a newer agent is available, and when it was last seen. ### `servers add` ```bash vaultpanel servers add ``` Adds the server to the panel and prints the command to run on it, as root, to install the agent. The command carries a one-time enrollment token. See [connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). ### `servers remove` ```bash vaultpanel servers remove --force ``` Removes the server from the panel and revokes its agent. ### `servers operations` ```bash vaultpanel servers operations ``` Lists the operations available on this panel, such as `SERVICE_RESTART` or `SERVER_REBOOT`, with what each one does and whether it changes the server. Nothing outside this catalog can run on a server: the agent has no shell. ### `servers run` Run one operation from the catalog on a server. ```bash vaultpanel servers run [--params '{"service":"nginx"}'] [--watch] ``` | Flag | What it does | | --- | --- | | `--params ` | The operation's parameters, as JSON. | | `--watch` | Follow the job until it finishes. | The operation name is case-insensitive. The panel checks your permission for the operation and its parameters before queuing it. ```bash vaultpanel servers run web-1 SERVICE_STATUS --params '{"service":"nginx"}' --watch ``` ### `servers reboot` ```bash vaultpanel servers reboot --force [--watch] ``` Queues `SERVER_REBOOT`. The agent reports success, then reboots the server a few seconds later. ### `servers groups` ```bash vaultpanel servers groups ``` Lists server groups with their number of servers and their ids. ### `servers services` ```bash vaultpanel servers services [service] [--restart|--start|--stop] [--watch] ``` | Form | What it does | | --- | --- | | `servers services ` | Lists the services the agent last reported, with their state. | | `servers services ` | Asks the agent for the service's state now. | | `servers services --restart` | Restarts the service. `--start` starts it instead. | | `servers services --stop --force` | Stops the service. `--stop` needs `--force`. | A restart, start or stop prints the job, or follows it with `--watch`. These forms work from CLI 0.1.2. The older form, `--restart nginx`, still works. ```bash vaultpanel servers services web-1 vaultpanel servers services web-1 nginx vaultpanel servers services web-1 nginx --restart --watch ``` ## websites Websites, their domains and certificates. | Command | Does | | --- | --- | | `websites list` | List websites. | | `websites show ` | One website in detail. | | `websites create ` | Create a website. | | `websites ssl ` | Get or renew its Let's Encrypt certificate. | | `websites enable ` | Turn a website on. | | `websites disable ` | Turn a website off. | | `websites delete --force` | Delete a website. | | `websites logs ` | A website's access or error log. | ### `websites list` ```bash vaultpanel websites list [--server ] [--search text] [--page-size 25] ``` Shows each website's name, type, domains, server, status and certificate state. ### `websites show` ```bash vaultpanel websites show ``` The name, id, type, server, domains, document root, PHP version or proxy port, status, certificate (with its expiry date) and the last error, if any. ### `websites create` ```bash vaultpanel websites create --server --domains a.example.com,b.example.com \ [--type static|php|proxy] [--php 8.3] [--proxy-port 3000] [--root public] [--watch] ``` | Flag | What it does | | --- | --- | | `--server ` | The server to create it on. Required. | | `--domains ` | Comma-separated domains; the first is the primary one. Required. | | `--type ` | `static` (the default), `php` or `proxy`. | | `--php ` | The PHP version, for a PHP site. | | `--proxy-port ` | The local port of the app, for a reverse proxy. From CLI 0.1.2. | | `--root ` | The document root. From CLI 0.1.2. | | `--watch` | Follow the job until the site is set up. | `` is also the site's Linux user and folder name, and cannot be changed later. ```bash vaultpanel websites create shop --server web-1 --domains shop.example.com,www.shop.example.com --type php --php 8.3 --watch ``` ### `websites ssl` ```bash vaultpanel websites ssl [--email you@example.com] [--staging] [--wildcard] [--no-force-https] [--watch] vaultpanel websites ssl --renew [--force] [--watch] ``` Without `--renew`, gets a Let's Encrypt certificate for the website's domains. Issuing works from CLI 0.1.2. | Flag | What it does | | --- | --- | | `--email
` | The contact email Let's Encrypt needs. Defaults to the email of the account the token belongs to. | | `--staging` | Use Let's Encrypt's staging service, for testing. | | `--wildcard` | Ask for a wildcard certificate. | | `--no-force-https` | Do not redirect HTTP to HTTPS. By default, HTTP is redirected. | | `--renew` | Renew the existing certificate instead. | | `--force` | With `--renew`, renew even if the certificate is not due yet. | | `--watch` | Follow the job until it finishes. | Certbot also renews certificates by itself. ```bash vaultpanel websites ssl shop --email ops@example.com --watch ``` ### `websites enable` and `websites disable` ```bash vaultpanel websites enable vaultpanel websites disable ``` ### `websites delete` ```bash vaultpanel websites delete --force [--remove-files] ``` Removes the website's NGINX and PHP configuration and its certificate. The site's files and Linux user are kept unless you add `--remove-files` (from CLI 0.1.2). ### `websites logs` ```bash vaultpanel websites logs [--log error|access] [--lines 200] ``` Reads the last lines of the website's error log (the default) or access log through the agent and prints them. `--lines` defaults to 200; the panel accepts 10 to 2000. `--kind` is still accepted in place of `--log`. Works from CLI 0.1.2. ## apps Applications: deploy, roll back, restart and read their history. | Command | Does | | --- | --- | | `apps list` | List applications. | | `apps show ` | One application in detail. | | `apps deploy ` | Deploy the current branch. | | `apps rollback ` | Go back to the previous release, or a named one. | | `apps restart ` | Restart, start or stop an application. | | `apps deployments` | Deployment history. | | `apps logs ` | An application's output or error log. | | `apps env ` | Read or set environment variables. | ### `apps list` ```bash vaultpanel apps list [--server ] [--search text] [--page-size 25] ``` Shows each app's name, runtime, server, process state, branch, when it was last deployed and its port. ### `apps show` ```bash vaultpanel apps show ``` The name, id, server, runtime, repository, branch, port, process state with its restart count, and the last deployment. ### `apps deploy` ```bash vaultpanel apps deploy [--watch] ``` Deploys the app's branch into a new release. With `--watch`, the command follows the deployment and fails if it fails, which is what a CI pipeline wants. ### `apps rollback` ```bash vaultpanel apps rollback [--release ] [--watch] ``` Points the app back at the release of an earlier deployment and restarts it. Without `--release`, the CLI picks the newest successful deployment before the live one whose release is still on the server, and prints which one it chose (from CLI 0.1.2). If no earlier release is left on the server, it stops with an error; deploy an older commit instead. `--release` takes a deployment id. Find them with `vaultpanel apps deployments --app `. ### `apps restart` ```bash vaultpanel apps restart [--stop] [--start] [--watch] ``` Restarts the app. `--stop` stops it and `--start` starts it instead. ### `apps deployments` ```bash vaultpanel apps deployments [--app ] [--page-size 25] ``` When each deployment ran, the app, status, commit, what triggered it and its id. ### `apps logs` ```bash vaultpanel apps logs [--log output|error] [--lines 200] ``` Reads the last lines of the app's output log (the default) or error log through the agent and prints them. `--lines` defaults to 200; the panel accepts 10 to 2000. The older `--kind out|error` is still accepted. Works from CLI 0.1.2. ### `apps env` ```bash vaultpanel apps env [--set KEY=value --set OTHER=value] [--unset KEY] ``` Without `--set` or `--unset`, lists the app's environment variables as `Variable` and `Value` rows. Setting and removing work from CLI 0.1.2: | Flag | What it does | | --- | --- | | `--set KEY=value` | Add a variable or change its value. Repeat it to set several. | | `--unset KEY` | Remove a variable. Repeat it to remove several. | Only the variables you name change; the rest stay as they are. The app uses new values after its next deploy or apply. ```bash vaultpanel apps env api --set LOG_LEVEL=debug --set FEATURE_X=1 --unset OLD_FLAG vaultpanel apps deploy api --watch ``` ## databases MariaDB databases and their users. | Command | Does | | --- | --- | | `databases list` | List databases. | | `databases create --server ` | Create a database and a user for it. | | `databases delete --force` | Delete a database and its data. | | `databases users` | List database users. | ### `databases list` ```bash vaultpanel databases list [--server ] [--search text] [--page-size 25] ``` The name, server, status, size, its users and the website or app that uses it. ### `databases create` ```bash vaultpanel databases create --server [--user name | --no-user] [--privileges all|readonly] [--watch] ``` Creates the database and, by default, a user named like it with a generated password. | Flag | What it does | | --- | --- | | `--server ` | The server to create it on. Required. | | `--user ` | Name the new user yourself. From CLI 0.1.2. | | `--no-user` | Create the database without a user. From CLI 0.1.2. | | `--privileges ` | The user's access: `all` (the default) or `readonly`. From CLI 0.1.2. | | `--watch` | Follow the job until it finishes. | The user's password is printed once, before the job is followed, so you see it even with `--watch`. It is never shown again. With `--json`, it is the `password` field of the reply. ```bash vaultpanel databases create shopdb --server web-1 --user shopuser --watch ``` ### `databases delete` ```bash vaultpanel databases delete --force ``` ### `databases users` ```bash vaultpanel databases users [--database ] [--server ] [--page-size 25] ``` Every database user with its databases, server, hosts, access and status. | Flag | What it does | | --- | --- | | `--database ` | Only users of this database. The CLI filters the list itself, from the first 100 users (or `--page-size`). From CLI 0.1.2. | | `--server ` | Only users on this server. From CLI 0.1.2. | | `--page-size ` | How many to list, up to 100. | ## containers Docker containers VaultPanel deploys. | Command | Does | | --- | --- | | `containers list` | List containers. | | `containers deploy ` | Deploy a container from a public image. | | `containers restart ` | Restart, start or stop a container. | | `containers logs ` | A container's output. | | `containers remove --force` | Remove a container. | ### `containers list` ```bash vaultpanel containers list [--server ] [--page-size 25] vaultpanel containers list --all --server ``` Lists the containers VaultPanel deployed: name, image, server, state, ports and when they were updated. `--all` asks the agent on one server (`--server` is required) for every container there, including ones VaultPanel did not deploy, and prints them as a table: name, image, state, status, ports and whether VaultPanel deployed it. ### `containers deploy` ```bash vaultpanel containers deploy --server --image redis:7 \ [--port 6379:6379] [--port 0.0.0.0:8080:80/tcp] [--env KEY=value] \ [--memory 512] [--cpu 50] [--restart unless-stopped] [--watch] ``` | Flag | What it does | | --- | --- | | `--server ` | The server to run it on. Required. | | `--image ` | A public image, such as `redis:7`. Required. | | `--port ` | Publish a port, as `[address:]host[:container][/protocol]`, where the protocol is `tcp` or `udp`. Repeat it for several ports. From CLI 0.1.2. | | `--env KEY=value` | An environment variable. Repeat it for several. From CLI 0.1.2. | | `--memory ` | Memory limit in MB. | | `--cpu ` | CPU limit, in percent. | | `--restart ` | `unless-stopped` (the default), `always`, `on-failure` or `no`. From CLI 0.1.2. | | `--watch` | Follow the deployment. | A port without an address binds to `127.0.0.1`, so it is reachable from the server only. Give `0.0.0.0` to make it public. Without a container port, it is the same as the host port; without a protocol, it is `tcp`. `--ports` is accepted as another name for `--port`, and either takes a comma-separated list. ```bash vaultpanel containers deploy cache --server web-1 --image redis:7 --port 6379 --memory 256 --watch vaultpanel containers deploy web --server web-1 --image nginx:1.27 \ --port 0.0.0.0:8080:80 --env TZ=UTC --env MODE=prod --restart always ``` ### `containers restart` ```bash vaultpanel containers restart [--start] [--stop] [--watch] ``` ### `containers logs` ```bash vaultpanel containers logs [--lines 200] ``` Reads the container's last lines through the agent and prints them. `--lines` defaults to 200; the panel accepts 10 to 2000. ### `containers remove` ```bash vaultpanel containers remove --force [--remove-volumes] [--watch] ``` Removes the container. Its volumes are kept unless you add `--remove-volumes` (from CLI 0.1.2). `--delete-volumes` is still accepted as another name for it. ## backups Backups and restores of websites, apps and databases. | Command | Does | | --- | --- | | `backups list` | List backups. | | `backups create --type --resource ` | Back something up now. | | `backups restore --force` | Restore a backup. | | `backups decrypt --key ` | Decrypt a copy taken from storage, with no panel. | ### `backups list` ```bash vaultpanel backups list [--server ] [--status completed] [--type website|application|database] [--page-size 25] ``` `--status` is `creating`, `completed`, `failed`, `deleting` or `missing`. `--type` lists only backups of websites, applications or databases (from CLI 0.1.2). Shows when each backup was made, what it holds, status, size, trigger and id. ### `backups create` ```bash vaultpanel backups create --type website|application|database --resource [--storage ] [--watch] ``` Backs up one website, app or database now. `--storage` sends the backup to a particular backup storage, by its id (from CLI 0.1.2). ```bash for site in $(vaultpanel websites list --json | jq -r '.[].name'); do vaultpanel backups create --type website --resource "$site" --watch done ``` ### `backups restore` ```bash vaultpanel backups restore --force [--no-safety-backup] [--watch] ``` Restores the backup in place. By default, the panel first backs up the current state as a safety backup, so the restore can be undone. `--no-safety-backup` skips it (from CLI 0.1.2). ### `backups decrypt` ```bash vaultpanel backups decrypt --key [--out ] [--force] ``` Decrypts a copy of a backup you downloaded from a bucket or backup server, with the storage's key file (**Backups > Storage > Key** in the panel; see [Save the backup key](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage#save-the-backup-key)). It needs no panel and no token, so it works even when the panel is gone. From CLI 0.1.3. | Option | Meaning | | --- | --- | | `--key ` | The key file the panel gave you. | | `--out ` | Where to write the backup. Default: the same name without `.enc`. | | `--force` | Replace the output file if it exists. | It prints the backup's SHA-256, which matches the checksum shown in the panel when the copy is intact. A wrong key, or a copy that was changed or cut short, is refused and writes nothing. ```bash vaultpanel backups decrypt 7f3c….tar.gz.enc --key vaultpanel-backup-key-offsite.txt tar -tzf 7f3c….tar.gz | head ``` ## cron Cron jobs. | Command | Does | | --- | --- | | `cron list` | List cron jobs. | | `cron run ` | Run a cron job now. | | `cron runs ` | Its run history. | ```bash vaultpanel cron list [--server ] [--page-size 25] vaultpanel cron run [--watch] vaultpanel cron runs ``` `cron list` shows each job's name, schedule, server, state, last run and result. `cron runs` shows when each run started, its status, exit code and how long it took. ## alerts | Command | Does | | --- | --- | | `alerts list` | Alert events, firing ones by default. | | `alerts acknowledge ` | Acknowledge a firing alert. | ```bash vaultpanel alerts list [--status firing|open|resolved] vaultpanel alerts acknowledge ``` `--status` is `firing` (the default), `open` (pending and firing together) or `resolved`. The list shows when each alert started, the alert, server, status, value and id. ## jobs Background jobs: deployments, website changes, backups and operations. | Command | Does | | --- | --- | | `jobs list` | List jobs. | | `jobs show ` | One job with its log. | | `jobs watch ` | Follow a job until it finishes. | | `jobs cancel ` | Cancel a job that is still queued. | ```bash vaultpanel jobs list [--status running] [--server ] [--type DEPLOY_APPLICATION] [--all] [--page-size 25] vaultpanel jobs show vaultpanel jobs watch vaultpanel jobs cancel ``` `--status` is `queued`, `dispatched`, `running`, `succeeded`, `failed`, `timed_out` or `cancelled`. `--type` lists only jobs of one operation type (case-insensitive). `jobs list` leaves out routine lookups, such as file listings and log reads; `--all` includes them. `--type` and `--all` work from CLI 0.1.2. `jobs watch` exits non-zero when the job does not succeed. Only queued jobs can be cancelled; the panel answers `409 JOB_NOT_CANCELLABLE` for any other. ## api Call any API endpoint directly, for anything the commands above do not cover. ```bash vaultpanel api [--data '{"name":"x"}'] [--data-file file.json] [--query key=value] ``` | Argument or flag | What it does | | --- | --- | | `` | `GET`, `POST`, `PATCH`, `PUT` or `DELETE`. | | `` | Relative to `/api/v1`: `vaultpanel api GET /servers` calls `/api/v1/servers`. | | `--data ` | The request body, as JSON. | | `--data-file ` | Read the request body from a JSON file instead. | | `--query ` | A query parameter. Repeat it for several (from CLI 0.1.2). | It prints the whole reply envelope (`success`, `data`, `message`, `requestId`), whatever `--json` says. ```bash vaultpanel api GET /websites --query serverId= --query pageSize=100 | jq '.data.items | length' ``` With CLI 0.1.1 or older, only the last `--query` is sent; put several query parameters in the path itself instead: `"/websites?serverId=&pageSize=100"`. The [API reference](https://docs.vaultpanel.net/api-reference) lists every endpoint. --- # Output and exit codes URL: https://docs.vaultpanel.net/cli/output-and-exit-codes > How the vaultpanel CLI prints tables and JSON, follows jobs, reports errors, retries requests, and which exit code each outcome returns. The CLI is meant for people and for scripts. People get tables; scripts get JSON, stable exit codes and errors on standard error. ## Output formats By default, lists print as tables and single items as `Field: value` lines. Times are relative ("3 minutes ago") and sizes are human-readable. ```text NAME STATUS AGENT CPU MEMORY LAST SEEN ID web-1 online 0.41.0 12% 1.2 GB / 3.8 GB 10 seconds ago 2f6c… ``` `--json` (`-j`) prints what the API returned instead, for `jq`: ```bash vaultpanel servers list --json | jq -r '.[] | select(.status != "online") | .name' ``` | Flag | Effect | | --- | --- | | `--json`, `-j` | Print the API's data as JSON. Progress and success lines are left out. | | `--quiet`, `-q` | Leave out informational and success lines, but keep tables, results and job log lines. | For a list, `--json` prints the array of items. `vaultpanel api` always prints the whole reply envelope, with `success`, `data`, `message` and `requestId`. Colors are used only when the output is a terminal, and never when `NO_COLOR` is set. Errors and warnings go to standard error, so they never end up in piped JSON. ## Jobs and waiting Long operations run as jobs in the panel's queue. Commands that start one print the job id and return: ```text Deploying api: job 2f6c8a1e-… ``` Add `--watch` (`-w`) to follow it instead. The CLI checks the job every 2 seconds, prints each new log line and its status changes, and ends when the job finishes: ```bash vaultpanel apps deploy api --watch vaultpanel jobs watch 2f6c8a1e-… ``` | How the job ends | What the CLI does | Exit code | | --- | --- | --- | | `succeeded` | Prints `✓ succeeded` | `0` | | `failed`, `timed_out` or `cancelled` | Prints the status and the job's error | `2` | | Still running after 15 minutes | Stops waiting with an error; the job keeps running in the panel | `2` | With `--json`, a watched command prints the finished job and its log lines as one JSON object. ## Errors When the panel refuses a request, the CLI prints its message, and for validation errors each field that failed: ```text ✗ Some fields are invalid ✗ domains: Add at least one domain Request id 7d1c9e2a-… (quote it when reporting a problem). ``` It adds a hint for the two errors you can fix yourself: | Status | Hint | | --- | --- | | `401` | The token for this profile is not valid any more. Make a new one in the panel and run `vaultpanel login`. | | `403` | The token's scopes do not cover this. Make one with wider scopes, or ask an owner. | Quote the request id when you report a problem: it identifies the request in the panel's logs. ## Retries and timeouts Each request times out after 30 seconds. `GET` requests are retried up to twice when the panel answers `429`, `502`, `503` or `504`, or when the network fails. Requests that change something are never retried, so a deploy is never started twice. ## Exit codes | Code | Means | | --- | --- | | `0` | It worked. | | `1` | The command was used wrongly (a missing argument, an unknown command, `--force` left out, invalid JSON), there is no panel address or token, or something local failed. | | `2` | The panel refused the request, could not be reached, or a watched job did not succeed. | | `3` | The token is not valid any more (`401`), or its scopes do not cover this (`403`). | A script can branch on them: ```bash status=0 vaultpanel apps deploy api --watch || status=$? case $status in 0) echo "Deployed" ;; 3) echo "Fix the token: vaultpanel login"; exit 1 ;; *) echo "The deploy failed ($status)"; exit 1 ;; esac ``` --- # Server command URL: https://docs.vaultpanel.net/cli/server-command > The vaultpanel command on the panel's own server, for its address, status, logs, restarts, updates, rollbacks, backups, HTTPS and the setup token. The installer adds a `vaultpanel` command to the panel's server (`/usr/local/bin/vaultpanel`). Its **server commands** look after the panel on that server. Every other command is handed to the [CLI](https://docs.vaultpanel.net/cli), which works through the panel's API with an API token. ```bash vaultpanel # address, status and version sudo vaultpanel update # a server command vaultpanel servers list # handed to the CLI ``` Commands marked **root** need `sudo`. Most others read `/opt/vaultpanel/.env`, which only root and the panel can read, so they also show more with `sudo`. ## Overview | Command | Root | What it does | | --- | --- | --- | | `vaultpanel` | | Address, status and version, and the setup token while no owner exists. | | `vaultpanel status` | | The panel, worker, agent, database and Redis. | | `vaultpanel logs [panel\|worker\|agent] [-f]` | | Recent log lines; `-f` keeps following. | | `vaultpanel start`, `stop`, `restart` | root | Control the panel and worker. | | `vaultpanel update [--version ] [--force]` | root | Back up, then install the newest package or the one given. | | `vaultpanel rollback [--yes]` | root | Go back to the version before the last update, with its database. | | `vaultpanel backup [--dir ] [--keep ] [--label ]` | root | Back up the panel's database, settings and certificate now. | | `vaultpanel restore [--yes]` | root | Put a backup back, on this server or a new one. | | `vaultpanel https [status\|on\|off\|renew]` | `on`, `off`, `renew` | The panel's own HTTPS certificate. | | `vaultpanel url [
]` | root | Show or change the panel's address. | | `vaultpanel setup-token` | root | The token for creating the owner account. | | `vaultpanel version` | | The installed version. | | `vaultpanel help` | | The server commands, then the CLI's command groups. | Some commands answer to a second name: `info` (same as `vaultpanel` alone), `log` (`logs`), `upgrade` (`update`), `tls` (`https`) and `address` (`url`). ## `vaultpanel` ```text __ __ _ _ ____ _ \ \ / /_ _ _ _| | |_| _ \ __ _ _ __ ___| | \ \ / / _` | | | | | __| |_) / _` | '_ \ / _ \ | \ V / (_| | |_| | | |_| __/ (_| | | | | __/ | \_/ \__,_|\__,_|_|\__|_| \__,_|_| |_|\___|_| Address: https://203.0.113.10:8090 Panel: running Worker: running Agent: running Version: 0.3.0 (agent 0.41.0) ``` While no owner account exists, it also prints the `/setup` address, and as root the setup token. ## `status` ```bash vaultpanel status ``` The state of the `vaultpanel`, `vaultpanel-worker` and `vaultpanel-agent` services, and whether the panel reaches its database and Redis (from the panel's `/api/v1/health`). As root, it also lists the panel's Docker containers. ## `logs` ```bash vaultpanel logs # the panel (web interface and API) vaultpanel logs worker -f # the worker, following new lines vaultpanel logs agent # this server's agent ``` Shows the last 100 lines from the service's journal. `panel` (or `api`), `worker` and `agent` choose the service; `-f` or `--follow` keeps following. In a terminal, the panel's and worker's JSON log lines are printed readably. ## `start`, `stop` and `restart` ```bash sudo vaultpanel restart ``` `restart` restarts the panel and worker, `stop` stops them, and `start` starts the panel's database and Redis containers, then the panel and worker. Restart after changing `/opt/vaultpanel/.env`. ## `update` ```bash sudo vaultpanel update # the newest version sudo vaultpanel update --version v0.3.0 # a given version ``` | Option | What it does | | --- | --- | | `--version ` | Install this version from VaultPanel's package repository. | | `--force` | Set the same version up again when there is nothing newer. | | `--branch ` | Only for a panel installed from a copy of the repository: follow a branch. | It backs the panel up first (label `pre-update`) and refuses versions older than the installed one. See [Updating](https://docs.vaultpanel.net/getting-started/updating). ## `rollback` ```bash sudo vaultpanel rollback ``` Restores the database from the backup taken just before the last update, then installs the version from before it. It asks you to type `rollback`; `--yes` (`-y`) skips the question. Changes made in the panel since the update are lost. ## `backup` ```bash sudo vaultpanel backup [--dir ] [--keep ] [--label ] [--quiet] ``` | Option | What it does | | --- | --- | | `--dir ` | Where to write it. Default: `VAULTPANEL_BACKUP_DIR`, `/var/backups/vaultpanel-panel`. | | `--keep ` | Keep only the newest `n` backups with this label. | | `--label ` | The label in the file name (`a-z`, `0-9`, `-`, at most 32 characters). Default: `manual`. | | `--quiet` | Print only the backup file's path. | See [Backing up the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel) for what a backup holds and the settings that encrypt it or copy it off the server. ## `restore` ```bash sudo vaultpanel restore /var/backups/vaultpanel-panel/vaultpanel-20261020-031500-scheduled.tar.gz ``` Checks the backup against its checksum, takes a safety backup, then puts back the database, settings, secret key, certificate and the panel's files, updates the database and restarts. It asks you to type `restore`; `--yes` (`-y`) skips the question. ## `https` ```bash vaultpanel https # status sudo vaultpanel https renew ``` | Action | What it does | | --- | --- | | `status` (the default) | Whether HTTPS is on, the certificate's names, expiry, SHA-256 fingerprint and agent pin. | | `on` | Turn HTTPS on for a panel installed with plain HTTP. Prints the command to run on each other server. | | `renew` | A new certificate with this server's current names and addresses, made with the same key so the agents' pin does not change. Prints the command to run on each other server. | | `off` | Back to plain HTTP. Not recommended. | See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). ## `url` ```bash sudo vaultpanel url # show the address sudo vaultpanel url https://panel.example.com # change it ``` The address must look like `https://panel.example.com` or `https://203.0.113.10:8090`, without a path. Changing it restarts the panel. - With an `https://` address, sign-in cookies become HTTPS-only and agents must use HTTPS. With `http://`, both are relaxed again. - When HTTPS is on, an `http://` address on the panel's own port is refused: that port serves HTTPS. - When the certificate does not name the new address's host, the command tells you to run `sudo vaultpanel https renew`. ## `setup-token` ```bash sudo vaultpanel setup-token ``` Prints the setup token while no owner account exists. Once the owner exists, the token no longer works and the command says so. ## `version` and `help` ```bash vaultpanel version # VaultPanel 0.3.0 (agent 0.41.0) vaultpanel help ``` On the panel's server, `--version`, `-v`, `--help` and `-h` also go to these server commands, not to the CLI. For the CLI's help, use `vaultpanel --help`. ## The login banner When someone logs in to the server over SSH, a banner shows the VaultPanel logo, links to the website and this documentation, the panel's address with whether it is running, and the `vaultpanel` command. The agent hides the system's own welcome text, news and update notices by default (agent 0.21.0 or newer). To show the system's message again, open the server's **Security** tab in the panel and click **Show the system’s message** on the **Login message** card; **Show only VaultPanel** switches back. --- # Best practices URL: https://docs.vaultpanel.net/best-practices > Recommendations for running VaultPanel in production, from panel backups and HTTPS to access control, server hardening and monitoring. VaultPanel is secure by default: the panel runs as an unprivileged user, serves HTTPS from the first start, and every change is a signed, audited job. The recommendations on this page close the remaining gaps that depend on how you run it. Each one links to the guide that explains it. ## Protect the panel itself ### Keep the panel's backups off the server `vaultpanel-backup.timer` backs up the panel every day to `/var/backups/vaultpanel-panel`, but a backup on the same disk does not help when the server is gone. Copy each backup somewhere only you can read, and encrypt it when it goes to someone else's storage. Set both in `/opt/vaultpanel/.env`; the next backup uses them: | Setting | What to set | | --- | --- | | `VAULTPANEL_BACKUP_PASSPHRASE_FILE` | A file holding a passphrase. Backups are then encrypted (AES-256, PBKDF2) as `.tar.gz.enc`. | | `VAULTPANEL_BACKUP_UPLOAD` | A command run after each backup with the file as `$1`, such as `rclone copy "$1" remote:vaultpanel`. | Keep the passphrase somewhere other than the server, and practice a restore on a new server with `sudo vaultpanel restore ` before you need it. See [Backing up the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel). ### Keep the secret key safe `VAULTPANEL_SECRET_KEY` in `/opt/vaultpanel/.env` decrypts two-factor secrets, the agent signing key and every stored password. Without it, a database backup cannot be used. Panel backups include it, so treat backup files like `.env` itself: root only, encrypted when they leave the server. ### Give the panel a domain, then close port 8090 The panel's own certificate is self-signed. For a certificate browsers trust, put the panel on a domain under **System > Panel Domain** and click **Use https://…** under **Panel address**, so agent install commands, password reset links and deploy webhooks use it. Once you can sign in on the domain, close port 8090 to the outside in the firewall. The domain is then the only public way in, and it is served with a trusted certificate and HSTS. See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). > **Tip:** Check the domain works before closing the port. `https://SERVER_IP:8090` stays available until you do, so a DNS or certificate mistake never locks you out. ### Keep the panel and agents updated `sudo vaultpanel update` backs the panel up, installs the newest `vaultpanel` package and updates the database; `sudo vaultpanel rollback` reverses the last update. `sudo apt upgrade` updates VaultPanel with the system's other packages. When the panel has a newer agent than a server, the server's page shows **Update agent**, and a bulk action can update many servers at once. Operations added in newer agents are refused with `AGENT_OUTDATED` until the server's agent is updated. See [Updating](https://docs.vaultpanel.net/getting-started/updating) and [Server groups](https://docs.vaultpanel.net/guides/servers/server-groups). ## Control who can do what ### Require two-factor sign-in Turn on two-factor sign-in for your own account under **Account**, and store the 10 recovery codes outside the panel. Then, under **Security > Authentication**, require it for **Owners and admins** or for **Everyone**. Accounts the policy covers can only set it up or sign out until they do. See [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor). ### Give each person the smallest role that works Permissions are checked in the service layer and denials are audited. People can only grant roles at or below their own. Give each person the built-in role that matches their work rather than making everyone an admin, and deactivate accounts that are no longer needed: that also ends their sessions and stops their API tokens. See [Users and roles](https://docs.vaultpanel.net/guides/security/users-and-roles). ### Scope API tokens narrowly and let them expire An API token acts as the person who made it, narrowed to the scopes it was given. Give scripts only the scopes they need (for example `deploy` for a CI pipeline instead of `full`), set an expiry, and revoke tokens you no longer use. A token is shown once and only its SHA-256 is stored. See [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens). ### Limit panel access by address When your team works from known addresses, turn on **Panel access by address** under **Security > Authentication**. Everyone else gets a page saying their address is not accepted, and signing in and the browser terminal are refused. With **Staff only**, hosting customers still sign in from anywhere. Agents, push-to-deploy hooks, billing systems and plugins are never blocked. Behind a reverse proxy or Cloudflare, set `VAULTPANEL_TRUST_PROXY` so the panel sees people's real addresses. See [Panel access](https://docs.vaultpanel.net/guides/security/panel-access). ### Review the audit log Every change, denial and sign-in is recorded with who, what, the result, the IP address and the request id, and the database refuses updates and deletes of entries. Review it after incidents and when people leave. See [Audit log](https://docs.vaultpanel.net/guides/security/audit-log). ## Harden every server Each server's **Security** tab and the **Security Overview** score the firewall, root sign-in, SSH passwords, Fail2ban, automatic updates and waiting updates. Aim to have every check pass: | Area | Recommendation | Guide | | --- | --- | --- | | Firewall | Turn UFW on. VaultPanel keeps SSH and the panel's port open for you and refuses rules that would lock you out. | [Firewall](https://docs.vaultpanel.net/guides/security/firewall) | | SSH | Add your public key, check you can sign in with it, then turn off password sign-in and set root sign-in to keys only. | [SSH](https://docs.vaultpanel.net/guides/security/ssh) | | Brute force | Install Fail2ban, turn on **Protect SSH** and add your own address to the addresses that are never blocked. | [Fail2ban and updates](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates) | | Updates | Turn on daily automatic security updates, and install waiting ones from the panel. | [Fail2ban and updates](https://docs.vaultpanel.net/guides/security/fail2ban-and-updates) | > **Warning:** Docker publishes container ports itself, bypassing UFW. Keep container ports on **This server only** and give them a domain through a reverse-proxy website instead of opening a public port. See [Containers](https://docs.vaultpanel.net/guides/applications/containers). ## Back up what you host Panel backups do not include websites, apps or databases; those have their own backups under **Backups**. - **Schedule backups** for every website, app and database, with a "keep" count that fits your disk. - **Store them off the server.** Add an S3-compatible bucket (Amazon S3, Backblaze B2, Wasabi, Cloudflare R2, MinIO) or another server over SFTP under **Backups > Storage**. Copies are encrypted before they leave the server; download each storage's backup key (**Key**) and keep it somewhere other than the panel server, or the copies cannot be read if the panel is lost. Still use a private bucket or a backup server only you can sign in to. - **Test restores.** A restore takes a safety backup of the current state first, so trying one is safe. See [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups) and [Backup storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage). ## Know when something breaks - **Alerts**: the default rules include **Server self-check failed** and **Website down**. Send alerts by email from **System > Panel Email** and to Slack, Discord or your own endpoint with [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks). See [Monitoring and alerts](https://docs.vaultpanel.net/guides/servers/monitoring-and-alerts). - **Uptime**: the panel checks every website the way visitors reach it, including the certificate it serves. Leave monitoring on for production sites. See [Uptime monitoring](https://docs.vaultpanel.net/guides/websites/uptime-monitoring). - **Self-check**: every 5 minutes each agent checks what the panel's features need from its server (`nginx -t`, Certbot's timer, the clock, failed units) and shows the command that fixes a failure. See [Server self-check](https://docs.vaultpanel.net/guides/servers/self-check). ## Keep outgoing requests inside the public internet Webhooks, plugin manifests and plugin events never reach the panel's own machine, link-local or cloud metadata addresses. On new installs they also refuse private networks (10.x, 172.16-31.x, 192.168.x, 100.64.x, fc00::/7), because `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE` is `false`. Panels installed before this default changed keep `true`. Leave it off unless a webhook must reach a service on your private network, and leave `VAULTPANEL_PLUGIN_ALLOW_LOCAL` off unless you develop plugins on the panel's own server. See [Webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) and [Plugins](https://docs.vaultpanel.net/developers/plugins). --- # Troubleshooting URL: https://docs.vaultpanel.net/troubleshooting > Diagnose and fix common VaultPanel problems by symptom, from installation and agents to websites, SSL, apps, databases, backups and the assistant. Problems are grouped by where they show up. Most failures in the panel carry an error code (such as `DOMAIN_NOT_REACHABLE`) and a request id; search this page for the code. ## Start here Three commands on the panel's server answer most questions: ```bash vaultpanel status # panel, worker, agent, database and Redis sudo vaultpanel logs panel -f # the API's log; also: worker, agent sudo journalctl -u vaultpanel-agent -n 100 --no-pager ``` On any other server, the agent's state is in its own services: ```bash systemctl status vaultpanel-agent vaultpanel-agent-helper journalctl -u vaultpanel-agent -u vaultpanel-agent-helper -n 100 --no-pager ``` > **Tip:** Every error in the panel shows a request id. Search the API log for it (`sudo vaultpanel logs panel`) to find the full error. Errors returned to the browser never include stack traces. ## Installation The installer stops with a plain message when something is wrong. The common ones: | Message | Fix | | --- | --- | | `this installer supports Ubuntu 22.04/24.04/26.04 and Debian 12/13` | Use a supported system. See [System requirements](https://docs.vaultpanel.net/getting-started/system-requirements). | | `systemd is required (containers without systemd are not supported)` | Install on a VM or a server, not in a container without systemd. | | `port 8090 is already in use` | Stop what uses it, or install on another port: `--port 8095`. | | `port 8091 (the panel's loopback port) is already in use` | Set `VAULTPANEL_LOOPBACK_PORT=8095` in `/opt/vaultpanel/.env`, then `sudo vaultpanel update --force`. | | `port 3307` or `port 6379` `… is already in use on 127.0.0.1` | Something else (often a panel started by hand from a copy of the repository) holds the panel's database or Redis port. Stop its containers first. | | `port 3306 is already in use, so MariaDB cannot start there` | Stop what uses it, or install with `DB_ENGINE=NONE`. | | `MySQL is not available yet` | MySQL 8.4 and 8.0 come in a later version. Choose a MariaDB version, or `NONE`. | | `… is not available on ` | The `DB_ENGINE` you chose is not offered for this system. The message lists the ones that are. | | `Docker is installed but not running` | `systemctl start docker`, then run the installer again. | | `the vaultpanel package did not install` | Fix what the lines above it say, then `sudo dpkg --configure -a`. | | `the panel did not start` | The log above the message says why; more with `vaultpanel logs`. | Running the installer again is safe: it keeps `.env` and all data. ## Setup and signing in ### The setup token is refused The setup token creates the owner account and stops working once it exists. On an installed panel, `sudo vaultpanel setup-token` prints the current one. A panel started by hand prints it in the API log ("No accounts exist yet…"); it changes on every restart unless `VAULTPANEL_SETUP_TOKEN` is set. ### The API exits with "Invalid configuration" A required setting is missing or malformed, and the message lists which. `VAULTPANEL_SECRET_KEY` must decode to exactly 32 bytes; generate one with `openssl rand -hex 32`. ### "Set up two-factor sign-in" on every page An owner requires two-factor sign-in for your role (**Security > Authentication**). Set it up, or ask an owner to change the policy. If you lost your phone and your recovery codes, an owner or admin can turn two-factor sign-in off for you under **Users** (Edit) or on **Security > Authentication**; you are then signed out everywhere. ### "The panel does not accept your address" (`IP_NOT_ALLOWED`) **Panel access by address** is on and your address is not on the list. From an allowed address, add yours under **Security > Authentication**. If you are locked out completely, on the panel's server: ### Turn the check off Add `VAULTPANEL_PANEL_ACCESS=off` to `/opt/vaultpanel/.env` and run `sudo vaultpanel restart`. ### Fix the list Sign in and correct the addresses under **Security > Authentication**. ### Turn the check back on Remove the line from `.env` and run `sudo vaultpanel restart` again. Behind a reverse proxy or Cloudflare, everyone appears with the proxy's address unless `VAULTPANEL_TRUST_PROXY` is set. ## The panel's HTTPS and domain ### The browser warns that the connection is not private The panel's port uses a self-signed certificate made for your server. Check that the SHA-256 fingerprint the browser shows matches the one `sudo vaultpanel https` prints, then continue. For a certificate browsers trust, give the panel a domain. See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). ### "Cannot read the panel's TLS certificate or key" after an update The files named by `VAULTPANEL_TLS_CERT` and `VAULTPANEL_TLS_KEY` are missing or not readable by the `vaultpanel` group. `sudo vaultpanel https on` makes a new certificate and fixes the permissions. It prints the command to run on each other server, so their agents trust the new certificate. ### Agents went Offline after `vaultpanel https on` or `https renew` They still talk plain HTTP, or trust the old certificate. Run the command that `vaultpanel https on` (or `renew`) printed on each of them; `sudo vaultpanel https` shows the pin again. Their registration is kept. ### The panel stopped loading after turning on the firewall VaultPanel opens the port in `VAULTPANEL_PUBLIC_URL` on the panel's own server. If you open the panel on another port, add a firewall rule for it, or correct the address with `sudo vaultpanel url
`. ## Panel maintenance ### "EACCES" or "read-only file system" in `vaultpanel logs` The panel runs as the `vaultpanel` user and may only write to `VAULTPANEL_DATA_DIR` (`/var/lib/vaultpanel/panel`). `sudo vaultpanel update --force` puts the ownership right. A `VAULTPANEL_DATA_DIR` set by hand elsewhere must belong to `vaultpanel`. ### `vaultpanel backup` says the MariaDB container is not running Start it with `sudo vaultpanel start`. `vaultpanel backup` needs the panel's own database from the installer; a panel on your own database server is backed up with your own database backups, plus `.env` and `/etc/vaultpanel/tls`. ### `vaultpanel restore` fails at "the database update failed" The backup comes from a newer VaultPanel than the one installed. Install that version first with `sudo vaultpanel update --version vX.Y.Z` (the backup's version is printed when the restore starts), then restore again. ### `vaultpanel rollback` says no earlier version is recorded Rollback reverses one `vaultpanel update`. To go to any release, run `sudo vaultpanel update --version vX.Y.Z`, then restore a backup from that time if the database changed in between. See [Updating](https://docs.vaultpanel.net/getting-started/updating). ## Servers and agents ### A server stays "Waiting for agent" Check the output of the install command on the server. Enrollment tokens work once and expire after 60 minutes by default (`VAULTPANEL_ENROLLMENT_TTL_MINUTES`); create a new one from the server's **Settings** tab. "Agents must connect over HTTPS" means the panel's address is plain HTTP. ### "does not match the pin in the install command" The panel answering at that address does not have the certificate the command was made for: it was replaced, or something between the servers intercepts the connection. Copy a new install command from the panel and check the address. ### A server shows Offline The agent has not reported for 90 seconds (`VAULTPANEL_AGENT_OFFLINE_SECONDS`). On the server, run `systemctl status vaultpanel-agent` and `journalctl -u vaultpanel-agent`. | Error | Cause | Fix | | --- | --- | --- | | `CLOCK_SKEW` | The server's clock is off by more than 5 minutes. | Turn on NTP: `sudo timedatectl set-ntp true`. | | `AGENT_REVOKED` | The server was removed or registered again. | Run the install command again with a new token. | ### A server went Offline after setting outgoing connections to Deny The agent keeps the panel's address reachable, but resolves it once, when the outgoing default changes. If the panel's IP address changed since, add an outgoing allow rule for the new address from the server's console (`ufw allow out to port proto tcp`), or run `ufw default allow outgoing`. Programs that reach other services, such as a remote database, need their own outgoing rules. ### "The agent runs as root" in the security checks The reason follows the message: - **"did not reach the panel as the vaultpanel-agent user"**: the move to its own user was undone after 10 minutes. `journalctl -u vaultpanel-agent -u vaultpanel-agent-helper` shows why, often a firewall or proxy setting only root had. Fix it, then `sudo rm /var/lib/vaultpanel/agent-mode.json && sudo systemctl restart vaultpanel-agent`. - **"runs from …"**: the agent was not installed by the install script (a development checkout) and stays as it was started. ### `HELPER_UNAVAILABLE` [#helper-unavailable] The agent runs as its own user but is not connected to its root helper, so it refuses jobs rather than run them without root and fail half way. The job's error says what to run: | Message | Fix | | --- | --- | | `The agent is not connected to its root helper. On the server run: sudo systemctl restart vaultpanel-agent-helper vaultpanel-agent` | Run that command on the server. | | `The agent's root helper is not answering on …` | The helper did not answer within 30 seconds. Check `systemctl status vaultpanel-agent-helper` and `journalctl -u vaultpanel-agent-helper`, then run the command above. | | `The connection to the agent's root helper was lost` | The helper stopped while a job ran. Run the command above and try the job again. | Before agent 0.50.1, an agent that started a moment before its helper (after an update or a reboot) never connected to it and ran jobs as its own user. Those jobs failed with "Permission denied", for example `SSHD_CONFIG_INVALID ... 50-cloud-init.conf: Permission denied`. Update the agent to 0.50.1 or later, or run the command above. To go back to one root service, add `"runAsRoot": true` to `/etc/vaultpanel-agent/config.json` and restart the helper. ### "Update agent" says the Node.js agent is replaced by running the command The server still runs the old Node.js agent (a version without `-rs`, such as 0.42.0). It cannot install the current agent from an update job, so **Update agent** is refused and bulk updates skip the server. Run the command shown on the server's page once, on the server, as root: ```bash curl -fsSL https://panel.example.com/api/v1/agent/install.sh | sudo bash -s -- --upgrade --panel https://panel.example.com ``` A panel with a self-signed certificate adds the pin options; copy the command from the page. It installs `/usr/local/bin/vaultpanel-agent`, keeps the registration and policy, moves cron jobs and Certbot's wildcard hook to the new program, and removes `/opt/vaultpanel-agent` once the new agent runs. If the agent does not start, the old folder is kept: check `journalctl -u vaultpanel-agent`. See [Moving from the Node.js agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent). ### `AGENT_PACKAGE_MISSING` The panel has no agent program for the server's CPU type, so it cannot install or update the agent there. The agent runs on x86-64 and arm64; a panel installed from the package carries both. ### The panel's own server does not show up Look for lines starting with `[vaultpanel]` in the API's log when it starts; they say why. `VAULTPANEL_LOCAL_AGENT=false` turns the automatic connection off. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers). ## Jobs | Error | Meaning | Fix | | --- | --- | --- | | `AGENT_UNREACHABLE` | No agent picked the job up within 5 minutes. | Check the server is online, then try again. | | `AGENT_OUTDATED` | The server's agent predates the operation. | Click **Update agent** on the server's page, or run the upgrade command shown there. Registration is kept. | | `NOT_ALLOWED` | The agent's local policy refuses it (`allowedServices`, `allowReboot`). | Edit `/etc/vaultpanel-agent/config.json` and restart the agent. | | `TIMEOUT` | The command did not finish in time. | The job page shows the output collected so far. | | `PROCESS_CHANGED` | The process exited and its pid was reused before the job ran. | Refresh the process list and try again. | For **This server**, restarting the panel (`sudo vaultpanel restart`) also updates its agent: the panel connects its own server before the API starts. ## The web interface ### "n.job is undefined" [#njob-is-undefined] The WordPress tools, staging, clones and push to live, malware scans and quarantine, and emptying the page cache showed "n.job is undefined" in the browser. The change was still sent and made; only the page did not follow it. The current web interface reads the panel's answer correctly. If you still see it after updating, your panel's package carries an old web interface. That happens with a package built by hand after `git pull` without rebuilding the interface. Rebuild it and the package: ```bash npm ci && npm run build bash packaging/build-deb.sh ``` `build-deb.sh` now refuses to package a web interface older than its code, with `the web interface in frontend/dist is older than …: run npm ci && npm run build first`. `VAULTPANEL_PACKAGE_STALE_UI=1` packages it anyway; don't use it for a release. After installing the new package, reload the page in the browser. ## Websites and SSL ### A website stays "Failed" Its page shows the agent's message and a link to the log. Fix the cause, then click **Try again**. | Error | Fix | | --- | --- | | `NGINX_NOT_INSTALLED`, `PHP_NOT_INSTALLED` | Install them from the server's **Websites** tab, **Web stack** card. | | `NGINX_CONFIG_INVALID` | NGINX refused the new configuration, often because another site or a hand-edited file is broken. Run `sudo nginx -t` on the server. | | `SITE_USER_CONFLICT` | A Linux user with the site's name already exists for something else. Pick another site name. | | `WEBSITE_BUSY` | Another change to the same website is still running. Wait for it and try again. | ### The site is created but "Not answering" For a reverse proxy, start your app on the port shown: NGINX answers 502 until something listens there. For PHP, check the PHP-FPM service on the server's **Services** tab. ### Certificate requests fail with `DOMAIN_NOT_REACHABLE` Let's Encrypt was not asked: the agent could not fetch a test file through the domain. Check on the **Domains** tab that each domain points at this server, and that ports 80 and 443 are open (`ufw allow 80,443/tcp`). Use the staging option while testing, to stay clear of Let's Encrypt's rate limit of 5 failures per hour per domain. ### Certificate requests fail with `ACME_NOT_SERVED` The server's own NGINX could not serve the Let's Encrypt check file, often with HTTP 403. Run `sudo nginx -t` and read `/var/log/nginx/error.log`. On agents before 0.12.1, `/var/lib/vaultpanel` could be left closed; update the agent and issue again, or run `sudo chmod 711 /var/lib/vaultpanel`. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). ## File manager | Symptom | Fix | | --- | --- | | `OUTSIDE_SITE` | The path goes through a symbolic link to somewhere outside the site's folder. The file manager never follows such links; use SFTP as the server's owner instead. | | "Cannot find module '/opt/vaultpanel-agent/src/services/fileWorker.js'" | Old Node.js agents only, before 0.37.0: the file worker runs as the site's user, which cannot read the agent's folder. [Move the server to the current agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent), or run `sudo chmod -R u=rwX,go=rX /opt/vaultpanel-agent`. | | "Could not start the file worker: spawn … EACCES" | Agents before 0.9.1 could not run file requests when Node.js lives in a home folder (nvm). Update the agent, then **Try again** on the website. | ## Server self-check The **Self-check** card on a server's **Overview** (agent 0.39.0) shows the command that fixes each failed check, and the **Server self-check failed** alert fires when a check stays failed for 10 minutes. See [Server self-check](https://docs.vaultpanel.net/guides/servers/self-check). | Check | Fix | | --- | --- | | **Root helper** | See [`HELPER_UNAVAILABLE`](https://docs.vaultpanel.net/troubleshooting#helper-unavailable). | | **Agent privileges** (warning) | See ["The agent runs as root"](https://docs.vaultpanel.net/troubleshooting#the-agent-runs-as-root-in-the-security-checks). | | **Agent files** | The command on the card: `sudo chmod -R u=rwX,go=rX /usr/local/bin/vaultpanel-agent` for the program, or `sudo chmod o+x` on the folder the check names. | | **File manager** | Its worker did not start as a site user. After fixing the agent files, click **Check now**. | | **NGINX configuration**, **Apache configuration** | `sudo nginx -t` or `sudo apache2ctl -t` shows the file and line. Until it passes, every website change is refused. A file VaultPanel wrote (`vp-.conf`) is rewritten by saving the website's settings again. | | **Certificate renewal** (warning) | `sudo systemctl enable --now certbot.timer`, or issue a certificate from the panel. The panel renews due certificates itself either way. | | **Clock** (warning) | `sudo timedatectl set-ntp true` | | **Failed services** (warning) | `systemctl --failed`, then `journalctl -u ` for each. | ## Applications and deployments ### An app stays "Failed" The **Deployments** tab shows which stage failed and its log. The previous release keeps running. | Stage or error | Fix | | --- | --- | | `fetch` (`CLONE_FAILED`) | The repository URL or branch is wrong, or a private repository needs the app's deploy key (on its **Settings** tab) added to the repository. | | `install` or `build` | Run the same command in the repository on your computer to see the error. | | `start` (`HEALTH_CHECK_FAILED`) | The app did not listen on its port in time. It must listen on `process.env.PORT` (Node.js) or `$PORT` (Python). | | `APPLICATION_BUSY` from a webhook | A deployment is already running; the next push deploys. | ### A command field says it uses shell syntax Install, build and start commands run without a shell, so `&&`, `|`, `;` and `>` are refused. Put the steps on separate lines, or in a script in your repository. `CONFIGURE_FAILED` saying a program is not installed means the start command's program (for example `gunicorn`) is not in the app's dependencies. ### The app runs but its domain shows 502 The linked website points NGINX at the app's port. If you changed the port, use **Apply** on the app so the app and NGINX move together. ### `SOFTWARE_MISSING` or `NODE_IN_HOME_FOLDER` `SOFTWARE_MISSING` means Git, PM2, Python or MariaDB is not installed; install it from the server's **Software** card. `NODE_IN_HOME_FOLDER` means the only Node.js on the server lives under `/root` or `/home` (for example through nvm), which app users cannot read. Install Node.js system-wide: ```bash curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - && sudo apt-get install -y nodejs ``` See [Deployments](https://docs.vaultpanel.net/guides/applications/deployments). ## Containers | Symptom | Fix | | --- | --- | | "Update the agent to manage containers" | Containers need agent 0.10.0 or newer. | | Docker shows "Stopped", or `DOCKER_NOT_RUNNING` | Click **Start Docker** on the **Containers** page. By hand: `snap start --enable docker` for the snap (`which docker` shows `/snap/bin/docker`), or `systemctl enable --now docker` for Ubuntu's package. | | "Could not pull … toomanyrequests" | Docker Hub limits anonymous pulls. Wait, or use the same image from a mirror such as `mirror.gcr.io/library/nginx:alpine`. | | `CONTAINER_EXITED` or "did not stay up" | The container stopped during its health check; the error shows its last output. Usual causes: a missing environment variable, a wrong command, or too little memory. A container it replaced was started again. | | A port "is used by …" | Another app, container, SSH, the panel or VaultPanel's database uses that host port. Pick another host port. | | A public port is reachable without a firewall rule | Docker adds its own rules for published ports, ahead of UFW. Keep ports on **This server only** and add a reverse-proxy website for them. | See [Containers](https://docs.vaultpanel.net/guides/applications/containers). ## Databases | Error | Fix | | --- | --- | | `DATABASE_SERVER_NOT_INSTALLED` | Install MariaDB from the server's **Software** card. | | `DATABASE_SERVER_DOWN` | Start the `mariadb` service on the server's **Services** tab. If root cannot sign in over the socket, set `mysqlDefaultsFile` in the agent's config. | | `DATABASE_PORT_IN_USE` | Something else holds port 3306, usually the panel's own development MariaDB from an older `docker/compose.yml`. Move it to 3307, then try again. | See [Databases](https://docs.vaultpanel.net/guides/databases). ## Email ### Mail from other providers never arrives, or is refused - **Port 25 blocked.** Some providers block port 25 on new servers. Ask yours whether incoming and outgoing port 25 is open; `ss -ltn | grep ':25 '` shows whether Postfix listens. - **Reverse DNS.** **Check DNS** on the **Email** page shows where the server's IP address points back to. Set its reverse DNS (PTR) to the mail host name with your provider, or Gmail and others may refuse your mail. - **DNS records.** On the domain's **DNS records** tab, MX, SPF, DKIM and DMARC should show **In place**. When the domain's DNS is elsewhere, copy the records there. ### The panel's own email (invites, resets, alerts) is not sent On **System > Panel Email**, **Send test email** shows a plain reason for a failure: a wrong password, a port that does not answer, or the wrong security option for the port (SSL/TLS goes with 465, STARTTLS with 587). Many providers block outgoing port 25, so use 587 or 465. Alert emails are sent by the worker, so it must be running (`vaultpanel status`). See [Email hosting](https://docs.vaultpanel.net/guides/dns-and-email/email-hosting) and [Panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email). ## Backups and cron jobs | Error or symptom | Fix | | --- | --- | | `BACKUP_DISK_FULL` | Less than 512 MB is free where backups are kept (`/var/backups/vaultpanel`). Delete old backups, lower a schedule's keep count, or change `backupMinFreeBytes` in the agent's config. | | `BACKUP_CORRUPT` | The file no longer matches the checksum taken when it was made, so it is not restored. Use another backup. | | A backup shows **Missing** | It was removed from the server by hand. | | `BACKUP_TOO_LARGE` on a download | The backup is bigger than `VAULTPANEL_BACKUP_DOWNLOAD_MAX_MB` (10 GB by default). Copy it from the server with `scp`. | | A restored app does not start (`HEALTH_CHECK_FAILED`) | The files are back but the health check failed. Restore the safety copy taken just before, or deploy again. | | "Cron is not installed" | Install Cron from the **Scheduler** card on the server's **Automation** tab, then save the job again. | | A cron job never runs | Check its next run on the **Cron Jobs** page: schedules use the server's time zone, shown in the form. | See [Backups](https://docs.vaultpanel.net/guides/backups-and-automation/backups) and [Cron jobs](https://docs.vaultpanel.net/guides/backups-and-automation/cron-jobs). ## Webhooks and alerts ### A webhook delivery says "which webhooks may not reach" Webhooks never call the panel's own machine, link-local or cloud metadata addresses. Private networks (10.x, 172.16-31.x, 192.168.x) are refused too unless `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE=true`. New installs set it to `false`; panels installed before that default changed keep `true`. ### An alert never fires A metric must stay over the threshold for the rule's whole duration, and the server must be online with fresh data; while it is offline only the "server offline" rule is evaluated. The worker checks rules every 15 seconds, so it must be running (`vaultpanel status`). ## Firewall, SSH and Fail2ban ### `LOCKOUT_REFUSED` VaultPanel is protecting your way in: a firewall rule that would block SSH, the panel or your own address, or an SSH change that would leave no administrator able to sign in. Add the replacement first (another rule for the port, or your SSH key), then try again. ### Locked out of SSH anyway For example by a rule added with `ufw` by hand. Use your provider's web console, then run `ufw allow 22/tcp` or `ufw disable`. For SSH settings, remove `/etc/ssh/sshd_config.d/00-vaultpanel.conf` and run `systemctl reload ssh`. ### SSH errors | Error | Fix | | --- | --- | | Cannot connect after changing the port | Use `ssh -p `. A firewall at your hosting provider may need the port opened too. Keep the old port open until you have signed in on the new one. | | `PORT_IN_USE` | Another program listens on that port. Pick another. | | `SSH_NOT_LISTENING` | SSH did not answer on the new port, so the old setting came back. `journalctl -u ssh` says why (SELinux or AppArmor rules can refuse other ports). | | `SSHD_OVERRIDDEN` | A line elsewhere in `/etc/ssh/sshd_config` or its `sshd_config.d` folder sets the same option and wins. Remove or comment it out and save again. VaultPanel's file is `00-vaultpanel.conf`. | | `SSHD_CONFIG_INVALID` | Shows what `sshd -t` said. The previous settings stay. | | `KEYS_NOT_WRITABLE` | The agent's service cannot write `/root/.ssh`. Update the agent (0.6.0 and newer). | | `JAIL_FAILED` | Fail2ban's SSH jail did not start, usually because `python3-systemd` is missing: `apt install python3-systemd`, then save again. `/var/log/fail2ban.log` has the details. | See [Firewall](https://docs.vaultpanel.net/guides/security/firewall) and [SSH](https://docs.vaultpanel.net/guides/security/ssh). ## The AI assistant | Symptom | Fix | | --- | --- | | It keeps "thinking" and never answers | Answers are written by the worker, so it must be running (`vaultpanel status`). After 10 minutes the question is marked failed and **Try again** appears. | | The provider rejected the key, or the model was not found | Open **System > Assistant Settings** and use **Test connection**. For Ollama and similar services, choose the OpenAI-compatible provider with an address ending in `/v1` (for example `http://127.0.0.1:11434/v1`) and a model that supports tool calling. | | A server's agent is too old to list ports | Update that server's agent (0.9.0 adds listening ports). | See [AI assistant](https://docs.vaultpanel.net/guides/ai-assistant). ## Development checkouts ### `connect ECONNREFUSED 127.0.0.1:3307` From `npm run db:migrate` or the backend: the panel's development MariaDB is not running. Bring the containers up with `docker compose -f docker/compose.yml up -d`, wait until `docker compose -f docker/compose.yml ps` shows MariaDB healthy, then migrate and restart the backend. The containers restart after a reboot as long as Docker starts at boot (`systemctl enable docker`). See [Development](https://docs.vaultpanel.net/developers/development). --- # Frequently asked questions URL: https://docs.vaultpanel.net/faq > Short answers to common questions about installing, running, securing and extending VaultPanel, with links to the full guides. Short answers, each with a link to the page that explains more. If your question is about an error, start with [Troubleshooting](https://docs.vaultpanel.net/troubleshooting). ## General ### What is VaultPanel? A web control panel for Linux servers. You connect a server, then deploy and run websites and applications with their domains, databases, SSL, process management, monitoring, backups and security, with little manual Linux administration. See [Introduction](https://docs.vaultpanel.net/getting-started/introduction). ### How does the panel manage my servers? A small agent runs on each server and connects out to the panel over HTTPS. The panel sends signed jobs from a fixed catalog of operations, and the agent checks the signature and the parameters before it runs fixed commands without a shell. There is no endpoint that runs arbitrary commands. See [How it works](https://docs.vaultpanel.net/getting-started/how-it-works). ### Do my servers need an open inbound port for the agent? No. Agents connect out to the panel and long-poll it for work, so servers need no inbound port for VaultPanel. The panel's own server needs its panel port (8090 by default) reachable by the people and agents that use it. ### I used NodePanel. Can I upgrade to VaultPanel? NodePanel was renamed to VaultPanel in 0.2.0. Nothing converts a NodePanel install, its agents or its tokens: remove NodePanel, install VaultPanel and add each server again. See the [Changelog](https://docs.vaultpanel.net/changelog). ## Installation and updates ### Which systems are supported? The installer supports Ubuntu 22.04, 24.04 and 26.04, and Debian 12 and 13, with systemd, run as root. 2 GB of memory or more is recommended, and a fresh server is best. See [System requirements](https://docs.vaultpanel.net/getting-started/system-requirements). ### Do I need a domain to install the panel? No. The panel serves HTTPS on its port from the first start with a self-signed certificate, and servers can be added safely without a domain because agent install commands pin that certificate. Add a domain later for a certificate browsers trust. See [Panel HTTPS and domain](https://docs.vaultpanel.net/getting-started/panel-https-and-domain). ### Which database server do my websites and apps get? MariaDB, chosen with `DB_ENGINE` when you install (12.3, 11.8, 11.4, 10.11 or 10.6, depending on the system), or `DB_ENGINE=NONE` for none. A server that already has MariaDB or MySQL keeps it. MySQL 8.4 and 8.0 come in a later version. The panel's own database is separate. See [Installation](https://docs.vaultpanel.net/getting-started/installation). ### How do I update VaultPanel? Run `sudo vaultpanel update`. It backs the panel up, installs the newest `vaultpanel` package, updates the database and restarts. `sudo apt upgrade` does the same with the system's other packages, and `sudo vaultpanel rollback` reverses the last update. See [Updating](https://docs.vaultpanel.net/getting-started/updating). ### How do I back up the panel itself? A timer backs up the panel's database, settings, secret key and certificate every day, and `sudo vaultpanel backup` makes one now. Keep a copy off the server. Website, app and database backups are separate, under **Backups** in the panel. See [Backing up the panel](https://docs.vaultpanel.net/getting-started/backing-up-the-panel). ## Servers and agents ### Does the agent run as root? The agent that talks to the panel runs as its own `vaultpanel-agent` user with no capabilities (agent 0.36.0 and newer). A separate root helper on a local socket runs only jobs and terminal sessions whose signature it has checked itself. See [Agent](https://docs.vaultpanel.net/developers/agent). ### How do I update the agents on my servers? When the panel has a newer agent than a server, the server's page shows **Update agent**. A bulk action updates many servers at once and skips the ones already current. Agents older than 0.7.0 need the upgrade command shown on their page once, and so do servers still on the old Node.js agent: the command moves them to the current agent and keeps their registration. See [Server groups](https://docs.vaultpanel.net/guides/servers/server-groups) and [Moving from the Node.js agent](https://docs.vaultpanel.net/guides/servers/connecting-servers#moving-from-the-nodejs-agent). ### Do my servers need Node.js? Not for the agent. It is one program written in Rust, for x86-64 and arm64 servers, with nothing else to install. Node.js is only needed on servers that run Node.js apps or PM2, installed system-wide. See [Connecting servers](https://docs.vaultpanel.net/guides/servers/connecting-servers#requirements). ### Can I open a shell on a server from the panel? Owners can open a root terminal in the browser, from **Terminal** in the sidebar or a server's **Terminal** tab. Sessions can be recorded and replayed. See [Terminal](https://docs.vaultpanel.net/guides/servers/terminal). ## Websites and SSL ### What kinds of websites can I host? Static websites (with a single-page app setting), PHP sites on PHP-FPM with a PHP version per site (7.4 and 8.0 to 8.5), and reverse proxies to an app. NGINX is set up for you. See [Websites](https://docs.vaultpanel.net/guides/websites). ### Does VaultPanel support .htaccess files? Yes, through Apache behind NGINX. Install Apache from the server's **Web stack** card, then turn on **Use .htaccess files** in a website's settings. Staff can also add custom NGINX rules. See [NGINX rules and .htaccess](https://docs.vaultpanel.net/guides/websites/nginx-and-htaccess). ### Which certificates can I use? Free Let's Encrypt certificates, certificates you upload, and Let's Encrypt wildcard certificates through the panel's own DNS zones, Cloudflare or Namecheap. See [SSL certificates](https://docs.vaultpanel.net/guides/websites/ssl-certificates). ### Can I install WordPress in one step? Yes. The app installer sets up WordPress, Joomla, Drupal or Laravel with its database. See [CMS installer](https://docs.vaultpanel.net/guides/websites/cms-installer). ### Can I move websites from cPanel? Yes. **Websites** > **Move from cPanel** takes a cPanel full account backup and moves its websites, databases and email (mailboxes with their passwords, mail and forwarders) to one of your servers. See [Moving from cPanel](https://docs.vaultpanel.net/guides/websites/moving-from-cpanel). ### Can I upload files over SFTP? Yes. A website's **SFTP** tab turns on SFTP for the website's own user, with a password or SSH keys. The account sees only its website's folder and gets no shell. See [SFTP](https://docs.vaultpanel.net/guides/websites/sftp). ### Does VaultPanel protect websites from attacks and malware? Yes. Each website can use a [web application firewall](https://docs.vaultpanel.net/guides/websites/web-application-firewall) (ModSecurity with the OWASP Core Rule Set) that only logs or blocks attacks, and PHP sites can limit WordPress sign-in attempts. ClamAV scans websites for malware, on demand or weekly, and can quarantine what it finds; see [Malware scanning](https://docs.vaultpanel.net/guides/websites/malware-scanning). ### Can I see how many visitors a website has? Yes. A website's **Statistics** tab shows visitors, page views, traffic, bots and errors per day, read from its access logs. No addresses or user agents reach the panel. See [Website statistics](https://docs.vaultpanel.net/guides/websites/statistics). ### Does email hosting include webmail or spam filtering? Yes. Email hosting runs Postfix, Dovecot and OpenDKIM with mailboxes, forwarders and DKIM-signed mail. **Filter spam** on a mail server turns on Rspamd, which moves spam to the **Junk** folder and refuses the worst. **Set up webmail** installs Roundcube on a website of its own. Virus filtering of mail, autoresponders and catch-all addresses are planned. See [Spam filtering](https://docs.vaultpanel.net/guides/dns-and-email/spam-filtering), [Webmail](https://docs.vaultpanel.net/guides/dns-and-email/webmail) and the [Roadmap](https://docs.vaultpanel.net/roadmap). ## Apps and databases ### Which languages can I deploy? Node.js, Python, Go and Ruby apps, and PHP websites, deploy from Git into release folders and run under PM2 as their own Linux user. They can be rolled back, deployed on every push through signed webhooks, and capped on CPU and memory. Node.js apps reload without downtime. See [Applications](https://docs.vaultpanel.net/guides/applications). ### Can I run Docker containers? Yes, from public images, with ports, named volumes, environment variables and limits. An update rolls back automatically when the new container does not start. Private registries and Compose files are planned. See [Containers](https://docs.vaultpanel.net/guides/applications/containers). ### Are PostgreSQL and Redis supported for my apps? Not yet. Databases are MariaDB today; PostgreSQL and Redis are shown as **Coming later** on the **Databases** page. See [Databases](https://docs.vaultpanel.net/guides/databases). ### Where can backups be stored? On the server, in an S3-compatible bucket (Amazon S3, Backblaze B2, Wasabi, Cloudflare R2, MinIO), or on another server over SFTP. See [Backup storage](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage). ## Security ### Does the panel run as root? No. The API and the worker run as the unprivileged `vaultpanel` user inside a systemd sandbox. Only the step that connects the panel's own server, before the API starts, runs as root. See [Security](https://docs.vaultpanel.net/guides/security). ### Can I require two-factor sign-in? Yes. Under **Security > Authentication**, owners can require it for **Owners and admins** or **Everyone**. Two-factor sign-in comes with 10 one-time recovery codes. See [Sign-in and two-factor](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor). ### Can I sign in with a passkey? Yes. Add one under **Account** > **Passkeys**, then choose **Sign in with a passkey** on the sign-in page: your fingerprint, face or device PIN replaces the email, password and code. A passkey counts as two-factor sign-in. The panel must be opened on its domain name over HTTPS. See [Passkeys](https://docs.vaultpanel.net/guides/security/sign-in-and-two-factor#passkeys). ### Can I limit who can reach the panel? Yes. **Panel access by address** accepts people only from the addresses and networks you list. With **Staff only**, hosting customers still sign in from anywhere. See [Panel access](https://docs.vaultpanel.net/guides/security/panel-access). ### What does the AI assistant send to its provider? The questions, and what it reads to answer them: status, log lines and process lists. Environment variable values, database passwords and keys are never given to it. To keep that data on your servers, use the free model on the panel's own server or a self-hosted OpenAI-compatible service. See [AI assistant](https://docs.vaultpanel.net/guides/ai-assistant). ## Hosting and billing ### Can I host customers on VaultPanel? Yes. Hosting plans set how many websites, apps, databases and cron jobs a customer may have, their disk space and caps on each app. Customers sign in to a panel that shows only their own account. See [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing). ### Does VaultPanel take payments? No. A billing system such as WHMCS, Blesta or your own charges customers and manages their accounts through the billing API. A WHMCS module is available; there is no Blesta module yet. See [Billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api) and [WHMCS](https://docs.vaultpanel.net/guides/hosting-and-billing/whmcs). ## Licensing ### Is VaultPanel free? VaultPanel is proprietary software, free to use under the VaultPanel License. You may install and use it, also to host your customers, but not copy, change, resell or redistribute it. ### Under which license are the SDK, CLI and WHMCS module? MIT. The SDK, the CLI, the WHMCS module and the example plugin each come with their own MIT license, so other software can be built with them. ### Where do I report a bug or a security issue? Report bugs in the issues of [VaultPanel/packages](https://github.com/VaultPanel/packages) on GitHub, which holds the installer and the packages. Never report a vulnerability in a public issue: use **Security > Report a vulnerability** on the same repository, with what an attacker can do, the steps to reproduce it and your versions (`vaultpanel version`). ## API and integrations ### Is there an API? Yes, a REST API at `/api/v1`. Scripts authenticate with API tokens (`vpt_…`) that act as the person who made them, narrowed to the scopes they were given. See the [API reference](https://docs.vaultpanel.net/api-reference) and [API tokens](https://docs.vaultpanel.net/api-reference/api-tokens). ### Is there a command-line tool or SDK? Yes. `@vaultpanel/sdk` is a JavaScript client for the API, and the `vaultpanel` command-line tool is built on it. On the panel's server, the `vaultpanel` command also passes panel commands to the CLI. See the [CLI reference](https://docs.vaultpanel.net/cli) and [SDK](https://docs.vaultpanel.net/developers/sdk). ### Can I extend the panel? Yes, with plugins: separate programs that an owner approves, which then work through the API with their own token, receive signed events and can add a page to the sidebar. See [Plugins](https://docs.vaultpanel.net/developers/plugins). --- # Privacy URL: https://docs.vaultpanel.net/privacy > What VaultPanel collects (nothing from your panel), what its websites keep, and how operators handle personal data with GDPR export, erasure and audit log retention. ## Your panel sends us nothing VaultPanel is self-hosted. A panel and its agents never contact the VaultPanel project: - no usage statistics; - no error reports; - no licence or update check-ins. Your servers fetch updates from `installer.vaultpanel.net` only when you run `vaultpanel update` or `apt upgrade`, like any other package repository. The panel sends data elsewhere only through features you turn on, such as panel email, the AI assistant, backup storage and Let's Encrypt. Whoever runs a panel decides what it holds and is responsible for it. [Personal data and GDPR](https://docs.vaultpanel.net/guides/security/personal-data) lists the personal data a panel keeps, where it goes and how long it stays. It also explains how to answer requests. ## Handling personal data in your panel - **Copies (access and portability):** people download their own data under **Account > Download my data**. Admins export anyone's under **Users > Export personal data**. - **Erasure:** deactivate the account on **Users**, then use **Erase personal data**. - The person's name, email, sessions, tokens and conversations are removed. - The audit log keeps what the account did, but no longer shows who they were. - **Audit log retention:** choose how long entries are kept on the **Audit log** page, from 90 days to 10 years. Unset, they are kept forever. The database refuses to delete anything younger than the period, so recent history stays tamper-proof. - **Backups:** copies sent to storage are [encrypted](https://docs.vaultpanel.net/guides/backups-and-automation/backup-storage#encryption) before they leave your servers. - **What newer features keep:** - Passkeys: only the public key, its name, the panel address, a signature counter and when it was last used. - The web application firewall's log, on each website's server: the request line, the client's address and the rules that matched, never headers or bodies. Kept for 7 days. - Website statistics: day totals and top lists only, with no addresses or user agents. Kept for 400 days. - Moving from cPanel: the backup is deleted from the server after the move, and mailbox password hashes never stay in the job's stored output. - SFTP passwords: stored as hashes only. Details are in [Personal data and GDPR](https://docs.vaultpanel.net/guides/security/personal-data#passkeys). - **Hosting providers:** a data processing agreement template (GDPR art. 28) for your customers comes with VaultPanel (`legal/dpa-template.md`). ## This website and the installer site **docs.vaultpanel.net** (this site): - sets no cookies; - runs no analytics or tracking scripts; - loads no third-party content. Its web server logs each request: IP address, page, browser and time. The logs are kept for [number] days to keep the site running and secure, then deleted. **installer.vaultpanel.net** is hosted on GitHub Pages, and the npm packages are on npmjs.com. Those services keep their own access logs under their own privacy policies. When you report a security problem through GitHub, we receive what you send there. ## Who we are The VaultPanel project is run by [legal name of the owner], [address]. Contact: [privacy contact email]. You can ask what personal data we hold about you, and ask us to correct or delete it. You may also complain to your data protection authority. --- # Roadmap URL: https://docs.vaultpanel.net/roadmap > What VaultPanel does today and what is planned next, by area: servers, websites, apps, data, backups, security, hosting, the assistant and integrations. VaultPanel is built in phases. Phases 0 to 9 are done, and most of Phase 10: containers, API tokens, the CLI and SDK, plugins, and scaling an app on one server. This page lists what you can use today and what is planned. Planned items have no release dates. In the panel, planned options are marked **Coming later** and cannot be selected, for example PostgreSQL and Redis on the **Databases** page. ## Phases | Phase | Scope | State | | --- | --- | --- | | 0 | Architecture, database layer, CI | Done | | 1 | Sign-in, two-factor, users, roles and permissions, audit log, dashboard, agent registration, jobs | Done, except custom roles | | 2 | Server management and monitoring: metrics, services, processes, alerts | Done | | 3 | Websites, domains, NGINX, PHP-FPM, SSL, file manager | Done, except the items below | | 4 | Node.js and Python apps, databases, Git deployment, PM2 | Done, except the items below | | 5 | Backups, cron jobs, automation, logs | Done, except the items below | | 6 | Security hardening, isolation, firewall, auditing | Done, except the items below | | 7 | Several servers: server groups, bulk actions, agent updates from the panel | Done, except the items below | | 8 | Hosting plans, customers, quotas, a billing API | Done, except the items below | | 9 | AI assistant: answers from the panel's own data, fixes proposed for approval | Done, except the items below | | 10 | Containers, plugins, CLI, SDK, API tokens, scaling | Containers, API tokens, CLI, SDK, plugins and scaling on one server done; scaling across servers not started | ## Available today | Area | What you can use | Guide | | --- | --- | --- | | Servers | Agents on every server, live and historical monitoring, alerts, server self-check, browser terminal with recordings, logs, server groups and bulk actions | [Servers](https://docs.vaultpanel.net/guides/servers) | | Websites | Static, PHP (7.4, 8.0 to 8.5) and reverse-proxy sites, single-page apps, wildcard domains, Let's Encrypt, uploaded and wildcard certificates, custom NGINX rules, `.htaccess` through Apache, PHP settings, page cache, file manager, SFTP, Git deploy, uptime monitoring, statistics, CMS installer, WordPress tools, staging and clones, a web application firewall, malware scans, moving from cPanel | [Websites](https://docs.vaultpanel.net/guides/websites) | | DNS and email | DNS zones on your own servers (BIND), Cloudflare and Namecheap for wildcard certificates, email hosting with mailboxes, forwarders and DKIM, spam filtering, webmail, panel email for invites, resets and alerts | [DNS and email](https://docs.vaultpanel.net/guides/dns-and-email) | | Apps | Node.js, Python, Go and Ruby apps and PHP sites from Git, rollbacks, signed push-to-deploy webhooks, zero-downtime reloads for Node.js, several copies on one server, CPU and memory limits, Docker containers | [Applications](https://docs.vaultpanel.net/guides/applications) | | Data | MariaDB databases and users, a SQL client in the panel, one-click phpMyAdmin, import and export, a Redis object cache for WordPress | [Databases](https://docs.vaultpanel.net/guides/databases) | | Backups and automation | Scheduled backups to the server, S3-compatible storage or SFTP, cron jobs, webhooks to JSON, Slack and Discord | [Backups and automation](https://docs.vaultpanel.net/guides/backups-and-automation) | | Security | Firewall with incoming and outgoing rules, SSH settings, port and keys, Fail2ban, security updates, two-factor sign-in, passkeys, panel access by address, audit log, an agent that runs without root | [Security](https://docs.vaultpanel.net/guides/security) | | Hosting | Plans, customers, quotas, suspension, a billing API, a WHMCS module, a financial report | [Hosting and billing](https://docs.vaultpanel.net/guides/hosting-and-billing) | | Assistant | Claude, OpenAI-compatible services, or a free model on the panel's own server, on its own page or at the side of every page | [AI assistant](https://docs.vaultpanel.net/guides/ai-assistant) | | Extending | REST API with scoped tokens, JavaScript SDK, CLI, plugins and plugin directories | [Developers](https://docs.vaultpanel.net/developers) | ## Planned ### Users and access - Custom roles. - Limiting staff users to some servers or groups. Today every staff user with a permission has it on every server; hosting customers only ever see their own account. - Email alerts about sign-ins. - Tokens that belong to the panel rather than to a person, and per-token IP allowlists. ### Servers - Repairing a failed self-check from the panel. - Bulk actions for more operations (installing software, firewall rules, SSH keys on many servers), scheduled bulk actions, and webhooks when a bulk action finishes. - Rolling back an agent update from the panel. The previous version is kept on the server as `/usr/local/bin/vaultpanel-agent.previous`. - Private networking between servers. - The terminal for admins and other roles, shells as a user other than root, and uploading files by dragging them onto the terminal. - Other Linux distributions for the installer, a trusted certificate straight from the installer (a panel domain gives one today), and uninstalling with one command. ### Monitoring - Uptime checks from more than one location, custom paths, expected text or status codes per website, a public status page, and alerting customers about their own websites. - Shipping logs to an outside service, and log files other than the journal, NGINX and app logs. - Container metrics history and alerts (live CPU and memory already show on a container's page). ### Websites - Per-site resource limits (CPU, memory, disk quotas) and chroot isolation for PHP sites. - Per-plan lists of allowed PHP versions, `php.ini` settings per site beyond the **PHP settings** card, and choosing extra PHP extensions. - Letting customers write their own NGINX rules, `php_value` lines in `.htaccess`, and Apache modules beyond rewrite, headers, expires and the basics. - Moving or copying a website, app or database to another server. Copies on the same server, staging and moving from cPanel are available. ### DNS and email - Secondary name servers on a second panel server (zone transfers), DNSSEC, importing a zone file or from another provider, and customers managing their own zones. - Other DNS providers (such as DigitalOcean and Route 53), managing a provider's records from the panel beyond the certificate check, and checking a provider's credentials when they are saved. - Virus filtering of mail, learning from spam, autoresponders and filters, catch-all addresses, sending limits, customers managing their own email, mail backups, and plan quotas for mailboxes. ### Apps and containers - Running one app on several servers with a load balancer in front, and scaling automatically on load. - Zero-downtime reloads for Python, Go and Ruby apps, and shared folders that survive deploys for PHP sites deployed from Git (such as uploads or Laravel's `storage/`). - A per-plan limit on app copies for hosting customers (their plan's CPU and memory caps already cover all copies). - Private registries (Docker Hub accounts, GHCR or your own), Docker Compose files and multi-container stacks, and building images from a Git repository. - Mounting server folders into containers (bind mounts) and choosing other networks. - Backups of container volumes, and moving containers between servers. ### Databases - PostgreSQL, and Redis as a database (Redis is available as WordPress's object cache). - MySQL 8.4 and 8.0 as the database server for websites and apps. - Remote (non-local) database access. - Separate database users for migrations and for runtime. - Database replication. ### Backups - Restoring a backup into a new website, app or database, or onto another server. Restores go back in place today. - Encrypting backups kept on the server. Copies sent to backup storage are encrypted before they leave it, and panel backups can be encrypted. - Backups of the whole server or of mail. - One backup holding a website's or app's files and its database together. - Copying the panel's own backups to the storage set up in **Backups > Storage** (`VAULTPANEL_BACKUP_UPLOAD` runs any command instead). - Cron jobs as root or with shell features such as pipes and redirects. A wrapper script in the site's folder can do those as the site's user. ### Security - Narrower root helpers per kind of operation (packages, NGINX, users, systemd). The agent already runs as its own user; what the panel signs still runs as root in its helper. - Firewall rules for routed traffic, editing rules added outside VaultPanel, and firewalld. - Limiting SSH to some addresses. VaultPanel keeps SSH open to everyone so it can never lock you out. - Viewing the packages a security update would install before installing it. - Renewing the panel's self-signed certificate without updating each agent. - A shared rate-limit store for several API instances. ### Hosting and billing - Taking payments, invoices and tax inside VaultPanel. A billing system charges customers and calls the [billing API](https://docs.vaultpanel.net/guides/hosting-and-billing/billing-api). - A Blesta module. - Welcome emails, and warnings when an account nears or passes a limit. - Bandwidth limits, and mail and FTP accounts as plan limits. - Hard disk quotas enforced by the file system. Today the disk limit stops new websites, apps and databases once reached, but a site can still grow past it until it is measured again (about every 15 minutes). - Customers adding their own SSH keys, changing PHP versions server-wide, or seeing server logs and metrics; resellers. - Moving a customer to another server with their sites. ### AI assistant - The assistant for hosting customers (staff only today). - Answers that appear word by word. - Per-user keys and spending limits beyond 60 questions an hour per person. - Reading website files, database contents, firewall rules or backups, and proposing changes to files or settings. ### Plugins and integrations - A central VaultPanel marketplace with ratings, reviews and paid plugins. - Plugins adding panels to existing pages (today they add pages of their own), settings forms the panel draws for a plugin, and more events (website and app changes, sign-ins). - A Python SDK. Plugins will not run inside the panel's process: they stay separate programs on purpose. See [Plugins](https://docs.vaultpanel.net/developers/plugins). --- # Changelog URL: https://docs.vaultpanel.net/changelog > Release notes for VaultPanel: what was added, changed, fixed and secured in each version, up to 0.3.0. {/* Generated from CHANGELOG.md by scripts/sync-changelog.mjs. Do not edit by hand. */} All notable changes to VaultPanel. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/). Releases are the `vX.Y.Z` tags; the agent keeps its own version (`agent/Cargo.toml`). To update a server, see [Updating](https://docs.vaultpanel.net/getting-started/updating). ## Unreleased [#unreleased] ### Changed - **The server agent is now written in Rust, and the Node.js agent is gone.** The agent is one program per CPU type (x86-64 and arm64), `/usr/local/bin/vaultpanel-agent`, with nothing else to install on a server: no Node.js. It runs all of the panel's operations, speaks the same protocol (checked by the conformance suite on every change) and keeps the same config, registration, cron jobs and security model (its own user plus a root helper). Its version is `0.50.2-rs.1` (0.43.0 added PHP settings, database imports, WordPress tools, site copies, the page cache, the Redis object cache and malware scanning; 0.44.0 the web application firewall; 0.45.0 spam filtering and webmail; 0.46.0 webmail updates; 0.47.0 SFTP accounts; 0.48.0 moving websites from cPanel; 0.49.0 website statistics; 0.50.0 email moved from cPanel; 0.50.1 root helper fix; 0.50.2 removing Ollama). - The panel's own server moves to it by itself when the panel starts. Other servers move with the upgrade command on their page; **Update agent** and bulk updates work from then on, each server getting the program for its CPU type. - The release builds the programs and puts them in the package (`agent/dist`). A package built by hand needs them built first, or `VAULTPANEL_PACKAGE_WITHOUT_AGENT=1`. - `VAULTPANEL_AGENT_RUST` is gone (there is only one agent), and `/api/v1/agent/package.tgz` with it. `install-agent.sh` still accepts `--rust` and ignores it. - The agent's code is in `agent/` (it was `agent-rs/` while both agents existed); its CI workflow is `.github/workflows/agent.yml`. ### Fixed - Creating a website failed with "useradd: group ... exists" when a deleted website had the same name: deleting a site left its Linux group behind (it still had the web server user in it). Deleting a site now removes its group, and a group left that way is reused. - The WordPress tools (maintenance mode, debug logging, object cache, updates, sign-in), staging/clone/push to live, malware scans and quarantine, and emptying the page cache all failed in the browser with "n.job is undefined": the panel's answer was read one level too high. The change was still sent and made; only the page did not follow it. - The app installer's list showed a blank page when an install had failed (the error was shown as an object instead of its message). - Setting up phpMyAdmin over HTTPS failed with "There is no certificate for ... on this server" although the panel domain had one. The agent runs as its own user and cannot read /etc/letsencrypt; it now leaves checks like that to its root helper, which checks again as root, and refuses a job itself only for bad parameters or the agent's own policy. - The agent did not compile for musl with newer Rust (open and openat declared without `...`). ### Added - **Spam filtering.** Each mail server on the Email page has **Filter spam**: Rspamd (installed when needed) checks every message that arrives (SPF, DKIM, DMARC, blocklists, the message itself). Above the junk score (6 by default) the message goes to the mailbox's **Junk** folder, through a Sieve rule Dovecot runs before delivery; above the refuse score (15) the mail server refuses it, so the sender is told. Turning it off puts Postfix back as it was and stops Rspamd. New agent operation `MAIL_SPAM`, `PUT /mail/servers/:serverId/spam` (agent 0.45.0). No Bayes learning yet. - **Webmail.** **Roundcube** joins the app installer, and the Email page has a **Webmail** card with **Set up webmail**. It goes on a website of its own (such as webmail.example.com) and its mailboxes sign in with their address and password: IMAP and SMTP through the mail server on the website's server, or else the first one set up. The newest stable release comes from GitHub, checked against its SHA-256; the site serves only its `public_html`, so its settings and logs are never public. - **Fixed: "Remove Ollama and all models" could report success with Ollama still there.** The agent passed over folders it could not delete; it now checks afterwards that the service, the program and the models are gone and fails naming what is left (agent 0.50.2). While the assistant answers with a model on the server, the page now says why the button cannot be used (choose another provider and save first) instead of only on hover. - **Packaging: an out-of-date web interface is refused.** `build-deb.sh` packages `frontend/dist` as it is, so a package built after `git pull` without `npm run build` carried the old interface (and its fixed bugs, such as "n.job is undefined" in the WordPress tools). It now stops when any file in `frontend/src` or `shared/src` is newer than the build, with the command to run (`VAULTPANEL_PACKAGE_STALE_UI=1` packages it anyway). - **AI Assistant on every page.** A round **AI Assistant** button at the bottom right of the panel (for everyone allowed to use the assistant, not on the Assistant page itself) opens the assistant in a panel at the side: ask, follow the answer, approve or cancel proposed changes without leaving the page. A new conversation says which page it was asked from; the panel keeps its conversation while you move between pages, **New** starts another and the arrow opens it on the full Assistant page. Esc closes it. - **Fixed: jobs failing with "Permission denied" (for example `SSHD_CONFIG_INVALID ... 50-cloud-init.conf: Permission denied`).** When the agent started a moment before its root helper had opened its socket (after an update or a reboot), it never connected to the helper and ran jobs as its own user. It now waits for the helper whenever the helper is installed, and if it still is not connected it refuses jobs with `HELPER_UNAVAILABLE` and the command that fixes it, instead of failing half way (agent 0.50.1). - **Website statistics.** A website's new **Statistics** tab shows visitors, page views, traffic, bots and errors per day for 7 days, 30 days, 90 days or a year, with the top pages, where visitors came from, browsers, systems and pages not found. They come from the website's NGINX access log (rotated and compressed copies too), read on its server once a day and with **Read now**. Only the day totals reach the panel: no addresses or user agents. A visitor is a different address and browser on a day; images, styles, scripts and bots are not page views. The first read goes back 14 days; statistics are kept for a year. New agent operation `WEBSITE_STATS`, `GET /websites/:id/stats` and `POST /websites/:id/stats/refresh` (agent 0.49.0). - **Move websites from cPanel.** **Websites** > **Move from cPanel** takes a cPanel full account backup (`backup-….tar.gz` or `cpmove-user.tar.gz`, up to `VAULTPANEL_FILE_UPLOAD_MAX_MB`, 2 GB by default). The chosen server reads it and lists its websites (main, addon and subdomains, with their aliases, folders and PHP versions) and databases; pick what to move and the names to use. Each website is made the usual way (its own user, folder and PHP), then its files are unpacked into it, owned by the website, without setuid bits and leaving out the folders of other websites; each database is made with its own user and the dump imported as an account that can only reach it, and a WordPress whose `wp-config.php` uses a moved database is pointed at the new one. Nothing is read outside the backup, and the backup is deleted from the server once moved. Email comes too (agent 0.50.0): pick its domains and each gets its mailboxes, with the passwords they had (cPanel's SHA512-CRYPT hashes, which never stay in a job's stored output), quotas and all their mail (folders, read and unread, owned by the mail server's account, links and Dovecot's old indexes dropped), and its forwarders. Addresses the server already has are left alone; mailboxes whose password cannot come over are listed to get a new one. New agent operations `MIGRATION_INSPECT`, `MIGRATION_RESTORE` and `MIGRATION_DISCARD` and the `/migrations` routes (agent 0.48.0). - **Passkeys.** Sign in with a fingerprint, face or device PIN: **Sign in with a passkey** on the sign-in page needs no email, password or code. Add them on **Account** > **Passkeys** (with the account's password), one per phone, computer or security key, and remove them there. A passkey works only on the panel address it was made on (so it cannot be phished), the device must check it is you, each sign-in challenge works once, and a counter that goes backwards is refused. A passkey counts as two-factor sign-in, for the two-factor policy too. Checked by the panel itself (ES256, EdDSA, RS256), no new packages. The panel must be opened on its domain name over HTTPS. - **SFTP for websites.** A website's new **SFTP** tab turns on SFTP for its own user: sign in with FileZilla, WinSCP, Cyberduck or `sftp` using a password (generated, shown once) and/or SSH keys, with the host, port, username and command to copy. The account sees only `/` (sshd locks it into a root-owned folder onto which the website's home is mounted, again after every reboot), with the website's own rights, and gets SFTP only: no shell, forwarding or tunnels. Passwords are kept as hashes only. Deleting a website or turning SFTP off takes it all away. New agent operation `SFTP_APPLY`, `GET`/`PUT /websites/:id/sftp` (agent 0.47.0). - **Webmail updates.** Each Roundcube on the Email page shows its version and, once a newer one is out, **Update to …**; **Check for updates** asks now, and **Update automatically** lets the panel update it by itself. The panel checks every Roundcube about once a day. The update uses Roundcube's own `installto.sh` (settings, logs and mail data kept) and then updates its tables, from a release checked against its SHA-256 like an install; it never goes back to an older version. New agent operation `WEBMAIL_UPDATE` (agent 0.46.0). - **Web application firewall.** Install it from a server's Security tab (new **Web application firewall** card, also on Security > Firewall): ModSecurity in NGINX with the OWASP Core Rule Set, loaded once and off for every website. Each website has a **Firewall** tab: **Off**, **Detect only** (logs what it would block) or **Block attacks** (403), rules turned off for that website when they catch real visitors, and **What the firewall caught** (the newest requests, each with its rules and **Turn off for this website**). The log keeps the request line, the address and the rules only, never headers or bodies, so no cookies or passwords. PHP websites also get **Sign-in protection**: a limit on WordPress sign-in attempts (wp-login.php and XML-RPC, POSTs only) from one address a minute, answered with 429, and optionally XML-RPC blocked. Copies of a website keep both. New agent operation `WAF_EVENTS` and site settings `waf` and `loginLimit` (agent 0.44.0). - **Malware scanning.** Install **ClamAV** from a server's Security tab (new **Malware scans** card), and optionally **Scan every website weekly** (one site at a time, low priority). Each website has a **Malware** tab: **Scan now**, the last scan, and what it found (ClamAV's malware, and PHP files in `wp-content/uploads` as suspicious), each to **Quarantine** (moved to a root-only folder the site cannot reach, and can be **Restored**), **Delete** or **Ignore**. Scans run as the site's own user, never root, and wait when the server has less than 1.2 GB free. Quarantine walks the path without following links, so a hacked site cannot make root touch other files. Infected websites appear in the dashboard's **Needs attention**. New agent operations `MALWARE_SCAN` and `MALWARE_QUARANTINE` (agent 0.43.0). - **Redis object cache for WordPress.** Install **Redis** from a server's Web stack card (Databases tab): it runs as its own `vaultpanel-redis` on 127.0.0.1:6380, as a cache only (no disk, 256 MB, least-used keys dropped), with an account per website that reaches only that site's keys and no dangerous commands; the stock password-less `redis-server` service is stopped. The **WordPress** tab's **Object cache (Redis)** card turns it on (installs the Redis Object Cache plugin when needed, writes its settings to `wp-config.php`, and checks WordPress reaches Redis, else takes it all back), shows whether it is connected, empties it, and turns it off. - **Page cache for PHP sites.** A **Page cache** card on a PHP site's Settings tab turns on NGINX's FastCGI cache, keeping finished pages for the minutes you choose (10 by default), with **Purge cache**. Signed-in visitors, forms, query strings, admin and login pages, carts, checkouts and account pages, and pages that set a cookie are never cached. WordPress tool changes (updates, plugins, theme, maintenance mode) empty it on their own; clones and staging copies keep it. The `X-VaultPanel-Cache` header shows HIT or MISS. Not with .htaccess files (Apache). New agent operation `SITE_CACHE_PURGE` (agent 0.43.0). - **Staging and clones.** A website's new **Staging & clone** tab makes a staging copy at `staging.` (its DNS record added when the zone is on the server) or clones the site to a new name and domain. The files, the databases linked to the site and its settings (PHP settings, .htaccess, custom rules) are copied; a WordPress from the app installer is pointed at its new database and address (serialized values included) and gets the WordPress tools. A staging copy shows **Push to live**, which backs the live site and its databases up first, then copies staging over live and puts the live address back. Files are read as the source site's user and written as the target's. Static and PHP sites; not sites deployed from Git. New agent operation `SITE_CLONE` (agent 0.43.0). - **WordPress tools.** A website with WordPress (from the app installer) has a **WordPress** tab: the version and available updates (**Check for updates**, **Update everything**, or one plugin or theme at a time, with the log in the job drawer), plugins on and off, the active theme, **Maintenance mode** and **Debug logging** switches, and the administrators, each with **Sign in** (a one-time link to the dashboard that works for two minutes) and **New password** (made by the panel, shown once, and the user is signed out everywhere). Everything runs on the server as the site's user against the site's own WordPress, with its plugins left out while it loads, so a broken plugin cannot lock you out. New agent operations `WORDPRESS_STATUS` and `WORDPRESS_ACTION` (agent 0.43.0); API under `/cms/installs/:id/wordpress/`. - **PHP settings for each site.** A PHP site's Settings tab has a **PHP settings** card: largest upload, memory per request, longest run time, form fields (`max_input_vars`) and PHP workers, with **Recommended for WordPress** and **Reset to defaults**. They go into the site's PHP-FPM pool (the upload size into NGINX too), tested with `php-fpm -t` and `nginx -t` before they apply. Defaults are what every site had before (64 MB, 128 MB, 30 s, 1000, 10 workers), and nothing is sent to agents while a site keeps them. API: `phpSettings` on `PATCH /websites/:id`. Needs agent 0.43.0. - **Database import and export.** A database's page has **Import** and **Export**. Import takes a `.sql` or `.sql.gz` file (phpMyAdmin, mysqldump), sent in pieces like file manager uploads, can back the database up and empty it first, and runs on the server as `nobody`, in the client's sandbox mode, as the database's own account: a dump cannot reach other databases or accounts. Export makes a fresh backup and downloads it (`.sql.gz`). New agent operation `IMPORT_DATABASE` (agent 0.43.0). - **A new dashboard.** It opens with what needs attention, each with a button to fix it: servers offline, websites down, certificates expiring in 14 days, backups and jobs that failed in the last 24 hours, firing alerts and agent updates (or "All systems normal"). Then four numbers (servers online, websites up, backups, alerts), a line with apps, deployments, databases, cron and users, quick actions (Add website, Install WordPress, Add database, Add server, Open terminal) and, for owners, a **Get started** checklist (panel domain, first website, backups, two-factor, a second server) that can be hidden. The summary API gains `attention`, `setup` and `websites.down`. - **Websites, all in one place.** Websites, Subdomains, Domains and the App Installer are one area, as in other hosting panels: one list of sites, and one page per site with all of it: Overview, Domains, Subdomains, SSL, Files, Databases, Apps, Logs, Backups, Cron and Settings, plus Deployments and Environment, and for a site that serves an application, its Application, App logs and App settings. **Add website** asks what to create: a static or PHP website, a reverse proxy, WordPress, Joomla, Drupal or Laravel, an application from Git, or a subdomain. The sidebar has one entry, Websites, instead of four (the command palette finds it by "domain" too). The old addresses (`/subdomains`, `/domains`, `/app-installer`) still work. - **A new page for new websites.** A static or PHP site starts with a styled page carrying the VaultPanel logo, the site's domain and where to upload its files (and the PHP version for PHP sites), in light or dark to match the visitor's system. Existing sites keep their page. - **A more capable File Manager.** Drag files onto the list to upload them, or pick several at once: they go up one after another with their progress listed, and names already in the folder are asked about once (replace them or skip them). Search the folder (`/`), sort by name, size or date, show or hide hidden files, and type a path to jump to it. Select several items (Shift-click for a range) to download them as one zip, move them to another folder (created if needed), change their permissions (folders and files each get their own) or delete them. Every row has a menu, also on right-click, with Open, Download, Copy path, Rename, Move, Permissions, Compress, Extract and Delete; Del, F2, Ctrl/Cmd+A and Backspace work as shortcuts. The editor is wider, with line numbers, Tab and Shift+Tab indenting (Ctrl/Cmd+M switches Tab to moving focus), Ctrl/Cmd+S to save, the cursor's line and column, word wrap and a warning before unsaved changes are lost. Images open as a preview. Nothing changes on the servers: it uses the file operations agents already have. - **The panel speaks Arabic, Spanish, French, Swahili and Chinese (Simplified).** Pick a language in the user menu, on the sign-in page, or under **Account > Preferences**, which also sets the time zone dates are shown in; both are saved to your account. Before sign-in the browser's language is used. Dates, times, numbers and sizes follow the language. Arabic is right to left: the layout mirrors, while code, commands, paths and addresses stay left to right. This release translates the sign-in pages, navigation, dashboard, account page, statuses, shared components and common error messages; other pages are still in English and follow in later releases (`npm run i18n` lists them). Translators work on standard i18next JSON files (`frontend/src/i18n/locales/`); see docs/translating.md. ### Changed - **Faster first load.** Each page of the interface is now its own file, loaded the first time it is opened: the panel downloads 437 kB (128 kB compressed) to start instead of 1.6 MB (387 kB). After an update, a tab still open on the old version reloads once instead of failing to open a page. - **Accessibility (WCAG 2.2 AA).** Text colours that were too faint now meet the contrast minimum in both themes (subtle grey, success, danger and warning text, the sidebar's group labels, white text on the active item and buttons), sortable table columns tell screen readers their order, copy buttons stay readable on light backgrounds, and a link that was only told apart by colour is underlined. Every main page passes axe-core's WCAG 2.2 A and AA checks in both themes; CI now checks it on each change. - **`VAULTPANEL_AGENT_REGISTER_LIMIT`** sets how many agents may register per hour from one address (default 30), for connecting many servers at once from behind one address. - **A new sign-in page.** Sign-in, two-factor, password reset and the "address not allowed" page share a new look: the form in a card on a dotted background, with monospaced fields and the address you are signing in to above it (a green lock over HTTPS; "not encrypted" in amber over plain HTTP). On wide screens a terminal beside it shows how to use the `vaultpanel` CLI with this panel. "Forgot your password?" now sits under the password field. - **Emails link to the panel domain.** Invites, password reset links, alerts and the test email use `https://` as soon as the domain on **System > Panel Domain** has a trusted certificate that covers it, without clicking **Use https://…** (which still decides agent install commands and webhooks, since other servers must reach the address). Until then they use the panel's IP address and port, as before. - **Designed emails.** Every email the panel sends now has an HTML version next to the plain text: the VaultPanel name, a clear heading, a button for the link (with the full link written out below it), a details table (account, panel, expiry; or event, server, time for alerts, with a coloured label for what happened) and a footer saying why it was sent. It adapts to phones and, where the mail app supports it, to dark mode. Messages queued before the update still go out as plain text. - **The documentation moved to [docs.vaultpanel.net](https://docs.vaultpanel.net).** The SSH login message and `vaultpanel motd` link there for **Documentation** and **Best Practices**, instead of www.vaultpanel.net/docs/. Servers show the new links once their agent is updated. - **Dark mode is neutral black**, matching the documentation site: black background, near-black cards and sidebar, and gray borders and text instead of navy. The blue accent, the status colors and light mode are unchanged. ### Security - **Personal data tools for GDPR and similar laws.** People download everything the panel holds about them under **Account > Download my data**; admins export anyone's, or erase a deactivated account, from **Users**. Erasing removes the person's name, email, sessions, tokens, conversations and preferences, and the audit log keeps what the account did without showing who they were. The audit log, kept forever until now, can keep entries for 90 days to 10 years (**Audit log** page); the database itself refuses to delete anything younger, and anything under 90 days. Exports and erasures are audited. docs/privacy.md lists the personal data a panel keeps, where it goes and for how long, and legal/dpa-template.md is a data processing agreement template for hosting providers. - **Third-party licences.** Each package now installs THIRD_PARTY_LICENSES.txt (`/usr/share/doc/vaultpanel`) with the licence of every open-source package VaultPanel ships, the web interface's included; CI refuses a package under a licence that is not on the allowed list. - **Backups are encrypted before they leave the server** (agent 0.42.0). Copies sent to S3-compatible storage or another server over SFTP are encrypted with AES-256-GCM, with a key per storage that the panel makes and keeps encrypted; whoever can read the bucket sees only random bytes, and a changed or truncated copy is refused when it comes back. Copies are stored as `.enc` and the backups list shows a lock on encrypted ones. **Download each storage's key** (Backups > Storage > **Key**) and keep it off the panel server: it is the only way to read the copies if the panel is lost, with the new `vaultpanel backups decrypt --key ` (CLI 0.1.3), which needs no panel. Servers whose agent is older keep copying unencrypted until they are updated; their copies say "not encrypted". - **Rate limits are shared through Redis.** The counters for sign-in, setup, password reset, agent registration, webhooks and the API are kept in Redis instead of each process's memory, so they hold when the API runs as several instances. If Redis cannot be reached, sign-in, setup, password reset and agent registration refuse requests instead of going unlimited. - **Signed checksums and an SBOM for every release.** installer.vaultpanel.net publishes `SHA256SUMS` (every package, the installer, the WHMCS module and the SBOMs) with a signature by the repository key `install.sh` already trusts, and a CycloneDX software bill of materials of the npm packages each release ships (`releases/vaultpanel-.cdx.json`). - **`security.txt`** at `docs.vaultpanel.net/.well-known/security.txt` (RFC 9116) tells researchers how to report a problem privately. ### Fixed - **The `vaultpanel` CLI (0.1.2).** Many commands sent requests the panel refused or quietly ignored. They now work: - `websites ssl` (sends the contact email, the token owner's unless `--email` is given) - `websites logs`, `apps logs` and `containers logs` (print the log lines) - `apps env --set/--unset` - `apps rollback` without `--release` (picks the previous release still on the server) - `servers services` (lists services, or checks, restarts, starts or stops one) - `databases create --user`/`--no-user` (the password is shown once, even with `--watch`) - `databases users --database` - `containers deploy --port/--env` - `containers list --all` - `containers remove --remove-volumes` - `websites delete --remove-files` - `backups restore --no-safety-backup` `--set`, `--unset`, `--env`, `--port` and `--query` can be repeated. Tables show the server, SSL state, process state and last run the panel actually returns, and job errors show their message. A new contract test runs every command against the API's real routes and validators. - **Email hosting uses a website's Let's Encrypt certificate** (agent 0.42.0). Setting up the mail server looked for the certificate only under the host name's own folder, but websites keep theirs under `vp-`, so mail clients kept getting the server's self-signed certificate. It now uses any current certificate of a website that covers the mail host name. Set up the mail server again after updating the agent to switch to it. - **"Turn HTTPS off" no longer says the certificate is deleted.** It is kept on the server, so HTTPS can be turned on again. - **The servers list no longer nests the group links inside the server link** (invalid HTML that confused screen readers and keyboard navigation). ## 0.3.0 [#v0-3-0] Released November 10, 2026. ### Added - **A free AI model on the panel's own server** (agent 0.41.0). **System > Assistant Settings** has a third choice, **Free model on this server**: pick a small open model from the list (it shows each one's download size and the memory it needs next to the server's free memory and disk) and click **Install**. The agent installs Ollama (a fixed release, checked against its SHA-256), runs it as its own service on `127.0.0.1:21434`, and downloads the model, with the progress shown as it goes. The assistant then answers with no API key and nothing leaves the server, more slowly and more simply than Claude. Only the panel and root can reach the model: a firewall rule refuses websites, apps and other accounts on the server. Models, or Ollama itself, can be removed again from the same page. ### Changed - **Each AI provider keeps its own settings.** Switching the assistant between Claude, an OpenAI-compatible service and the free model on this server keeps each one's model, address and API key, so switching back needs nothing again (before, switching deleted the saved key). ## 0.2.1 [#v0-2-1] Released November 10, 2026. ### Changed - **The sidebar follows the usual control-panel order**: Overview and the AI Assistant first; then Infrastructure, Web, Applications and Data & Files; then **Monitoring** (a new section with Monitoring, Alerts, Logs and Jobs, which were under Infrastructure) and Automation; then Security, Hosting and Users & Access; installed plugins' pages; and **System** last, which now also holds **Assistant Settings**. Pages name the section they are in above their title. ## 0.2.0 [#v0-2-0] Released November 9, 2026. ### Security - **The panel no longer runs as root.** `vaultpanel` and `vaultpanel-worker` run as the new unprivileged `vaultpanel` user inside a systemd sandbox (`ProtectSystem=strict`, no capabilities, `NoNewPrivileges`, private `/tmp` and devices). Only connecting the panel's own server (the `connectLocal.js` step before the API starts) runs as root. `.env` and the TLS key are readable, not writable, by the panel. - **HTTPS from the first start.** New installs serve the panel over HTTPS on its own port with a self-signed certificate (like Cockpit, Webmin or Proxmox), so passwords and the setup token never cross the network in clear. Plain HTTP stays available on `127.0.0.1` only (`VAULTPANEL_LOOPBACK_PORT`) for the local agent, the panel domain's NGINX and the `vaultpanel` command. HSTS is only sent where the certificate is trusted (a panel domain), never on an IP address or the self-signed port. - **Pinned agent installs.** With the self-signed certificate, the "Add server" and upgrade commands carry the certificate's public key pin (`curl --pinnedpubkey`, `--panel-pin`). The agent installer checks the pin, saves the certificate as `/etc/vaultpanel-agent/panel-ca.pem` and the agent trusts exactly it (`NODE_EXTRA_CA_CERTS`), so servers can be added safely without a domain. Adding a server to a default install used to need a domain or a hand-edited command. - **Webhooks and plugins no longer reach private networks by default** (`VAULTPANEL_WEBHOOK_ALLOW_PRIVATE=false`). Panels installed earlier keep their previous behaviour. - The panel's files moved from `/var/lib/vaultpanel` (which also holds the agent's private state) to `/var/lib/vaultpanel/panel`, owned by the panel's user. - **True/false settings left out of `.env` were read as on.** Their defaults came through as the text `"false"`, which counts as true. Every panel that install.sh set up lacks `VAULTPANEL_PLUGIN_ALLOW_LOCAL`, so its plugins could reach the panel's own server and private networks; a panel without `VAULTPANEL_ALLOW_INSECURE_AGENTS` or `VAULTPANEL_WEBHOOK_ALLOW_PRIVATE` in `.env` accepted agents over plain HTTP or let webhooks reach private networks. Settings left out take their documented defaults again. - **Agent downloads are rate limited**: 60 a minute per address for the agent's install script, package and the panel's certificate, which need no sign-in. The package is built for each download, so endless requests could keep the panel busy. A server installing or updating its agent downloads each once. ### Added - **Choose the database for websites and apps when installing.** `DB_ENGINE` (or `--db-engine`) installs MariaDB 12.3, 11.8, 11.4, 10.11 or 10.6, as each system offers them (see the README), on port 3306: from the system's own packages when they have that version, else from MariaDB's repository, whose signing key is checked against MariaDB's fingerprint. A new install gets the newest MariaDB for its system unless `DB_ENGINE=NONE`; a server that has a database server keeps it, and updates never change it. The summary shows it. MySQL 8.4 and 8.0 come later. - **VaultPanel installs from packages, like CloudPanel.** Each release builds the `vaultpanel` package (`vaultpanel_X.Y.Z_all.deb`: the panel ready to run, with its Node.js packages and the built web interface) and publishes it, signed with VaultPanel's key (fingerprint `79B34D79D2A7D0DE54A3D906B62A47C2ED2775A6`), to VaultPanel's APT repository on the public site https://installer.vaultpanel.net (the VaultPanel/packages repository, GitHub Pages), with that release's installer at `v2/install.sh`, the WHMCS module and a README with the install command and the installer's checksum. The installer sets up Node.js, Docker and MariaDB, adds the repository after checking its key's fingerprint and runs `apt install vaultpanel`; servers no longer download from GitHub or build anything. The package sets the panel up on install and on every upgrade (`install.sh --configure`), backs it up before an upgrade, and removes its services when removed. `vaultpanel update` and `apt upgrade` install newer packages; `vaultpanel rollback` restores the backup and installs the previous version again (the repository keeps the newest 5). Installing from a copy of the repository, which stays git based, is for trying unreleased code. The Release workflow builds the package, installs it on a fresh runner from a signed copy of the site following the published install command (the Package workflow, also run for changes to packaging), and only then publishes it; pre-releases are not published. Shell scripts and the package's scripts keep LF line endings in Windows checkouts (`.gitattributes`). - **Ubuntu 26.04 LTS** is supported by the installer. - **Back up a website's or app's database from its page.** **Back up now** asks what to back up: on the Backups page **Website files**, **App files** or a **Database**; on a website's or app's Backups tab its **Files** or one of its **Databases**. That tab now lists the backups and schedules of its databases with its own, each marked Files or with the database's name, and **Add schedule** schedules either. Databases can be linked to the website that uses it, as they can to an app: **For website** when creating one, or **Link** on the Databases page. Databases made by the app installer (WordPress, Joomla, Drupal, Laravel) are linked to their website, including those installed before. API: `websiteId` on `POST`/`PATCH /databases` (a link left out of `PATCH` is now kept) and `GET /databases`, `includeDatabases=true` on `GET /backups` and `GET /backup-schedules`. No agent update needed. - **Server self-check** (agent 0.39.0). Every 5 minutes each agent checks what the panel's features need from its server: the root helper answers, everyone can read the agent's code, the file manager's worker starts as a site user, `nginx -t` and `apache2ctl -t` pass, Certbot's renewal timer runs, the clock is synchronized and no systemd unit has failed. The server's Overview shows them on a **Self-check** card, with **Check now** and the command that fixes each failure. A new default alert rule, **Server self-check failed**, sends the usual alert emails and webhooks when a check fails for 10 minutes; warnings (agent running as root, Certbot timer, clock, failed units) only show on the card. - **WHMCS module** (`integrations/whmcs`). Sell VaultPanel hosting from WHMCS: each service is a VaultPanel account that WHMCS creates, suspends, unsuspends, upgrades, terminates and sets the password of, with a plan dropdown read from the panel, **Log in to VaultPanel** (single sign-on), disk usage in WHMCS, a client-area overview and an admin tab. The billing API gains `GET /billing/accounts` (accounts with usage) and `POST /billing/accounts/{ref}/login`, a sign-in link that works once within two minutes (opened on the new `/sso` page). - **Website uptime monitoring.** The panel checks every website the way visitors reach it, every 5 minutes by default (`VAULTPANEL_UPTIME_CHECK_SECONDS`): over HTTPS when the certificate covers the domain, judging the certificate it serves like a browser. A failure is checked again 10 seconds later before the website counts as down. The website's Overview shows Up or Down, uptime over 24 hours, 7 and 30 days, response time, the served certificate's expiry and recent downtime, with **Check now** and a switch to turn monitoring off; the Websites list marks sites that are down. A new default alert rule, **Website down**, sends the usual alert emails and webhooks. History is kept 30 days (`VAULTPANEL_UPTIME_HISTORY_DAYS`). - **Wildcard certificates through Cloudflare or Namecheap** (agent 0.38.0). Domains whose DNS is at Cloudflare or Namecheap get Let's Encrypt wildcard certificates without moving their DNS to the panel: staff save the provider's API credentials once under **Web > DNS Zones > DNS providers** (stored encrypted), then choose it under **Check DNS through** on a website's SSL tab. The agent adds the check record through the provider's API, waits until the domain's name servers serve it, and keeps the credentials root-only so Certbot's renewals work too. For Namecheap, whose API replaces all records at once, every record and the email setting are written back exactly as read, and nothing is written when they cannot all be read. - **Wildcard website domains** (agent 0.37.0). A website or app can list `*.example.com` among its domains to serve every subdomain that no other site lists (exact names still win, so `admin.example.com` can be a site of its own). A Let's Encrypt wildcard certificate covers it; a normal certificate covers the site's other domains and leaves the wildcard out. Wildcards over a registry suffix (`*.co.uk`) are refused, and a hosting customer's wildcard keeps other accounts off the names under it. - `vaultpanel backup`, `vaultpanel restore` and a daily `vaultpanel-backup.timer`: the panel's database, settings, secret key, HTTPS certificate and terminal recordings in one archive, with retention, checksums, optional encryption (`VAULTPANEL_BACKUP_PASSPHRASE_FILE`) and an optional copy-off-the-server command (`VAULTPANEL_BACKUP_UPLOAD`). Restores work on a new server for disaster recovery (the new server keeps its own database passwords). - Versioned installs: `install.sh --version vX.Y.Z` (default: the latest release), `vaultpanel update [--version ...]`, which backs the panel up first, and `vaultpanel rollback`, which goes back to the previous version and its database. - `vaultpanel https [status|on|off|renew]` to manage the panel's own certificate, and `install.sh --https` / `--http`. - A Release workflow that publishes tagged versions with `SHA256SUMS` and build provenance. - End-to-end smoke tests (Playwright) and test coverage in CI; Dependabot, CodeQL and `npm audit`. - `LICENSE`, `SECURITY.md`, `CONTRIBUTING.md`, issue and pull request templates. ### Changed - **VaultPanel is proprietary, under the VaultPanel License** (`LICENSE`): free to install and use, also to host customers, but not to copy, change, resell or redistribute. Its source code is private; the public VaultPanel/packages repository holds the installer, the packages and the issues. Versions published while the repository was public stay under the license they came with (MIT, then for a short time AGPL-3.0). The SDK, the CLI, the WHMCS module and the example plugin stay MIT, with their own `LICENSE` files; the WHMCS module is now downloaded from installer.vaultpanel.net. Security reports go to VaultPanel/packages. - **NodePanel is now VaultPanel** (agent 0.40.0). The new name is used everywhere: the interface, emails, login banners and docs; the `vaultpanel` command and CLI; the `@vaultpanel/*` packages; the `vaultpanel` user, services (`vaultpanel`, `vaultpanel-worker`, `vaultpanel-agent`, `vaultpanel-agent-helper`, `vaultpanel-backup.timer`) and folders (`/opt/vaultpanel`, `/opt/vaultpanel-agent`, `/etc/vaultpanel-agent`, `/var/lib/vaultpanel`…); `VAULTPANEL_*` settings; the `vaultpanel` database and Docker project; the `X-VaultPanel-*` headers of agents, webhooks and plugins; `io.vaultpanel.*` container labels; the `vaultpanel` DKIM selector; and the WHMCS module (`modules/servers/vaultpanel`). The short prefixes changed with it: tokens and keys start with `vpt_`, `vpk_`, `vpe_` and `vpp_`, plugin links carry `vp_*` parameters, and the accounts the agent creates are named `vp-…`. Nothing converts a NodePanel install, its agents or its tokens: remove NodePanel, install VaultPanel and add each server again. - Agent install commands for a plain-HTTP panel that accepts HTTP agents now include `--insecure-http`, so they work as copied. - A panel domain set up while the panel used plain HTTP is moved to the loopback port automatically when HTTPS is turned on. ### Fixed - A new panel's address opened the sign-in page, with no account to sign in with yet. It now opens the setup page, where the owner account is created. - Searching a list (websites, apps, databases, users, servers, backups, the audit log…) for text with a backslash (`\`) in it found the wrong things: the backslash changed the search. Found by CodeQL, as were a few other escapes and checks made stricter. - Invite and password-reset pages only accept invite and reset links (`password_reset_tokens` now also holds one-time sign-in links, which must never set a password). - The file manager failed on the panel's own server with "Cannot find module '/opt/vaultpanel-agent/src/services/fileWorker.js'". The panel's `UMask=0077` reached the agent installer it runs, leaving `/opt/vaultpanel-agent` readable by root only, so the worker (which runs as the site's user) and the agent's own user could not load it. The installer now sets `umask 022` and makes the agent's code readable by everyone, updates from the panel do the same (agent 0.37.0), and the panel installs its own server's agent again when it starts and finds it readable by root only. - Docs that still listed email for invites, password resets and alerts as not built (it is: **System > Panel Email**).