PHP versions#
Every server gets PHP 8.6: it runs Studio, and new projects start on it. 8.5,
8.4 and 8.3 are there for projects that need them: Install next to one,
under Server → PHP, puts it on the server in a few minutes, from packages.sury.org with the usual
extensions and its own PHP-FPM, and the project forms offer it as soon as it is done. One install at a time, never
during an update. Once installed, a version stays, and every update keeps it on its newest patch, as it does 8.6.
Servers already on 8.5 keep their projects there until you change them; older optional versions stay where they were
installed.
Channels#
| Channel | Installs | For |
|---|---|---|
| Stable (default) | The newest release tag, vMAJOR.MINOR.PATCH; pre-releases and everything between two releases are skipped | Every team |
| Beta (beta tester mode) | The head of the main branch, every new commit, before it becomes a release | A server you test Studio on, not the team's daily work |
The channel is a switch in Administration → System; the installer can start on beta
(STUDIO_CHANNEL=beta, see What it installs). Neither channel goes
backwards: a build is installed only when it contains the installed commit, which the updater checks on a blob-less
mirror of the repository. Back on stable after beta, Studio keeps its main build, newer than the last release, until a
release contains it; when a release is tagged on that very commit, it moves to the release's name.
main instead of the newest release, each one installed as main-<commit> with the same backups and rollback as a release.When#
- Every night, between 04:00 and 05:00, from a systemd timer, while automatic updates are on (the default).
- From Administration → System: Check now, then Update to ….
- Force update, in the same place: builds the newest build of the channel and installs it now,
even when it is the one already installed (a broken build, a failed system step, a server changed by hand). The new
build goes next to the live one as
<build>@<time>, with the same dump and rollback. It never goes back to an older build: that is whatstudio-update rollbackis for. - On the server:
sudo studio-update apply(--forcefor the same as the button). Running the installer again does the same asapply.
What an update does#
- Clone the build into
/opt/studio/releases/<build>. A tag'sVERSIONfile must say the same as the tag. With/etc/studio/update-signersin place, the tag (or, on beta, the commit) must carry a valid SSH signature by one of those keys. - System step, as root, from the new build: its
installer/requirements.envnames the PHP versions, the PHP that runs Studio and the Node major;installer/lib/system.shinstalls what is missing, refreshes Composer and Claude Code, installs Playwright MCP at the pinned version with its Chromium, and the CLI of the first administrator's git host. Nothing is removed. - Upgrade scripts, phase before:
installer/upgrades/<version>.shof every version after the installed one up to the new one, in order, as root, for what a release needs beyond packages. On beta, where several builds share a version, a script that changed since it ran runs again. - Build next to the running release, on the shared
.envandstorage: Composer without dev dependencies, the assets. - Database: a dump to
/var/backups/studio/, maintenance mode, migrations with the new code. Caddy's certificate question, the access check of protected hosts and the bridges' callbacks keep answering meanwhile. - Switch: the new build's helper, templates, services, PHP-FPM pool and Caddyfile, then
/opt/studio/currentpoints at it; upgrade scripts, phase after; caches, restarts, maintenance off. - Health check: Studio must answer
/up. If it does not, or any step from the dump on fails, the previous release, its root files and the database dump come back, and the System page shows the log.
Project sites and workspaces are not touched: they are your projects. Bridges move to the new code when they restart (a workspace stopped and started, a changed token); a release that changes the bridge protocol restarts them in its upgrade script. Three releases and five database dumps stay on disk.
The server itself#
Studio's update installs what a release needs and adds what is missing; it does not upgrade what is already there,
except a PHP older than the security fixes the release names (PHP_FIXED in requirements.env),
which goes to its newest package with its PHP-FPM restarted. The rest is the job of the server update, studio-update system: every night between 03:00
and 03:30 (an hour before Studio's own update, which waits for it), from Administration → System with
Update the server now, or by hand. It brings every package and tool on the server to its newest version:
- apt:
update,full-upgrade,autoremove. That is Ubuntu and its security fixes, every installed PHP and its extensions (packages.sury.org), Caddy, MariaDB, PostgreSQL, redis, Node within its major (NodeSource),ghoraz. Configuration files changed by hand are kept. - Outside apt: Composer (
self-update), Claude Code (npm,@latest),glab(its newest release), theazure-devopsextension, through the system step of the installed release, which also installs what that release names and is missing. - Services:
needrestartrestarts every service still on an old library (never a workspace bridge, where a conversation may be running: it picks the new Node up at its next start); when anything changed, Studio's services restart; then Studio must answer/up. - TLS certificates: Caddy issues each one on demand and renews it by itself when a third of its
lifetime is left. The check goes through every certificate Caddy keeps for a host Studio still serves: one past
that point gets a TLS handshake on the server, which makes Caddy renew it now; one still not renewed (a DNS
record moved, the CA unreachable) is listed on the System page with its days left, until it is. The
certificates of deleted projects and workspaces are left to expire.
studio-update certificatesruns the check alone. - Reboot: a new kernel shows reboot required on the System page. With
SYSTEM_REBOOT=1in/etc/studio/studio.envthe nightly run reboots the server five minutes after it ends; a run by hand never does.
It stays on what is installed: another PHP version is added on the System page (PHP
versions) or comes with a release of Studio (requirements.env); a new Ubuntu release, a new Node major or a new major version of MariaDB or PostgreSQL is a decision for a person. The
System page lists what the last run changed (php8.4-fpm 8.4.12-1 → 8.4.13-1) with its log; apt's own
output is in /var/log/studio-install.log. The switch Nightly server updates (or
studio-update system-auto off) turns the timer off.
studio-update check # what the channel would install, and why not
studio-update apply # --force · --to v2.0.0
studio-update channel beta # or stable · auto on|off
studio-update rollback # the previous release and its database
studio-update ensure # the system step again · status
studio-update system # every package to its newest version, the certificates · system-auto on|off · certificatesDomain & visibility#
Every host hangs under the one domain chosen at install: studio.<domain>,
<project>.<domain>, <person>-<project>.<domain>, with a wildcard
DNS record and certificates Caddy issues on demand and renews by itself. When the domain itself has to change,
or a certificate needs a hand, root has studio-domain:
studio-domain status # domain, DNS, visibility, every certificate
studio-domain check studio.agency.test # does *.domain point here?
studio-domain change studio.agency.test # move everything there
studio-domain renew [host|all] # the late ones · a new one for a host · for all
studio-domain prune # certificates of hosts no longer servedChanging the domain: create *.<new> A <this server> first; change
checks it and refuses to go on until it resolves here (--skip-dns goes on anyway). It backs up every
file it touches in /var/backups/studio-domain, puts Studio in maintenance for a minute, moves every
site, preview and sandbox (<name>.<old> becomes <name>.<new> in its Caddy
host and in the APP_URL, ASSET_URL, REVERB_HOST and session lines of its
.env), Studio's own .env and Caddyfile, the hosts kept in the database, and registers every
push webhook again at the new address. If a step fails, everything is put back on the old domain. Afterwards
everyone signs in again, and passkeys, which belong to the old host, are added again in Settings → Security
(passwords and 2FA codes keep working). An app with Reverb on keeps the old host in its built assets until its
next build; the command lists them. Once nobody uses the old names, prune removes their certificates.
Certificates: renew alone does what the nightly check does (renews the late ones);
renew <host> throws that host's certificate away and gets a new one, renew all every host's.
Caddy restarts for it, so open terminals reconnect. Let's Encrypt allows 50 new certificates a week per registered
domain and 5 for the same host: renewing everything is for when something is really wrong.
Clients' domains#
Administration → Domains takes a domain other than Studio's (client.com), with its subdomains
or not, and shows the records to create at its DNS provider: client.com A <this server> and, for the
subdomains, *.client.com (a CNAME to studio.<domain> works too). Studio accepts it once it
points here, which is also the proof that it is yours: Caddy gets a certificate only for a name that sends the CA to
this server. It asks the DNS again every day; a domain that stops pointing here is marked DNS lost and gets no
new certificate, one still waiting is accepted the day its records arrive. A domain a project uses cannot be removed.
Then, in a project's Settings → Server → Addresses: the site's public
address at the domain itself or at a subdomain of it (project-a.client.com), public or not
public for that project alone, with <key>.<domain> kept for the team behind the login. Previews and
sandboxes always live under Studio's domain, the team's. Saving applies it to the site on the server, its
APP_URL included. The access rules and the agent's browser work the same on any domain. A name on a client's domain that no
project uses gets no certificate and no welcome page. When Studio's own domain changes (studio-domain change),
the clients' domains stay as they are.
Hiding the dashboard: Administration → System → Domain & visibility switches
studio.<domain> from public (its sign-in page to anyone, as any app) to hidden. Hidden, whoever is not
signed in gets the page of an address nobody configured, on every path, and the welcome page of unknown names no
longer links to Studio. People get in through the door: a secret link shown on that page and next to a new
account's password, opened once per browser (it leaves a cookie for a year). A signed-in session is enough, and so
is a good password reset link from an email. New link closes every door handed out until then. From the
server, studio-recover door prints the link (--rotate makes a new one) and
studio-recover public / hidden switch it. Project sites and previews keep their own rules
(Who opens the hosts); a hidden dashboard only hides Studio itself.
Locked out#
A forgotten password or a lost 2FA device is an administrator's job: the key icon in Administration → People gives the person a new password, shown once, and removes their 2FA (with email set up, people also get the usual Forgot your password? link). Administrators do the same for each other. What is left is the last administrator: nobody above them in Studio, and the server itself fine. The one key that is never in Studio is root on the server. From an SSH session:
studio-recover admin # the main administrator: the oldest admin account
studio-recover admin you@agency.test # that account instead; unknown = createdThe account gets a new password, printed once in the terminal; its 2FA is removed, every session it had is closed,
it is an administrator again with a verified email. Its git and Claude credentials stay, and nothing else on the
server is touched. Log in with that password, change it in Settings, set 2FA up again. Each run is written
to syslog (auth) and to Studio's log.
studio-recover lives in /usr/local/sbin, mode 0700: only root can read or run it, there is
no sudo rule for it and nothing in Studio calls it. It runs php artisan studio:reset-admin as the
studio user, which is the same thing if you prefer artisan. Whoever can reset the administrator can
already read /opt/studio/shared/.env: the script adds no power root does not have, it only makes the
way back short and recorded.
Releasing#
For whoever maintains Studio: set VERSION (2.1.0 today), add the release to CHANGELOG.md
with what an upgrade from the previous one needs, commit, and push the matching tag (v2.0.0) on a
commit that passed the tests. Every stable server installs it at its next run; beta servers already run that commit.
The release workflow refuses a tag whose VERSION says otherwise, and so does the updater. To sign
releases, tag with git tag -s and an SSH key (gpg.format=ssh), sign the commits of main
too if beta servers check signatures, and put the allowed signers, in ssh-keygen's allowed-signers
format, in /etc/studio/update-signers on each server. What a release needs on the server goes in
installer/requirements.env, or in an upgrade script (installer/upgrades/README.md).


