Server
This installs the published images on a Linux server. cue deploy runs on the operator machine. It uses ssh and scp. It does not clone the repository, and it does not build on the server.
DNS
Before the first start, point these three names at the server:
- the console host passed to
--console-host, such asconsole.example.com doc.<console-host>, such asdoc.console.example.com- the public host passed to
--edge-name, stored on the server asEDGE_NAME
Let's Encrypt completes the HTTP-01 challenge on port 80. The three names have to resolve to this server before Compose starts, or that challenge fails. Port 80 is not a site in the Caddyfile.
The console answers on https://<console-host>. The docs answer on https://doc.<console-host>. The docs name is derived from ORCH_CONSOLE_HOST. There is no separate variable for it. Both sites use the same Let's Encrypt issuer and the same address list. Neither site asks for a client certificate. CUE_URL is https://<EDGE_NAME>:3443. The facade ports use the private certificate.
Deploy
cue comes from the installed @ascentstudio/cue-sdk package. The image tag is the version of that package, the same version as the npm packages of that publication.
cue deploy user@host --edge-name edge.example.com --console-host console.example.com --acme-email admin@example.com --s3-bucket cue-backups --s3-region eu-west-1cue deploy --help and cue deploy -h print that usage line. The command takes one positional argument, user@host. It runs ssh and scp with that host and no extra options.
--edge-name, --console-host, --acme-email, --s3-bucket, and --s3-region are required. --s3-endpoint is optional. --edge-name and --console-host are hostnames without a scheme, a port, or a path. --acme-email is an email address. --s3-bucket, --s3-region, and the S3 keys cannot contain a space, #, a quote, or \. When --s3-endpoint is set, it is an http or https URL.
The S3 keys come from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or from CUE_S3_ACCESS_KEY_ID and CUE_S3_SECRET_ACCESS_KEY. If a key is missing, the command prompts for it. The prompt does not echo, and it needs a terminal.
The age private key is ~/.config/cue/age.key on the operator machine, mode 0600. When the command creates that key, it creates ~/.config/cue as mode 0700. A key that is already a valid identity is reused. A file that is not an age identity stops the command. The private key stays on this machine. backup.env receives only the public recipient.
The command generates new service secrets, copies the server tree from the SDK package, and writes .env, backup.env, and network.ini. .env and backup.env are mode 0600. Before it connects, it prints a reminder to point DNS for the edge name, the console host, and doc.<console-host> at the server. It then copies the tree with scp to /tmp/cue-deploy-… and runs remote-install.sh there.
On the server, the script checks Linux, Docker, and Docker Compose. It pulls ascentstudio/cue-orchestrator, ascentstudio/cue-caddy, ascentstudio/cue-zot, and ascentstudio/cue-backup. For version 0.1.0 each image is tagged 0.1.0. There is no latest tag. One version does not pull another image. Redis, ClickHouse, MinIO, Verdaccio, and Supabase stay on their public images. A failed pull stops the script before it copies anything into the install directory. It then copies the tree to /var/lib/cue, mode 0700, and creates the certificate directory /var/lib/cue-data/certs. docker compose up -d runs from /var/lib/cue. The firewall step comes after Compose has started.
When the SSH account is not root, the command asks for the root password with su before the script runs. Creating /var/lib/cue and /var/lib/cue-data, and changing the firewall, need root even when that account can already pull images. Root skips that prompt. The script opens ports 22, 80, and 443 with ufw, or with firewalld when ufw is not installed. It limits the facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873 to the address in SSH_CLIENT. If neither firewall command is installed, it prints those rules and leaves the firewall unchanged. If SSH_CLIENT has no usable address, the install stops after Compose has started. Ports published by Docker bypass that firewall. Postgres listens on 127.0.0.1:54322, and the Supabase API listens on 127.0.0.1:54321. Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor are not published on the host.
--edge-name is the public host of CUE_URL. The command stores it as EDGE_NAME, sets CUE_URL to https://<edge-name>:3443, and writes that EDGE_NAME in network.ini. --console-host is stored as ORCH_CONSOLE_HOST. The server environment leaves ORCH_URL, ORCH_EDGE_NAMES, CUE_REDIS_URL, CUE_CLICKHOUSE_URL, CUE_TRANSIENT_S3_ENDPOINT, and CUE_ENROLLMENT unset. The console uses https://127.0.0.1:3443.
ascentstudio/cue-orchestrator:<version> is the image Compose starts. Its entrypoint starts the orchestrator, waits until console-client.crt and the Caddyfile are in the certificate directory, then starts the console on port 3000 and the docs on port 3002. The orchestrator process does not start those two. The container uses the host network, so Caddy reaches 127.0.0.1:3000, 127.0.0.1:3001, and 127.0.0.1:3002.
Compose sets MIGRATE_SEED=0. The migrate service skips deploy/supabase/seed.sql. The server has no pierre@ascent-studio.fr account, no fixture-local secret, and no join_fixture trigger.
A second cue deploy writes new secrets into /var/lib/cue/.env and backup.env, then runs Compose again. The Postgres volume keeps the password from the first start. The age key on the operator machine stays the one already there.
After a successful install, the command prints the age key path, the cue-backups prefix, the 03:00 UTC backup time, and the notes about Docker-published ports and Redis. It then deletes the temporary tree on the operator machine.
First account
The sign-in page does not create a person. The first person is created with cue deploy --create-account, after the install. The command does not restart Compose and does not write new secrets. No email is sent.
cue deploy user@host --create-account --email ada@example.com --organization acme --organization-name Acme--email, --organization, and --organization-name are required. --email is an email address. --organization matches [a-z][a-z0-9-]{0,62}. --organization-name is the displayed name and cannot be empty. The password is not a flag. The command prompts for it. The prompt does not echo, and it needs a terminal. Fewer than 6 characters is refused before ssh.
--create-account does not accept --rm, --check, --edge-name, --console-host, --acme-email, --s3-bucket, --s3-region, or --s3-endpoint.
The command copies remote-create-account.sh and a JSON file to /tmp/cue-deploy-…. The JSON file is mode 0600. It contains the email, the password, the organization id, and the organization name. The password is not an argument to ssh. The remote directory is removed at the end.
The script reads SUPABASE_SERVICE_ROLE_KEY and POSTGRES_PASSWORD from /var/lib/cue/.env. That file is mode 0600 and owned by root. When the SSH account cannot read it, su asks for the root password. Root skips that prompt.
An organization id that already exists stops the command before it creates the person. The script posts the person to http://127.0.0.1:54321/auth/v1/admin/users with the service role key and email_confirm set to true. An email that is already registered stops the command and does not change the password. The organization and the membership are inserted through 127.0.0.1:54322. If that insert fails, the script deletes the person with DELETE /auth/v1/admin/users/:id.
Open https://<console-host> and sign in with that email and password. The address list is empty, so the console is open for that sign-in.
The browser uses NEXT_PUBLIC_SUPABASE_URL. On the console site, Caddy forwards only /auth/v1 to 127.0.0.1:54321. Studio stays on that loop, behind the gateway password. The console process uses SUPABASE_SERVER_URL=http://127.0.0.1:54321.
Address list
The console page /account/edge edits the edge_allow table. Each change rewrites the Caddyfile and pg_hba.conf.
The first list must contain the address of the person saving it. A list that does not contain that address is refused. After the first address, the console site and the docs site use the same list. An empty list leaves both sites open and refuses remote addresses on the machine listeners: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. 127.0.0.1 and ::1 stay allowed.
Supervisors
A supervisor uses CUE_URL, https://<EDGE_NAME>:3443. It derives Redis (rediss://<host>:6380), ClickHouse (https://<host>:8443), transient files (https://<host>:9443, region us-east-1, bucket transient), enrollment (https://<host>:4443), zot (https://<host>:7443), and Verdaccio (https://<host>:4873) from that host.
Add the supervisor address on /account/edge before you start it. Otherwise its enrollment request does not reach the orchestrator. Once the list has an address, the console site uses it too, so the CA download below needs that address as well. The facade ports are limited to the SSH_CLIENT address recorded at deploy, so a supervisor on another address also needs those ports allowed for it. Enrollment on port 4443 uses server TLS only. The supervisor prints a code and polls. A person approves that code on the Supervisors page.
The console is already on Let's Encrypt. It serves the orchestrator CA at https://<console-host>/enrollments/ca. Caddy on that site proxies the exact path to the orchestrator. Port 4443 stays on the private certificate and does not serve this path.
cue deploy-supervisor installs that supervisor on Ubuntu or Debian. It does not run on macOS. It uses ssh and scp. It does not clone a repository, and it does not build on the host. It does not read or write a package.json, and it does not copy a checkout. cue.organization stays on the orchestrator, when a package revision is registered.
cue deploy-supervisor user@host --organization minea --cue-url https://edge.example.com:3443 --console-url https://console.example.com --environment prod--organization, --cue-url, and --environment are required. One of --ca or --console-url is required. --organization, --environment, and --worker are lowercase letters, digits, and hyphens. --cue-url is an https URL. --console-url is an https origin with no path, query, or hash. A trailing slash and the default port are dropped. It is stored as CUE_CONSOLE_URL. --ca is a local file, copied to the host as the orchestrator authority. Both may be passed: the file is copied and the URL is stored. --mode is container or process. The default is container. --kinds, --not-kinds, --runtimes, and --not-runtimes select the kinds this host accepts. --env-file is an optional local file copied onto the host. The service passes that path to the supervisor. It never passes --source.
When CUE_CONSOLE_URL is set and ca.crt is absent, the supervisor downloads that PEM before it enrolls, using the public trust store. It writes the file mode 0644 and uses it for enrollment. A CUE_CONSOLE_URL that is not an https origin, a failed download, a status other than 200, or a body without a certificate stops the supervisor before any enrollment request. An existing ca.crt is kept. The approval response must still match that pinned authority.
The environment secret comes from CUE_ENVIRONMENT_SECRET. If it is missing, the command prompts for it. The prompt does not echo, and it needs a terminal. Without --worker, the worker name is the remote hostname, with every other character turned into a hyphen.
Before the install, the command reads the VPS egress address from the host route and prints it. Add that address on /account/edge, and allow it on the orchestrator facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873. The command does not connect to the orchestrator.
On the host, a system Node.js that is already version 22 or newer stays. Otherwise the script extracts the official Node 22 archive into /usr/local. It does not use nvm. Docker Engine and the Compose plugin stay when docker compose already answers. Otherwise they are installed from the Docker apt repository, and Docker is enabled. The system user cue is created when missing, in the docker group, with home /var/lib/cue-supervisor. The script installs @ascentstudio/cue-supervisor at the SDK version.
supervisor.env is mode 0600. It sets WORKER_ORGANIZATION, CUE_URL, CUE_CONSOLE_URL when --console-url is passed, CUE_ENVIRONMENT_SECRET, CUE_ENVIRONMENT_NAME, WORKER_NAME, SUPERVISOR_CERT_DIR=/var/lib/cue-data/supervisor, and ORCH_REVISION_CACHE=/var/lib/cue-supervisor/revisions. No package.json is placed in /var/lib/cue-supervisor. The supervisor enrolls as organization/environment/host, using WORKER_ORGANIZATION because that directory has no checkout. After enrollment, fetchWorkerEnvironment still checks that the secret matches that organization and environment. The pinned revision is downloaded into the revision cache. Process mode does not treat the install directory as source. Container mode starts the images of that revision. Process mode starts worker from that revision. A cue dev inside a checkout still uses that checkout.
The firewall step runs before the service starts. The script installs ufw when it is missing, allows the server port from SSH_CONNECTION, and denies other incoming traffic. It does not open the facade ports. The supervisor is a client. If that port cannot be read, the script does not enable the firewall, and it exits, so the SSH session is not cut off. The unit is cue-supervisor.service, with Restart=always and WantedBy=multi-user.target. A second run rewrites the unit and restarts the service.
After the service starts, the command follows journalctl -u cue-supervisor -o cat from that start. It prints the enrollment code, the waiting line when the orchestrator is unreachable, approval, denial, expiry, and a certificate that is already valid. It exits when the certificate is in place, approved, denied, or expired. Ctrl-C stops that relay and leaves the service running.
Backup
A backup container on the platform network waits until 03:00 UTC, runs the backup, and repeats that wait. The first backup and every later backup run at 03:00 UTC. It has no published port. It uses ascentstudio/cue-backup:<version>.
The container dumps Postgres with pg_dump -Fc to db:5432, with the database password, not through host port 54322. It writes the ClickHouse metrics to a file and copies the certificate directory. It encrypts those files with age, using the operator's public key, and stores them in the S3 bucket under the prefix cue-backups. Retention is 30 days. The S3 credentials on the server can only write to that prefix.
The age private key stays on the operator machine, at ~/.config/cue/age.key, mode 0600. It is not on the server.
Redis is not backed up.
Restore
Decrypt a backup on the operator machine with the age private key at ~/.config/cue/age.key. Restore Postgres from the dump, restore the ClickHouse metrics, and restore the certificate directory.
Redis is not in the backup. After a Postgres restore, flush Redis. Jobs left in Redis would run again after Postgres already applied them.