# Pyo > The open-source, self-hosted PaaS alternative to Vercel, Netlify, Railway, Render and Fly.io. Pyo runs on a person's own servers, or hosted as Pyo Cloud (https://cloud.pyo.dev). Every Pyo has its own address. The `pyo` CLI deploys a folder to it. ## Deploy an app 1. Run `pyo whoami`. If it prints no account, ask the person for their Pyo's address. Don't guess one. 2. Install the CLI: `curl -fsSL https://pyo.dev/cli.sh | sh` 3. Sign in: `pyo login --url https://your-pyo`. It prints a code and a link, and the person approves in a browser. With an API key, set `PYO_URL` and `PYO_API_KEY` instead. 4. In the app's folder, run `pyo deploy`. It makes a service from the folder, builds it and follows the deployment to the end. 5. Check it with `pyo status`, `pyo logs` and `pyo logs --build`. Don't run https://pyo.dev/install.sh to deploy an app. It installs Pyo itself on a server. - [For AI agents](https://pyo.dev/md/ai-agents.md): the same steps in full, what to do when a command stops, and what to ask the person first ## Docs - [Introduction](https://pyo.dev/md/index.md): The open-source PaaS alternative to Vercel, Netlify, Railway, Render and Fly.io. Deploy apps, run services, and create isolated sandboxes, from one machine to a whole cluster. - [Following activity](https://pyo.dev/md/activity.md): See what changed, and hear about what matters. - [Admin sign-in](https://pyo.dev/md/admin-sign-in.md): Limit where the installation's admins can sign in from. - [For AI agents](https://pyo.dev/md/ai-agents.md): The commands a coding agent runs to deploy an app to Pyo, and what to ask the person first. - [Alerts](https://pyo.dev/md/alerts.md): Send important events to Telegram, Discord, Slack or a webhook. - [API overview](https://pyo.dev/md/api.md): Automate Pyo over HTTP with an API key. - [Making changes](https://pyo.dev/md/api/changing.md): Deploy, scale, restart and more with one endpoint. - [Reading data](https://pyo.dev/md/api/reading.md): The snapshot, logs, metrics and observability. - [Audit log](https://pyo.dev/md/audit-log.md): See who did what in your team, how, and from where. - [Backing up data](https://pyo.dev/md/backups.md): Back up volumes and databases to your own storage. - [Setting up builders](https://pyo.dev/md/builders.md): Where Pyo builds images from your Git code. - [Managing certificates](https://pyo.dev/md/certificates.md): Upload your own TLS certificates, including wildcards. - [The pyo CLI](https://pyo.dev/md/cli.md): Deploy and manage your services from a terminal or CI. - [Deploy from CI](https://pyo.dev/md/cli/ci.md): Use the CLI in a pipeline with an API key. - [Command reference](https://pyo.dev/md/cli/commands.md): Every command of the pyo CLI. - [pyo.jsonc](https://pyo.dev/md/cli/pyo-jsonc.md): Keep a service's settings next to its code. - [Pyo Cloud](https://pyo.dev/md/cloud.md): Pyo, run for you. Your services run on your own servers. - [Agent updates](https://pyo.dev/md/cloud/agent-updates.md): How the Pyo agent on your servers stays up to date. - [Billing](https://pyo.dev/md/cloud/billing.md): $5 per server per month, with everything included. - [Data and analytics](https://pyo.dev/md/cloud/data.md): What stays on your servers, and what Pyo Cloud keeps. - [Pyo Cloud and self-hosted](https://pyo.dev/md/cloud/differences.md): What's different when we run Pyo for you. - [Getting started with Pyo Cloud](https://pyo.dev/md/cloud/getting-started.md): Sign up, pay, connect a server and deploy. - [Moving to self-hosted](https://pyo.dev/md/cloud/moving-to-self-hosted.md): Move a team from Pyo Cloud to a Pyo you run yourself. - [Security on Pyo Cloud](https://pyo.dev/md/cloud/security.md): How Pyo Cloud reaches your servers, and what it can and can't do there. - [Server requirements](https://pyo.dev/md/cloud/server-requirements.md): What a server needs to connect to Pyo Cloud. - [Connecting Cloudflare](https://pyo.dev/md/cloudflare.md): Let Pyo create the DNS records of your domains. - [Cloudflare Tunnel](https://pyo.dev/md/cloudflare-tunnel.md): Take websites in through Cloudflare with no open ports on your servers. - [Connecting a cluster](https://pyo.dev/md/clusters.md): The groups of servers that run your services. - [Core concepts](https://pyo.dev/md/concepts.md): The few things you need to know to use Pyo. - [Databases](https://pyo.dev/md/databases.md): Postgres or MySQL with failover, or Redis-compatible KV, run on your own servers. - [Deploying a service](https://pyo.dev/md/deploy.md): Deploy from Git, a container image or a template. - [Importing Docker Compose](https://pyo.dev/md/deploy/compose.md): Turn a Compose file into a Pyo project, and keep the project in line with the file. - [Running cron jobs](https://pyo.dev/md/deploy/cron-jobs.md): Run a task on a schedule, like a cleanup or a nightly report. - [Deploy with Pyo button](https://pyo.dev/md/deploy/deploy-button.md): A button for your README that deploys your repository or image. - [Setting environment variables](https://pyo.dev/md/deploy/environment.md): Configure services with variables and encrypted secrets. - [Using deploy hooks](https://pyo.dev/md/deploy/hooks.md): Trigger a deploy from CI, a CMS or a cron job. - [Preview environments](https://pyo.dev/md/deploy/previews.md): A temporary copy of a service for each pull request. - [Rolling back a deploy](https://pyo.dev/md/deploy/rollbacks.md): Go back to an earlier version, by hand or automatically. - [Static sites](https://pyo.dev/md/deploy/static-sites.md): Deploy plain HTML or a built frontend from Git. - [Adding a domain](https://pyo.dev/md/domains.md): Put a service on the web, with certificates handled for you. - [Setting up email](https://pyo.dev/md/email.md): Send invites, sign-in links and security emails through your own SMTP server. - [Protecting secrets](https://pyo.dev/md/encryption.md): How Pyo protects what you trust it with. - [Importing external secrets](https://pyo.dev/md/external-secrets.md): Import secrets into your services from Vault, AWS, GCP, Azure, Doppler and more. - [Firewall](https://pyo.dev/md/firewall.md): Choose who can reach a service, by address, range, country or CDN. - [Making your first deploy](https://pyo.dev/md/first-deploy.md): Go from a fresh install to a live service. - [Pyo Gateway](https://pyo.dev/md/gateway.md): How web requests and public TCP and UDP ports reach your services, and why the gateway can't read your secrets. - [Getting back in](https://pyo.dev/md/getting-back-in.md): Choose a new password when you can't sign in. - [Connecting GitHub](https://pyo.dev/md/github.md): Private repositories and deploys on every push. - [Connecting GitLab](https://pyo.dev/md/gitlab.md): Deploy from gitlab.com or your own GitLab, with deploys on every push. - [Running AI models on GPUs](https://pyo.dev/md/gpus.md): Give services whole NVIDIA GPUs, for AI models and other GPU work. - [Hardening your server](https://pyo.dev/md/hardening-your-server.md): Lock down the machine Pyo runs on, from SSH to system updates. - [Servers at Hetzner](https://pyo.dev/md/hetzner.md): Let Pyo make servers in your Hetzner Cloud project and join them to a cluster. - [Making Pyo highly available](https://pyo.dev/md/high-availability.md): What keeps running when a server fails, and how to make Pyo itself more resilient. - [Browsing images](https://pyo.dev/md/images.md): Every container image your team's services have run. - [Importing from another platform](https://pyo.dev/md/import-platforms.md): Move your services, Compose stacks and databases from Coolify, Dokploy, Railway or Vercel into Pyo. - [Installing Pyo](https://pyo.dev/md/install.md): Run Pyo on a laptop, VPS, dedicated server or homelab. - [Configuring your installation](https://pyo.dev/md/installation-settings.md): Settings for your whole installation, set by its admin. - [MCP for AI assistants](https://pyo.dev/md/mcp.md): Let Claude, Cursor and other assistants use Pyo as you. - [Tools](https://pyo.dev/md/mcp/tools.md): Everything an AI assistant can do through Pyo's MCP server. - [Migrating a database](https://pyo.dev/md/migrating.md): Move a Postgres or MySQL database from another provider into Pyo. - [Isolating projects](https://pyo.dev/md/network-isolation.md): Keep projects from reaching each other. - [Monitoring your services](https://pyo.dev/md/observability.md): See traffic, logs and resource use without adding another tool. - [Passkeys](https://pyo.dev/md/passkeys.md): Sign in with your fingerprint, face or security key instead of a password. - [Creating a project](https://pyo.dev/md/projects.md): Group related services, like a website with its API and database. - [pyo-server](https://pyo.dev/md/pyo-server.md): The program that sets up a machine as one of Pyo's servers. - [Serving traffic by region](https://pyo.dev/md/regions.md): Spread replicas across regions and keep each region's traffic close to home. - [Adding a registry](https://pyo.dev/md/registries.md): Run images from private registries. - [Sandbox](https://pyo.dev/md/sandbox.md): Isolated machines on demand, for AI agents, code interpreters, previews and CI. - [Scaling a service](https://pyo.dev/md/scaling.md): Run more replicas, set resources and choose where services run. - [Securing Pyo](https://pyo.dev/md/securing-pyo.md): What to do right after installing, before you put anything real on it. - [Adding a server](https://pyo.dev/md/servers.md): Add machines to a cluster and look after them. - [System reference](https://pyo.dev/md/system-reference.md): The PYO_ environment variables, and everything Pyo runs on your server. - [Connecting with Tailscale](https://pyo.dev/md/tailscale.md): Join servers and clusters over your tailnet. - [Configuring your team](https://pyo.dev/md/team-settings.md): Name your team and set its defaults. - [Inviting your team](https://pyo.dev/md/teams.md): Work together, with the right access for each person. - [Deploying a template](https://pyo.dev/md/templates.md): Popular software, ready to run. - [Two-factor authentication](https://pyo.dev/md/two-factor.md): Ask for a code from an authenticator app after your password. - [Uninstalling Pyo](https://pyo.dev/md/uninstall.md): Remove a server, disconnect a cluster, or remove Pyo from your machine. - [Updating Pyo](https://pyo.dev/md/updating-pyo.md): Install new releases from the dashboard, by hand or on a schedule. - [Adding a volume](https://pyo.dev/md/volumes.md): Keep files across restarts and deploys. - [Web application firewall](https://pyo.dev/md/waf.md): Inspect a service's website requests for common attacks, and add your own rules. ## API reference - [OpenAPI spec](https://pyo.dev/openapi.json): every endpoint with its request and response schemas - [You](https://pyo.dev/md/api/reference/account/get-me.md): The account these credentials act as: an API key's owner, or the person who connected an assistant. - [What this Pyo is](https://pyo.dev/md/api/reference/account/get-meta.md): Its version, and the features a hosted Pyo turned on (none when self-hosted). No API key needed. - [Add alert channel](https://pyo.dev/md/api/reference/alerts/add-alert-channel.md): Send the team's alerts somewhere: `kind` "telegram" (a bot `token` and a `chatId`), "discord" or "slack" (the channel's `webhookUrl`), or "webhook" (your `webhookUrl`, and a `secret` to sign each request with). Pyo keeps it encrypted. Team owners and admins. - [Remove alert channel](https://pyo.dev/md/api/reference/alerts/remove-alert-channel.md): Remove an alert channel. Team owners and admins. - [Test alert channel](https://pyo.dev/md/api/reference/alerts/test-alert-channel.md): Send a test alert to a channel now. When it doesn't arrive, the error says why. Team owners and admins. - [Update alert channel](https://pyo.dev/md/api/reference/alerts/update-alert-channel.md): Change an alert channel. What you leave out stays as it is. An empty `secret` stops signing. Team owners and admins. - [Remove team backup settings](https://pyo.dev/md/api/reference/backups/remove-team-backup-settings.md): Stop a team's backups. - [Reveal backup password](https://pyo.dev/md/api/reference/backups/reveal-backup-password.md): Show the team's backup repository password, to restore without Pyo. Logged. - [Run team backup](https://pyo.dev/md/api/reference/backups/run-team-backup.md): Back up now: one service or volume (by id), or everything selected. - [Save team backup settings](https://pyo.dev/md/api/reference/backups/save-team-backup-settings.md): Back up a team's volumes and databases: where, how often and how many to keep. A blank secret keeps the saved one. - [Set team backup selection](https://pyo.dev/md/api/reference/backups/set-team-backup-selection.md): Choose what a team backs up: "all" but `exceptions`, or only the "selected" ones. - [Create builder](https://pyo.dev/md/api/reference/builders/create-builder.md): Add a builder that builds images from Git on one of the team's servers (`kind` "cluster"). - [Remove builder](https://pyo.dev/md/api/reference/builders/remove-builder.md): Remove a builder. - [Rotate builder token](https://pyo.dev/md/api/reference/builders/rotate-builder-token.md): A new token for a builder. The old one stops working. - [Create cloud cluster](https://pyo.dev/md/api/reference/clusters/create-cloud-cluster.md): Add a cluster whose first server Pyo makes at a cloud provider (team admins). pyo-server connects it there the way Add cluster's command does, over your tailnet. Without `confirm` it answers 409 with the monthly price. Confirm that with the user, then send it again with `confirm: true`. - [Create cluster](https://pyo.dev/md/api/reference/clusters/create-cluster.md): Add a cluster. The response has the command that connects its first server: `curl -fsSL /server.sh | bash -s -- connect `, which runs pyo-server with one token. On the machine Pyo itself runs on, it runs connect.sh from Pyo there. - [Discard cluster draft](https://pyo.dev/md/api/reference/clusters/discard-cluster-draft.md): Discard a cluster that was added but never connected. - [A cluster's Cloudflare Tunnel](https://pyo.dev/md/api/reference/clusters/get-cluster-tunnel.md): The cluster's tunnel as Pyo last saw it: its state, Cloudflare's view (`health`, `connections`, `colos`), the connectors in the cluster (`connectors`: each one's server, whether it's ready, and why not), its default domain, its certificate, and `refused` when the cluster's install is older than Pyo's. Never a token. Cloudflare's view is read again when it's older than 30 seconds. - [Remove cluster](https://pyo.dev/md/api/reference/clusters/remove-cluster.md): Remove a cluster from Pyo. Its servers keep running. - [Remove cluster tunnel](https://pyo.dev/md/api/reference/clusters/remove-cluster-tunnel.md): Remove a cluster's Cloudflare Tunnel: its routes, the DNS records Pyo made (with `restoreRecords`, the ones they replaced come back), the connector in the cluster, its certificate and the tunnel itself. Pick Public ports or Tailscale only for the cluster first. Team owners and admins. Prefer setClusterPaths. - [Rotate agent token](https://pyo.dev/md/api/reference/clusters/rotate-agent-token.md): A new connect command for a cluster. The old one stops working. - [Rotate tunnel token](https://pyo.dev/md/api/reference/clusters/rotate-tunnel-token.md): Give the cluster's Cloudflare Tunnel a new token and a new certificate. The old token can't connect from then on. Its connectors still connected are cut once the new ones are, or after 5 minutes. Team owners and admins. - [Set cluster free domain address](https://pyo.dev/md/api/reference/clusters/set-cluster-free-domain-address.md): Where the cluster's free domains (`..nip.io`) point: "public" (its public IP, for everyone) or "tailscale" (its Tailscale IP, only from the tailnet). With "tailscale", services are reachable from your tailnet on ports 80 and 443 whether or not the cluster takes public traffic. Free domains on it move to the new address in place, except ones on the public IP, which stay there while the cluster has one. By default it's public when the cluster takes public traffic and a server has its public IP itself (on a network card or as its ExternalIP), a load balancer gives it one, or its cloud maps one to it and Let's Encrypt reached it there. Behind NAT, it's Tailscale. - [Set cluster gateway](https://pyo.dev/md/api/reference/clusters/set-cluster-gateway.md): A cluster's gateway settings. Unset fields stay as they are. `http3`: HTTP/3 on UDP port 443 next to HTTPS. It needs public ports on and UDP port 443 free on the servers, and the servers' firewalls must let UDP 443 in. Turning it on or off drops open connections on each server's public ports once, one server at a time. `tlsMin`: "1.2" or "1.3". Changing it drops every open HTTPS connection once. `compression`: Zstd, Brotli and Gzip on services' HTTPS domains. `requestTimeout` (seconds, 1 to 3600, or 0 for no limit) and `idleTimeout` (how long a WebSocket or stream may stay quiet, 60 to 86400 seconds, at least the request timeout): the defaults for services without their own. Compression and the defaults change routes only, without dropping connections. `drops` in the answer says whether open connections drop once. Team owners and admins. - [Set cluster paths](https://pyo.dev/md/api/reference/clusters/set-cluster-paths.md): Turn a cluster's traffic paths on or off: public ports 80 and 443 (`public`), Cloudflare Tunnel (`tunnel`, with `defaultDomain` and `accountId` as for setClusterTraffic) and websites on the tailnet (`tailnet`: ts.net names and free domains on the servers' Tailscale addresses; the servers stay on the tailnet). Unset fields stay as they are. At least one path stays on. Each domain takes one path, and a domain whose path is off isn't served. When a path turned off still has domains, nothing changes: `status` is "confirm" and `domains` lists them, each with `outcome` "moves" or "stops". Send it again with `confirm` to go ahead. Turning public ports off with the tunnel on moves the domains in the tunnel's Cloudflare account to the tunnel first (`moveToTunnel`, on by default), and the ports close once every one of them is on it (`status` "moving"): its record has moved and Cloudflare has had time to serve it. Published TCP and UDP ports pause for a few seconds when public ports go on or off, as they move between Services. Turning the tunnel off with public ports on switches its domains back first, then removes the tunnel at Cloudflare. `dashboardDrops`: switching Tailnet drops open connections to Pyo's dashboard on the tailnet once (the cluster Pyo runs on, with ts.net names, until its connect command has run for this release). Team owners and admins. - [Set cluster preview domain](https://pyo.dev/md/api/reference/clusters/set-cluster-preview-domain.md): Set the domain previews on a cluster use (`-pr-.`, a wildcard record pointing at the cluster), or null for nip.io. Admins only. - [Set cluster public traffic](https://pyo.dev/md/api/reference/clusters/set-cluster-public-traffic.md): Whether a cluster takes public traffic: the gateway answers on every server but build-only ones (ports 80 and 443, and public TCP and UDP ports through it). Off: services are only reachable inside the cluster. Prefer setClusterPaths. - [Set cluster traffic](https://pyo.dev/md/api/reference/clusters/set-cluster-traffic.md): How a cluster takes web traffic: "public" (ports 80 and 443 on every server but build-only ones), "tailscale" (only from the tailnet, or only inside the cluster without Tailscale) or "tunnel" (through Cloudflare Tunnel, with no ports 80 and 443 open). For "tunnel", the team's Cloudflare token needs Cloudflare Tunnel:Edit and SSL and Certificates:Edit, and the cluster's install must be Pyo's (run its connect command first when it's older). Domains in zones of the tunnel's account move to the tunnel. Those with a DNS record Pyo didn't make wait for `setDomainTunnel` with `replace`. Pyo does the Cloudflare work in the background: the cluster's `tunnel` shows how it's going. Team owners and admins. Prefer setClusterPaths. - [Set cluster web proxy protocol](https://pyo.dev/md/api/reference/clusters/set-cluster-web-proxy-protocol.md): Read the visitor's address from a PROXY protocol header on the cluster's websites (ports 80 and 443), for a cluster behind another load balancer. Connections without one still work. Prefer setClusterPaths. - [Update cluster](https://pyo.dev/md/api/reference/clusters/update-cluster.md): Rename a cluster or change its description, location or tags. - [Update cluster agent](https://pyo.dev/md/api/reference/clusters/update-cluster-agent.md): On a hosted Pyo: update a cluster's agent to Pyo's version now. - [Cron job runs](https://pyo.dev/md/api/reference/cron-jobs/list-cron-runs.md): A cron job's recent runs, newest first: when each started and finished, how it ended, and the end of what it printed. - [Remove cron job](https://pyo.dev/md/api/reference/cron-jobs/remove-cron-job.md): Remove a cron job from a service. - [Run cron job](https://pyo.dev/md/api/reference/cron-jobs/run-cron-job.md): Run a cron job now. - [Save cron job](https://pyo.dev/md/api/reference/cron-jobs/save-cron-job.md): Add a cron job to a service, or change one (by id). - [Back up a database](https://pyo.dev/md/api/reference/databases/add-database-backup.md): Checks the admin login from the cluster, makes a backup user with it, then saves the database and its schedule. Team owners and admins. - [Check an import](https://pyo.dev/md/api/reference/databases/check-database-import.md): Everything `startDatabaseImport` checks, without importing. The cluster connects to the source, which must be reachable from there, and checks the login, TLS, its version, its extensions and that every table is readable. It also checks that the database to import into is empty. Owners and admins. - [Finish an upload in parts](https://pyo.dev/md/api/reference/databases/complete-database-dump-upload.md): Once every part is sent: Pyo puts the file together in the team's storage and checks it against `sha256`, when given. Then call `startDatabaseImport` with `uploadId`. Owners and admins. - [Connect database](https://pyo.dev/md/api/reference/databases/connect-database.md): Connect a service to a database on its cluster. Postgres adds DATABASE_URL (through the pooler when it's on) and DATABASE_URL_DIRECT, plus DATABASE_URL_READ with read replicas. MySQL adds DATABASE_URL (mysql://, to the primary), MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE. KV adds REDIS_URL (which follows failover and sends reads to read replicas), plus KV_REST_API_URL, KV_REST_API_TOKEN and KV_REST_API_READ_ONLY_TOKEN (reads only) with its REST API. With `env`, it adds only those, under the service's own names. With `prefix`, it adds all of them with that prefix, so two databases' variables don't clash. They're secret variables and apply on the service's next deploy. - [Create database](https://pyo.dev/md/api/reference/databases/create-database.md): Create a Postgres, MySQL or KV (Redis-compatible key-value, Valkey) database on one of the team's clusters. The first database on a cluster also sets up databases there, which takes a minute or two. `size` sets CPU and memory per instance: "small" (0.25 CPU, 512 MiB, 5 GiB), "medium" (0.5, 1 GiB, 10 GiB), "large" (1, 2 GiB, 20 GiB) or "xlarge" (2, 4 GiB, 50 GiB). MySQL needs 1 GiB, so "medium" or larger. `instances` is 1 for a single server with no automatic failover. For high availability, use a primary and 2 to 8 replicas for Postgres (instances 3 to 9), 2 to 4 for KV (3 to 5), or 2 or 4 for MySQL (3 or 5). A replica takes over when the primary's server is lost. MySQL has no pooler, read replicas or REST API. Developers and up. - [Start an upload](https://pyo.dev/md/api/reference/databases/create-database-dump-upload.md): The first step of uploading a dump to import: say what it is and get where to send it. Then `PUT` the file to `uploadUrl` as it is, before `expiresAt`, with exactly the `headers` given and nothing else. Send no cookies or API key, since the URL may be on another host. Or send it in parts of `partSize` bytes with `uploadDatabaseDumpPart`, then `completeDatabaseDumpUpload`, so no request is bigger than a proxy in front takes. Then call `startDatabaseImport` with `uploadId`. Postgres takes `.sql`, `.sql.gz` or a custom-format `.dump` (pg_dump -Fc). MySQL takes `.sql` or `.sql.gz` (mysqldump). The dump stays in the team's storage in Pyo until its import succeeds, or for `PYO_DATABASE_IMPORT_RETENTION_HOURS` (24 by default) when unused. At most `PYO_DATABASE_IMPORT_MAX_BYTES` (10 GiB by default). Owners and admins. - [Delete database](https://pyo.dev/md/api/reference/databases/delete-database.md): Delete a database and its data. Refused while deletion protection is on or a service is connected. Owners and admins. - [Delete database backup](https://pyo.dev/md/api/reference/databases/delete-database-backup.md): Stop backing up a database. Its existing backups stay in storage. - [Disconnect database](https://pyo.dev/md/api/reference/databases/disconnect-database.md): Disconnect a service from a database: removes the variables it added (on the next deploy). - [A database](https://pyo.dev/md/api/reference/databases/get-database.md): One Postgres, MySQL or KV database, as `listDatabases` lists them. - [A database's analytics](https://pyo.dev/md/api/reference/databases/get-database-analytics.md): Its health over time, sampled about every 30 seconds. Per member (`members`: each instance, read replica, pooler and KV endpoint), its `role`, `server`, and series for `cpu` in cores, `memoryMi`, `diskUsedGi` (only where the volume reports its own space), `connections` and `lagSeconds`. For the whole database, `transactions` (Postgres), `queries` (MySQL), `poolerQueries` and `commands` (KV) per second, `connections` (`primary`, `replicas`, `limit`, and the pooler's `poolerActive`, `poolerWaiting`, `poolerServersActive`, `poolerServersIdle` and `poolerMaxWaitSeconds`), `cacheHitRatio`, `keyHitRatio`, `evictions` per second, `routing` (KV reads per second served by `replica`s or the `primary`, and `fallbacks` to the primary) and `storage` (`sizeBytes`, `memoryUsedBytes`, `maxmemoryBytes`, `keys`). Each series lines up with `times`, with `null` where nothing was measured. A series is `null` when the database doesn't report it. - [An upload in parts](https://pyo.dev/md/api/reference/databases/get-database-dump-upload.md): How far an upload's file got: `state` ("pending" before any part, "uploading", "uploaded"), `parts` and `received` (the next part to send is this). Owners and admins. - [A database's logs and events](https://pyo.dev/md/api/reference/databases/get-database-logs.md): The recent output of each of its parts, oldest first: `at`, `level`, `source` (the instance), `role` ("primary", "replica", "read", "pooler", "read-pooler", "sentinel", "proxy" (KV's endpoint) or "other"), `message`, and `raw` for structured lines. `events`: what happened to it, newest first. To follow them live, open the WebSocket at `/databases/{id}/logs/follow`: it sends the last lines, then new ones as they're printed, each text frame `{"type":"lines","lines":[…]}`, and all events as `{"type":"events","events":[…]}` when they change (or `{"type":"error","message":…}`). It closes after an hour, so open it again with `since` set to the newest line's time. - [Database extensions](https://pyo.dev/md/api/reference/databases/list-database-extensions.md): The extensions Pyo's databases offer: Postgres extensions and KV modules. Each one's `name`, `engine` ("postgres" or "valkey"), `section` ("pyo" ones are turned on with `setDatabaseExtensions`, and the database's owner adds "additional" ones with CREATE EXTENSION), a one-line `description`, its `docs`, its `edition` when it's a limited build, `hidden` when it's obsolete (shown only while a database has it on), and whether turning it on or off `restart`s the database (every KV module does). - [Databases](https://pyo.dev/md/api/reference/databases/list-databases.md): A team's Postgres and MySQL databases and Valkey (Redis-compatible) KV databases: engine, version, size, instances, the cluster's status (phase, primary, ready instances, failovers), the services connected to each and their variables, passwords masked. - [Restore database](https://pyo.dev/md/api/reference/databases/restore-database.md): Restore a Postgres or MySQL database into a new one, on the same cluster with the same size and availability: at `targetTime` (RFC 3339, within what its backups cover: from `status.backup.firstRecoverabilityPoint` to now for Postgres, to `status.backup.lastSuccessfulBackup` for MySQL) or the latest when omitted. Developers and up. - [Retry an import](https://pyo.dev/md/api/reference/databases/retry-database-import.md): Runs a failed import again, from the same source. After a failure, Pyo keeps the URL's password (sealed), and an uploaded dump for `PYO_DATABASE_IMPORT_RETENTION_HOURS` (24 by default). A new database made for the import is made again. A database that already existed must still be empty. Owners and admins. - [Reveal database password](https://pyo.dev/md/api/reference/databases/reveal-database-password.md): Show a database's password, and a KV database's REST token and read-only token. Owners and admins. Recorded in the activity log. - [Run database backup](https://pyo.dev/md/api/reference/databases/run-database-backup.md): Back up a database now. - [Set database backups](https://pyo.dev/md/api/reference/databases/set-database-backups.md): Turn a database's backups on or off, to the team's Backups destination. Postgres: every change archived continuously and a base backup daily, so it can be restored to any moment in the last `retentionDays`. MySQL: a full backup daily with the changes since the last one, so it can be restored to any moment in the last `retentionDays` up to its latest backup. Both are stored in the team's folder of the destination. KV: a snapshot `schedule`d daily or weekly, the last `keep` kept, listed in Backups with the team's other databases. Developers and up. - [Set database extensions](https://pyo.dev/md/api/reference/databases/set-database-extensions.md): Turn a Postgres database's extensions or a KV database's modules on and off. `extensions` is the full list to have on, from `listDatabaseExtensions` with `section` "pyo" for its engine. The database's owner adds Postgres's "additional" ones with CREATE EXTENSION. Some load a library, which restarts the database (`restart`). With high availability, it restarts one instance at a time and the primary hands over last. Every KV module restarts the database and needs KV 8.1. Turning a Postgres extension off drops it (DROP EXTENSION, without CASCADE). Postgres refuses while other objects depend on it, and the database's `extensions` shows this. Developers and up. - [Import into a database](https://pyo.dev/md/api/reference/databases/start-database-import.md): Copies a Postgres or MySQL database into one of the team's: a new one (`newDatabase`), or an empty one (`databaseId`). From `url` (the source must be reachable from the cluster) or `uploadId` (a dump uploaded first). It's checked first, as `checkDatabaseImport`. Then the database's `import` shows how it goes ("pending", "running", "succeeded" or "failed", with a `phase`), and its logs have the import's output. Writes made to the source during the import aren't copied. Owners and admins. - [Update database](https://pyo.dev/md/api/reference/databases/update-database.md): Change a database's size, instances, storage, version, pooler, REST API, read replicas or deletion protection. Instances are 1 for a single server, or for high availability 2 to 8 replicas for Postgres, 2 to 4 for KV, or 2 or 4 for MySQL. MySQL instances only grow. Storage only grows and the version only goes up. Only owners and admins can turn deletion protection off. Connected services get changed variables on their next deploy. - [Update database backup](https://pyo.dev/md/api/reference/databases/update-database-backup.md): Change a backed-up database's schedule, or pause its backups. - [Send an upload's file](https://pyo.dev/md/api/reference/databases/upload-database-dump.md): The second step: the file, as the request's body, to the `uploadUrl` that `createDatabaseDumpUpload` gave (its `token` is the only credential: send no API key). Once only, before its `expiresAt`, and exactly the size declared. - [Send a part of an upload's file](https://pyo.dev/md/api/reference/databases/upload-database-dump-part.md): Part `n` (from 0) of the file, as the request's body: exactly `partSize` bytes, the last part what's left. Parts go in order. Send a part again when its request failed: one that arrived already is taken once. `x-pyo-sha256` may carry the part's SHA-256 (hex), to check it on arrival. Owners and admins. - [Cancel](https://pyo.dev/md/api/reference/deployments/cancel.md): Cancel a deployment that hasn't finished. - [Finish an upload](https://pyo.dev/md/api/reference/deployments/complete-source-upload.md): Once every part is sent: Pyo checks the archive against its SHA-256. Then deploy it with `deploy` (or `createService`) and its `uploadId`. - [Create deploy hook](https://pyo.dev/md/api/reference/deployments/create-deploy-hook.md): Create a deploy hook: a secret URL that deploys a service, or every service of a project. - [Start an upload](https://pyo.dev/md/api/reference/deployments/create-source-upload.md): The first step of deploying a folder: say what the archive is (a gzipped tar of the folder) and get where its parts go. Send each part with `uploadSourcePart`, then `completeSourceUpload`, then `deploy` (or `createService`) with the `uploadId`. At most `PYO_SOURCE_UPLOAD_MAX_BYTES` (500 MB by default). Kept for 2 hours. - [Delete preview](https://pyo.dev/md/api/reference/deployments/delete-preview.md): Remove a pull request's preview of a service now. The next push to the pull request brings it back. - [Deploy](https://pyo.dev/md/api/reference/deployments/deploy.md): Deploy a service, roll back to an earlier deployment, or retry a failed one. - [An upload](https://pyo.dev/md/api/reference/deployments/get-source-upload.md): Which parts of an upload Pyo has (`received`), to send the rest after a break, and its `state`: "uploading", "ready" (complete) or "used" (a deployment builds it). - [Redeploy preview](https://pyo.dev/md/api/reference/deployments/redeploy-preview.md): Deploy a pull request's preview again from its head (a failed one tries again, a removed one comes back). - [Remove deploy hook](https://pyo.dev/md/api/reference/deployments/remove-deploy-hook.md): Remove a deploy hook. Its URL stops working. - [Reveal deploy hook](https://pyo.dev/md/api/reference/deployments/reveal-deploy-hook.md): Show a deploy hook's URL path (its secret token). Developers and up. - [Send a part](https://pyo.dev/md/api/reference/deployments/upload-source-part.md): Part `n` (from 0) of an upload's archive, as the request's body: exactly `partSize` bytes, the last part what's left. Sending a part again replaces it. - [Create dns record](https://pyo.dev/md/api/reference/domains/create-dns-record.md): Create a domain's DNS record in the team's Cloudflare account, when one of its connected zones covers the hostname: an A record to the cluster's public IP, with the comment "Made by Pyo ()". Pyo never overwrites a record. When another A, AAAA or CNAME record has the name, `status` is "conflict" and `existing` lists them. Send it again with `replace` to delete those and create Pyo's (team owners and admins). `status` "exists" means it already points there. With `proxied`, Cloudflare proxies it once the domain's certificate is issued. - [Delete dns record](https://pyo.dev/md/api/reference/domains/delete-dns-record.md): Delete the DNS record Pyo made for a domain in Cloudflare. Only a record Pyo made, still with its comment, is deleted. Refused while other paths of the hostname still use it. Remove the domain after this. - [Remove certificate](https://pyo.dev/md/api/reference/domains/remove-certificate.md): Remove an uploaded certificate no domain uses. - [Remove domain](https://pyo.dev/md/api/reference/domains/remove-domain.md): Remove a domain from a service. Traffic to it stops, in place, without a redeploy. A port no other domain uses stops being public. The DNS record Pyo made for it in Cloudflare is deleted too, unless `keepDnsRecord`. Only a record Pyo made, still with its comment, is deleted. For a domain through the Cloudflare Tunnel, `restoreRecords` puts back the records the tunnel replaced (team owners and admins). - [Replace certificate](https://pyo.dev/md/api/reference/domains/replace-certificate.md): Replace a certificate with a renewed one. Services using it switch over in place, without a redeploy. - [Set domain tunnel](https://pyo.dev/md/api/reference/domains/set-domain-tunnel.md): Serve a domain through the cluster's Cloudflare Tunnel (`on`), or move it back. Pyo adds the tunnel's route first, then points the name at the tunnel with a proxied CNAME, so both paths answer while it moves. When records Pyo didn't make have the name, the domain's `dnsRecord.status` turns "conflict" and `existing` lists them (at once, in the answer too, when Cloudflare can be asked). Send it again with `replace` to replace them (team owners and admins): Pyo keeps a copy. Moving back with `restore` puts that copy back (team owners and admins), or without one, points the name at the cluster's public IP. A name one level under the tunnel's default domain always goes through the tunnel, so moving it back is refused unless a record it replaced comes back. A new name one level under the default domain gets no record of its own when nothing else at Cloudflare answers for it: the default domain's wildcard record has it, and the answer is `status: "active"`. A name that's already only through the tunnel stays that way while its own record is made. After the record moves, both paths stay open until Cloudflare's edge sends the name through the tunnel. With `on` and `finish` (Finish now, team owners and admins), a domain whose record is on the tunnel goes only through the tunnel at once: the direct path closes, and visitors Cloudflare still sends the old way get 404. - [Upload certificate](https://pyo.dev/md/api/reference/domains/upload-certificate.md): Upload a certificate for the team's domains: the chain and its private key, PEM. - [Verify domain](https://pyo.dev/md/api/reference/domains/verify-domain.md): Check a domain's DNS now. - [Add firewall rule](https://pyo.dev/md/api/reference/firewall/add-firewall-rule.md): Add an access rule to the end of a service's firewall. Allow and block rules are checked in order, and the first match decides. With no match, the client gets in. Rate limit rules then apply to websites, and each matching one counts the request, per client address and per server. - [Add waf rule](https://pyo.dev/md/api/reference/firewall/add-waf-rule.md): Add a custom web application firewall rule to a service. Custom rules run in order before the OWASP rules, while the service's WAF is on. It goes last in the list. - [Firewall refusals](https://pyo.dev/md/api/reference/firewall/get-firewall-blocked.md): What a service's firewall turned away: website requests (a 403, or a 429 over a rate limit) and connections to TCP ports through the gateway. It shows them over time (`series`), per rule, per source, country and website path, and the latest 50. A rule is its id, or "blocked" or "rate-limit" when no rule matches the source now. UDP ports and ports that bypass the gateway aren't counted. - [Your address](https://pyo.dev/md/api/reference/firewall/get-my-address.md): The address (and its country) Pyo sees your requests come from, so the dashboard can warn before a firewall rule would shut you out. - [WAF findings](https://pyo.dev/md/api/reference/firewall/get-waf-hits.md): What a service's web application firewall found: requests it blocked, and ones it only logged in log-only mode. It shows them over time (`series`), per rule, domain, source, country and path, and the latest 50 with the rules that matched. `custom` shows how often each custom rule matched, by its number. Query strings are kept with sensitive values redacted. - [Remove firewall rule](https://pyo.dev/md/api/reference/firewall/remove-firewall-rule.md): Remove a firewall access rule. - [Remove waf rule](https://pyo.dev/md/api/reference/firewall/remove-waf-rule.md): Remove a custom web application firewall rule. - [Reorder firewall rules](https://pyo.dev/md/api/reference/firewall/reorder-firewall-rules.md): Put a service's firewall access rules in this order: allow and block rules are checked from the first. List every one of its rules. - [Reorder waf rules](https://pyo.dev/md/api/reference/firewall/reorder-waf-rules.md): Put a service's custom web application firewall rules in this order. List every one of its rules. - [Set service behind cdn](https://pyo.dev/md/api/reference/firewall/set-service-behind-cdn.md): Put a service's websites behind a CDN, or take them out of it. Behind Cloudflare, only Cloudflare's address ranges reach its websites, and the visitor is the address Cloudflare forwards (taken only from connections that come from those ranges): firewall rules, rate limits and analytics see that visitor. Over plain HTTP only Cloudflare's connections are checked, so set Cloudflare's SSL mode to Full (strict). Let's Encrypt's challenges always get through. - [Set service waf](https://pyo.dev/md/api/reference/firewall/set-service-waf.md): A service's web application firewall (WAF) settings, for all its domains. "log" or "block" turns it on: the WAF starts on the service's cluster with the first service there that turns it on, and stops after the last one turns it off. - [Update firewall rule](https://pyo.dev/md/api/reference/firewall/update-firewall-rule.md): Change a firewall access rule. Omitted fields stay as they are (as in `addFirewallRule`). - [Update waf rule](https://pyo.dev/md/api/reference/firewall/update-waf-rule.md): Change a custom web application firewall rule. Omitted fields stay as they are. - [Git build file](https://pyo.dev/md/api/reference/git-providers/get-git-build-file.md): The Dockerfile a build of a repository of the team's Git connections would use by default, in the build context. Null: the build is zero-config (Railpack). - [Git branches](https://pyo.dev/md/api/reference/git-providers/list-git-branches.md): A repository's branches, through one of the team's Git connections. - [Git repositories](https://pyo.dev/md/api/reference/git-providers/list-git-repos.md): The repositories the team's Git connections (GitLab) can deploy: those their token has the Maintainer role on, latest activity first. - [Remove git connection](https://pyo.dev/md/api/reference/git-providers/remove-git-connection.md): Disconnect a Git connection, and remove the webhooks Pyo made. Not while a service deploys from it. Team owners and admins. - [Test git connection](https://pyo.dev/md/api/reference/git-providers/test-git-connection.md): Check what a Git connection's token can do now. `problems` says what's missing, and `working` whether it works at all. Team owners and admins. - [The Dockerfile a Git build of a repository would use by default, in the build context. None: the build is zero-config (Railpack).](https://pyo.dev/md/api/reference/github/get-github-build-file.md): API key access: **read**. - [GitHub install URL](https://pyo.dev/md/api/reference/github/github-install-url.md): The GitHub page where a team installs the GitHub App. - [GitHub repositories](https://pyo.dev/md/api/reference/github/list-github-repos.md): The repositories the team's GitHub installations can see, to deploy from. - [Remove GitHub installation](https://pyo.dev/md/api/reference/github/remove-github-installation.md): Unlink a GitHub installation from a team. - [Create registry token](https://pyo.dev/md/api/reference/images/create-registry-token.md): Create a token to push (or only pull) the team's own images in Pyo registry, as `///:`. These are slugs, and `` is the registry's name on the installation's tailnet (registry..ts.net). A push needs that project and service to exist. It works over HTTPS from a device on the installation's tailnet. Team owners and admins. The token comes back only once, with the username, address and team path to log in and push with. - [Pyo registry](https://pyo.dev/md/api/reference/images/get-registry.md): Pyo's registry, where the images it builds from Git and the team's own pushes are kept, as one team sees it: its address, where it runs (when the team has that cluster), whether Pyo reaches it, the space the team's images take, the team's repositories (tags, size, last build) and its cleanup: how many deployments' images are kept per service, and when images were last removed (within the last week). Read only. - [Images](https://pyo.dev/md/api/reference/images/list-images.md): Every image a team's services deployed, by repository, with each version's deployments, the services that used it and whether one runs it now. - [Remove registry login](https://pyo.dev/md/api/reference/images/remove-registry-login.md): Remove a registry login. - [Revoke registry token](https://pyo.dev/md/api/reference/images/revoke-registry-token.md): Revoke a Pyo registry token. Team owners and admins. - [Save registry login](https://pyo.dev/md/api/reference/images/save-registry-login.md): Save a login for a private registry, one per host. Pyo checks it with the registry first. - [Check secret import](https://pyo.dev/md/api/reference/integrations/check-secret-import.md): The key names at a path of a secret store, to check it before importing. Never values. - [Connect cloudflare](https://pyo.dev/md/api/reference/integrations/connect-cloudflare.md): Connect the team's Cloudflare account, or replace its token. The token needs Zone:Read and DNS:Edit on the zones Pyo may use, and for Cloudflare Tunnel also Cloudflare Tunnel:Edit and SSL and Certificates:Edit. Pyo lists its zones and their accounts, checks it can edit DNS in each (it makes and deletes a TXT record `_pyo-check.`), checks the tunnel permissions (it makes and deletes a tunnel `pyo-check--` once per account, and reads each zone's Origin CA certificates), then keeps it encrypted. It's never shown again. Each zone's `tunnel` says whether it can use Cloudflare Tunnel. Team owners and admins. - [Cloudflare zones](https://pyo.dev/md/api/reference/integrations/get-cloudflare.md): The team's Cloudflare connection: the zones its token covers as of the last test, and whether Pyo can edit DNS in each. Pyo creates a domain's DNS record when one of these zones covers it. Never the token: owners and admins also see its last four characters (`hint`). - [Remove cloudflare](https://pyo.dev/md/api/reference/integrations/remove-cloudflare.md): Forget the team's Cloudflare token. DNS records Pyo made stay in Cloudflare. Team owners and admins. - [Remove hetzner](https://pyo.dev/md/api/reference/integrations/remove-hetzner.md): Forget the team's Hetzner token. Servers Pyo made there keep running. - [Save hetzner](https://pyo.dev/md/api/reference/integrations/save-hetzner.md): Connect a team to Hetzner Cloud (team admins): a project API token with Read & Write, from the project's Security page. Pyo checks it by listing the locations, and keeps it encrypted. Servers join over your tailnet, so Tailscale comes first. - [Test cloudflare](https://pyo.dev/md/api/reference/integrations/test-cloudflare.md): Check the saved Cloudflare token again: the zones it covers now, whether each can use Cloudflare Tunnel, and what it's missing (`problems`). Team owners and admins. - [Test hetzner](https://pyo.dev/md/api/reference/integrations/test-hetzner.md): List the locations the team's Hetzner token sees. - [Request log](https://pyo.dev/md/api/reference/observability/get-access-logs.md): The web server's log of requests to a team's websites, newest first, filtered like the traffic figures. Requests stay in each website's cluster (1 GB or 7 days by default, the team's `requestLogs` preference), which answers within seconds, up to 500 at a time. - [Domain traffic](https://pyo.dev/md/api/reference/observability/get-domain-traffic.md): Requests per domain of a team over a range, each with its series: a point per minute for an hour, per half hour for a day, per four hours for a week, per day for 30 days. Only domains that had requests are listed, busiest first. No domains while observability is off. - [Server and service usage](https://pyo.dev/md/api/reference/observability/get-metrics.md): CPU, memory, disk and network over time for a team's servers and services, sampled once a minute. Servers also get load and disk reads and writes. Each series lines up with `times`, with `null` where nothing was measured. - [Website traffic](https://pyo.dev/md/api/reference/observability/get-observability.md): Visitors, requests, errors, response times, countries, pages and referrers for a team's websites: all of them, one project's, one service's, or one domain. Read from per-minute totals each cluster sends (kept 12 months by default), so it works with a cluster offline. Top lists count page views (referrers, pages, devices, browsers) or requests (paths, countries, query parameters). - [Observability settings](https://pyo.dev/md/api/reference/observability/get-observability-settings.md): Whether observability is on for this installation (it's off on a new install on a server with under 3.5 GB of memory). For the installation's admin also what it keeps of visitors' IP addresses, how long it keeps data (`retention`: `analyticsMonths`, `metricsDays`, `buildLogDays`) and `small`: the server Pyo runs on has under 3.5 GB of memory now. The installation's admin turns it on or off with `setObservability`. - [Service connections](https://pyo.dev/md/api/reference/observability/get-service-connections.md): Connections to a service's public TCP and UDP ports through the gateway: per port, over time, by country and outcome ("ok", "blocked" by an IP rule, "limited" by the connection limit, "unreachable" when the service didn't answer), and the latest 50. A connection is counted when it closes (a UDP exchange after a minute without packets). Ports that bypass the gateway aren't counted. - [Set observability](https://pyo.dev/md/api/reference/observability/set-observability.md): Turn observability (analytics, request logs, firewall and WAF history, usage history) on or off for the whole installation. Only the installation's admin can do this. Off stops storing and showing history and frees its memory. What was stored is kept for when it's back on. Live logs, current usage, deploys and the firewall keep working. - [Create project](https://pyo.dev/md/api/reference/projects/create-project.md): Create a project in a team. - [Delete project](https://pyo.dev/md/api/reference/projects/delete-project.md): Delete a project and its services. Its volumes are kept, detached, unless `deleteVolumes`. - [Get an import from another platform](https://pyo.dev/md/api/reference/projects/get-platform-import.md): How an import started with `startPlatformImport` is doing: its status, what it makes and what became of each item so far. Owners and admins. - [Import Docker Compose](https://pyo.dev/md/api/reference/projects/import-compose.md): Create a project and its services from a Docker Compose plan (from `POST /compose/preview`, edited if you like), and deploy them in order. - [List imports from other platforms](https://pyo.dev/md/api/reference/projects/list-platform-imports.md): A team's imports of the last 30 days, newest first (at most 20). Owners and admins. - [Plan a Docker Compose sync](https://pyo.dev/md/api/reference/projects/plan-compose-sync.md): What applying a Compose file to the project made from it would change, service by service: added, changed (and what), unchanged, or not in the file. Only what the file sets is compared, so settings changed in Pyo that the file doesn't mention stay. A secret's value is never changed. An image's tag follows the file only when the file changed it. What can't change in place is listed under `manual` and left as it is. Nothing changes. Pass `file` to the `syncCompose` operation to apply it, or to `importCompose` when there's no `project` yet. - [Preview a Docker Compose import](https://pyo.dev/md/api/reference/projects/preview-compose.md): What importing a Compose file would create: a project, and a service per Compose service with its source, ports, variables, volumes and health check, in deploy order. It adds a warning for each thing that isn't carried over. Nothing is created. Edit the plan if you like, then pass it to the `importCompose` operation. - [Preview an import from another platform](https://pyo.dev/md/api/reference/projects/preview-platform-import.md): Reads a Coolify or Dokploy installation, or a Railway or Vercel account, through its API with a token you give, and shows what importing would create: per project there, its services (source, ports, domains, variable names, volumes), Compose stacks and databases, each with what doesn't carry over. Nothing is created and the token isn't kept. Things an earlier import made are marked (`existingId`). Owners and admins. - [Set project isolation](https://pyo.dev/md/api/reference/projects/set-project-isolation.md): Isolate a project's network: only its own services and the web server reach them. - [Import from another platform](https://pyo.dev/md/api/reference/projects/start-platform-import.md): Starts an import and answers at once with it (`getPlatformImport` follows it). On the server, whatever happens to this request, Pyo reads the platform again (as `previewPlatformImport`) and creates the picked things (`items`, all by default): a project per project there, its services with their variables (secret ones sealed), domains (live after the first deploy), ports and empty volumes, a project per Compose stack, and databases. A Postgres or MySQL database reachable from outside the platform is copied by a database import. Others are made empty or left for you. Services aren't deployed unless `deploy`. Running it again skips what an earlier import made. The token is kept in memory for the import only, never stored. Owners and admins. - [Sync Docker Compose](https://pyo.dev/md/api/reference/projects/sync-compose.md): Bring a project in line with a Docker Compose file: `file` from `POST /compose/sync-plan`, which shows what this does. Only what the file says differently changes, so settings changed in Pyo that the file doesn't mention stay, and a secret's value is never changed. An image's tag or digest follows the file only when the file changed it since the last sync, so one a deploy set stays. Services whose settings change are deployed. What can't change in place (a volume that would move, another kind of source) is left as it is. A service no longer in the file stays, unless `prune`. - [Update project](https://pyo.dev/md/api/reference/projects/update-project.md): Rename a project or change its description. - [Add a sandbox server](https://pyo.dev/md/api/reference/sandboxes/add-sandbox-server.md): Makes a server's one-time join code and the command to run on it. The code works once, for 15 minutes. The command, `curl -fsSL /server.sh | bash -s -- sandbox `, runs pyo-server with one token that carries the code. It installs Pyo's sandbox daemon, checks what the server can run (Firecracker where it has KVM, gVisor elsewhere) and joins Pyo. The server then gets its work from Pyo over HTTPS: Pyo never calls it. With Tailscale set up, the command also joins your tailnet, and the terminal, files and desktop open there. Without, the server joins with its code alone at Pyo's public HTTPS address, the terminal and files go through Pyo, and the desktop needs Tailscale. Adding a server that hasn't joined yet again makes a new code. With `id`, asking again changes that server until it joins. Team owners and admins. On Pyo Cloud, use createSandboxJoinCode. - [Close a sandbox port](https://pyo.dev/md/api/reference/sandboxes/close-sandbox-port.md): Stops serving the port at its URL. Closing a port that isn't open is fine. - [Buy a sandbox server at a cloud provider](https://pyo.dev/md/api/reference/sandboxes/create-cloud-sandbox-server.md): Makes a server in the team's Hetzner project and sets it up as a sandbox server, the way Pyo makes a cluster's servers there. Read the locations, server types and prices with getCloudOptions first. On its first boot pyo-server joins your tailnet and sets it up with a one-time code. Hetzner Cloud servers have no KVM, so it runs sandboxes on gVisor. Follow it in the server's `cloud` (creating, booting, joining, ready) and `state`. Without `confirm` it answers 409 with the monthly price. Confirm that with the user, then send it again with `confirm: true`. Team owners and admins. Needs Tailscale and the team's Hetzner connection. - [Create a sandbox](https://pyo.dev/md/api/reference/sandboxes/create-sandbox.md): Makes an isolated machine from a sandbox template on one of the team's sandbox servers (or the installation's), within the team's limits. It runs until its lifetime ends or it's deleted. The answer has the `connection`: the server's address and a token, valid an hour, for exec, terminals, files and ports there. A server with Tailscale answers on your tailnet. One without is called through Pyo, at the `url` the connection gives, and its desktop and web pages don't open until it has Tailscale. Ask for a new token with `createSandboxToken`. `teamId` may be left out when the API key (or you) can use only one team. `server` runs it on that server only. - [Make a sandbox server's join code](https://pyo.dev/md/api/reference/sandboxes/create-sandbox-join-code.md): On Pyo Cloud: adds a sandbox server to the team, or makes a new code for one that hasn't joined yet, and the command to run on it. The code works once, for 15 minutes. The command, `curl -fsSL /server.sh | bash -s -- sandbox `, runs pyo-server with one token that carries the code. It installs Pyo's sandbox daemon and joins Pyo over HTTPS. The server then gets its work from Pyo. With Tailscale on Integrations, the command also joins your tailnet with a key from your team's Tailscale, and the terminal, files and desktop open there. Without, the server joins with its code alone, the terminal and files go through Pyo, and the desktop needs Tailscale. With `id`, asking again changes that server until it joins. Team owners and admins. - [Create a sandbox server's DNS record](https://pyo.dev/md/api/reference/sandboxes/create-sandbox-server-dns-record.md): Creates the wildcard record `*.` in the team's Cloudflare connection: A (and AAAA) to the public addresses the server reports, not proxied. Records already on the name are never changed: another one there is a conflict. Team owners and admins, or the installation's admin for its own servers. - [Create a sandbox template](https://pyo.dev/md/api/reference/sandboxes/create-sandbox-template.md): A template made from an OCI image, like "node:22", or an image in Pyo's registry. Every sandbox server that may use it pulls the image and makes a root disk from it. A Firecracker server boots it once and snapshots it, and a gVisor server starts sandboxes from the disk. The template is ready once one server has it. - [New sandbox token](https://pyo.dev/md/api/reference/sandboxes/create-sandbox-token.md): A new token for the sandbox's server, valid an hour. Ask before the last one runs out. - [Delete a sandbox](https://pyo.dev/md/api/reference/sandboxes/delete-sandbox.md): Ends the sandbox and throws away its files. When its server can't be reached right now, it shows as stopping and Pyo tries again. - [Delete a sandbox template](https://pyo.dev/md/api/reference/sandboxes/delete-sandbox-template.md): Deletes it here and on the sandbox servers. Refused while sandboxes run from it. - [Extend a sandbox](https://pyo.dev/md/api/reference/sandboxes/extend-sandbox.md): Sets when the sandbox ends: `ttl` from now, or never with `"none"`. - [A sandbox](https://pyo.dev/md/api/reference/sandboxes/get-sandbox.md): One sandbox, as `listSandboxes` lists them, with a fresh `connection` for its server when you may use it. - [Get a sandbox server's certificate](https://pyo.dev/md/api/reference/sandboxes/issue-sandbox-server-certificate.md): Gets a Let's Encrypt certificate for `*.` with a DNS-01 challenge in the team's Cloudflare connection, and puts it on the server, whose edge serves it at once. It runs in the background: the server's `edge.cert.state` says how it goes. Pyo renews it 30 days before it runs out. Also renews it now. The zone must be connected and editable. Team owners and admins, or the installation's admin for its own servers. - [Keep a sandbox server that hasn't joined](https://pyo.dev/md/api/reference/sandboxes/keep-sandbox-server.md): A server added with an `id` that never joins is removed a day after its last code runs out. This keeps it until it's removed, with resetSandboxServerAccess for a new command. Fine for a server that's kept already. Team owners and admins, or the installation's admin for its own servers. - [Sandbox servers](https://pyo.dev/md/api/reference/sandboxes/list-sandbox-servers.md): The servers a team's sandboxes run on: its own and the installation's. - [Sandbox templates](https://pyo.dev/md/api/reference/sandboxes/list-sandbox-templates.md): What a team's sandboxes can start from: its own templates and the installation's. - [Sandboxes](https://pyo.dev/md/api/reference/sandboxes/list-sandboxes.md): A team's sandboxes: their template, size, state, server and lifetime. Env values are never shown, only their names. - [Open a sandbox port](https://pyo.dev/md/api/reference/sandboxes/open-sandbox-port.md): Serves a port the sandbox listens on at its own URL. A public port answers anyone. A private one needs a sandbox token, in `Authorization: Bearer` or once as `?pyo_token=` in a browser. - [Pause a sandbox](https://pyo.dev/md/api/reference/sandboxes/pause-sandbox.md): Stops its machine and keeps its memory and files on the server, so it resumes where it was. Connections to it drop. - [Remove a sandbox server](https://pyo.dev/md/api/reference/sandboxes/remove-sandbox-server.md): Deletes its sandboxes where it still answers, and forgets it. To take the daemon off the server, run `pyo-server uninstall` there. A server set up with sandbox.sh before 0.53.0 takes `sandbox.sh --uninstall`. A server Pyo made at a cloud provider leaves your tailnet and is deleted there, which takes `confirm`. With `draft`, only a server that never joined is removed, and one that joined is left alone. - [Rename a sandbox](https://pyo.dev/md/api/reference/sandboxes/rename-sandbox.md): Gives the sandbox another name. Its id stays the same, so scripts that use it keep working. Works on ended sandboxes too. - [Reset a sandbox server's access](https://pyo.dev/md/api/reference/sandboxes/reset-sandbox-server-access.md): The server's key stops working at once, and its waiting commands fail. Answers with a new command for the same server, which works once, for 15 minutes. Run it there to join again. On a self-hosted Pyo, a server that shows `needsUpdate` gets the command that updates it instead (Update): it takes no commands until the command runs there. Its sandboxes keep running. The new command joins the server the way that fits now: on your tailnet once Tailscale is set up, without it otherwise. So it also moves a server onto the tailnet, or off it. Team owners and admins, or the installation's admin for its own servers. - [Resume a sandbox](https://pyo.dev/md/api/reference/sandboxes/resume-sandbox.md): Starts a paused sandbox again where it was. - [Cancel server removal](https://pyo.dev/md/api/reference/servers/cancel-server-removal.md): Stop a server removal that's waiting or failed. The server takes work again. - [Create cloud server](https://pyo.dev/md/api/reference/servers/create-cloud-server.md): Make a server at a cloud provider and join it to a cluster over your tailnet (team admins). Read the locations, server types and prices with getCloudOptions first. Its startup script holds only one-time keys: on its first boot it joins your tailnet, then fetches its join details from Pyo over the tailnet. Pyo labels it as this installation's and puts it behind a firewall that allows only the web (80 and 443) and Tailscale. Follow it in `cloudServers` of getState: creating, booting, joining, then ready. Without `confirm` it answers 409 with the monthly price. Confirm that with the user, then send it again with `confirm: true`. - [Delete cloud server](https://pyo.dev/md/api/reference/servers/delete-cloud-server.md): Delete a server Pyo made at a cloud provider (team admins): its services move off it, it leaves the cluster and your tailnet, then it's deleted at the provider. Only servers with this installation's label are ever deleted there. A cluster's first server goes once the cluster is removed. Without `confirm` it answers 409 with the monthly cost that stops. Confirm that with the user, then send it again with `confirm: true`. - [Whether the team may add a server](https://pyo.dev/md/api/reference/servers/get-can-add-server.md): The same check Pyo makes as a new server, cluster or builder server is added. Always yes when self-hosted. On Pyo Cloud, no without a subscription that covers one more server, with the reason. - [Server types and prices](https://pyo.dev/md/api/reference/servers/get-cloud-options.md): What a new server at a cloud provider can be, read live from it with the team's token: its locations, and its server types with their specs, architecture, where each can be made now and its monthly price in each location (before VAT, with its IPv4 address). Pyo's servers run x86-64, so Arm types have `supported` false. - [Machines waiting for a Tailnet Lock signature](https://pyo.dev/md/api/reference/servers/get-tailnet-lock.md): With Tailnet Lock on, a new server stays off the tailnet until a signing device signs its key. These are the ones on the team's clusters' tailnets that wait, with the command to run on a signing device, as each cluster last saw them. Empty without Tailscale set up. - [Join server](https://pyo.dev/md/api/reference/servers/join-server.md): The command that joins a new server to a cluster: `curl -fsSL /server.sh | bash -s -- join `, which runs pyo-server with one token (valid for an hour). - [Remove server](https://pyo.dev/md/api/reference/servers/remove-server.md): Take a server out of its cluster, moving its services off first. `force` removes it at once, for a machine that's gone. - [Set server region](https://pyo.dev/md/api/reference/servers/set-server-location.md): Set a server's region: a name ("US East", "Singapore, SG"), or "" to detect it again. - [Set server maintenance](https://pyo.dev/md/api/reference/servers/set-server-maintenance.md): Put a server in maintenance (its services move elsewhere), or bring it back. - [Set server regular services](https://pyo.dev/md/api/reference/servers/set-server-regular-services.md): On a GPU server: also run regular services, or keep it for GPU work. Null goes back to the default. - [Set server schedulable](https://pyo.dev/md/api/reference/servers/set-server-schedulable.md): Whether new work may be placed on a server. - [Set server tags](https://pyo.dev/md/api/reference/servers/set-server-tags.md): Set a server's tags. - [Create service](https://pyo.dev/md/api/reference/services/create-service.md): Create a service and deploy it. - [Delete service](https://pyo.dev/md/api/reference/services/delete-service.md): Delete a service and stop it everywhere. Its volumes are kept, detached, unless `deleteVolumes`. - [Recent logs](https://pyo.dev/md/api/reference/services/get-service-logs.md): The last lines each of a service's replicas printed, read from its cluster on request. Takes up to 15 seconds. To follow them, open the WebSocket at `/services/{id}/logs/follow` with the same query: it sends these lines, then new ones as they're printed, each text frame `{"type":"lines","lines":[…]}` (or `{"type":"error","message":…}`). It closes after an hour, so open it again with `since` set to the newest line's time. - [Can the site be previewed](https://pyo.dev/md/api/reference/services/get-service-preview.md): Whether a service's site can be shown in the dashboard's preview frame: it answers, and doesn't forbid framing (X-Frame-Options, CSP frame-ancestors). Only the service's own first domain is asked, and never a private address. - [How traffic reaches a service](https://pyo.dev/md/api/reference/services/get-service-traffic.md): Its domains and the addresses they point at, the servers that take public traffic and their regions, where its replicas run, and anything that keeps visitors from reaching it. - [Restart service](https://pyo.dev/md/api/reference/services/restart-service.md): Restart a service's replicas one by one, with the same configuration. - [Reveal secret](https://pyo.dev/md/api/reference/services/reveal-secret.md): Show a secret environment variable's value. Admins only, and logged. - [Save service](https://pyo.dev/md/api/reference/services/save-service.md): Save a service's configuration. With `deploymentId`, roll it out too. Changes to its `domains` go live without a deploy once it has been deployed. A variable sent back hidden (`•••`, as reads show it) keeps its saved value. `removeDomain` removes a domain without sending the whole service. - [Scale service](https://pyo.dev/md/api/reference/services/scale-service.md): Change a service's number of replicas without a new deployment: 1 or more, with no maximum. Replicas that don't fit on the servers wait until there's room, and the response's `warning` says so. - [Set autoscale](https://pyo.dev/md/api/reference/services/set-autoscale.md): Turn autoscaling on or change it. Null turns it off. - [Stop service](https://pyo.dev/md/api/reference/services/stop-service.md): Stop a service. Deploy it again to start it. - [Everything you can see](https://pyo.dev/md/api/reference/state/get-state.md): One snapshot of every team you're in (or the API key's teams): their projects, services and deployments, clusters and servers, domains, certificates, volumes, backups, registry logins, builders and recent activity. The dashboard renders from this, and scripts can read it too. - [Create team](https://pyo.dev/md/api/reference/teams/create-team.md): Create a team. You become its owner. - [Delete team](https://pyo.dev/md/api/reference/teams/delete-team.md): Delete a team and everything in it. Owners only. - [Invite member](https://pyo.dev/md/api/reference/teams/invite-member.md): Invite someone to a team by email, as owner, admin, developer or viewer. - [Audit log](https://pyo.dev/md/api/reference/teams/list-audit-log.md): Who did what in a team, newest first: when, the account, the action, how (dashboard, API key or assistant) and the address and browser it came from, as the team keeps them. Sign-ins, failed sign-ins and two-factor changes are here too. For the team's owners and admins. - [Remove member](https://pyo.dev/md/api/reference/teams/remove-member.md): Remove a member from a team, or revoke an invite. - [Resend invite](https://pyo.dev/md/api/reference/teams/resend-invite.md): Make a new invite link (the earlier one stops working) and mail it, or with `send: false` only return it to share. - [Reset member sign in](https://pyo.dev/md/api/reference/teams/reset-member-sign-in.md): Owners only: a one-time link for a member who lost their password, to choose a new one. It's emailed to them. Without email set up, it's returned to pass on, for an account in this team alone. - [Rotate data key](https://pyo.dev/md/api/reference/teams/rotate-data-key.md): Give the team a new data key and seal its stored secrets again with it. - [Set team observability](https://pyo.dev/md/api/reference/teams/set-team-observability.md): A team's observability: what its servers collect and keep. Owners and admins. Left out, a setting stays as it is. - [Update member role](https://pyo.dev/md/api/reference/teams/update-member-role.md): Change a member's role: "owner", "admin", "developer" or "viewer". - [Update team](https://pyo.dev/md/api/reference/teams/update-team.md): Rename a team, change its description, default cluster or preferences. - [Add volume](https://pyo.dev/md/api/reference/volumes/add-volume.md): Add a persistent volume to a service, mounted at `mountPath` from its next deploy. - [Attach volume](https://pyo.dev/md/api/reference/volumes/attach-volume.md): Attach a detached volume to a service on its cluster, mounted at `mountPath` from the service's next deploy. A service of another project (or any project, for a volume whose project was deleted) gets the volume moved into its project first, data, id and backups kept: the volume shows `moving` until its cluster has moved it, then it's attached (or `moveError` says why not). A volume can't move to another cluster. A volume on a one-server storage class keeps its data on that server, so the service must be able to run there. - [Delete volume](https://pyo.dev/md/api/reference/volumes/delete-volume.md): Delete a detached volume and its data, for good. Admins only. The volume stays listed, being deleted, until its cluster confirms. Also deletes a volume Pyo has no record of, listed in its cluster's `strayVolumes`: pass that `volumeId` as `id`, with `clusterId`. - [Delete a volume snapshot](https://pyo.dev/md/api/reference/volumes/delete-volume-snapshot.md): Deletes one of a volume's backups from the team's restic repository, with a short job on its cluster that waits for the volume's other backups and restores. The space it held is freed shortly after. Deleting one that's already gone succeeds. Owners and admins. - [Detach volume](https://pyo.dev/md/api/reference/volumes/detach-volume.md): Detach a volume from its service: unmounted from the next deploy. The volume and its data stay, to attach again or delete. - [A volume's snapshots](https://pyo.dev/md/api/reference/volumes/list-volume-snapshots.md): Its backups in the team's restic repository, newest first, read from its cluster on request (a short job there). Takes up to two minutes. - [Resize volume](https://pyo.dev/md/api/reference/volumes/resize-volume.md): Grow a volume to `sizeGi` GB (never shrink it). Owners and admins. Only on a storage class that can grow volumes (`allowVolumeExpansion`). A `local-path` volume has no size limit of its own, so there's nothing to grow. The volume shows `resizeTo` until its cluster reports the new size. Some storage classes finish when its service next starts. - [Restore volume](https://pyo.dev/md/api/reference/volumes/restore-volume.md): Restore a volume from one of its snapshots (see `listVolumeSnapshots`), replacing its data. Owners and admins. Its service stops while the restore runs and starts again afterwards, even when it fails. The snapshot is restored next to the data and swapped in only once complete, so a failed restore leaves the data as it was. The volume needs room for the snapshot while this runs. The volume shows `restore` while it runs, then `restoredAt`, or `restoreError` with why it failed. ## Templates - [All templates](https://pyo.dev/templates) ## Full text - [All docs as one file](https://pyo.dev/llms-full.txt)