Updates

Studio keeps itself up to date. studio-update, run by root, installs every new build of its channel together with what it needs on the server: a new PHP, a newer Node, a package, a git host's CLI, a changed service. The stable channel follows the release tags; beta testers follow the main branch.

Administration → System: installed and newest release, Check now, Force update and Update buttons, the nightly switch, the channel, the last update with its log, the server's update and its PHP versions: 8.5 the default, 8.4 installed, 8.3 with Install
Administration → System. The installed build and the newest one, Check now, Force update and Update to, the nightly switch, the channel, the last run with its log, the server's own update and its PHP versions. While an update runs the page follows it live, through the maintenance of the switch, and reloads onto the new release when it is done.

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#

ChannelInstallsFor
Stable (default)The newest release tag, vMAJOR.MINOR.PATCH; pre-releases and everything between two releases are skippedEvery team
Beta (beta tester mode)The head of the main branch, every new commit, before it becomes a releaseA 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.

Administration → System in beta tester mode: the newest commit on main, the beta channel selected and its warning
Beta tester mode. The newest commit on 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 what studio-update rollback is for.
  • On the server: sudo studio-update apply (--force for the same as the button). Running the installer again does the same as apply.

What an update does#

  1. Clone the build into /opt/studio/releases/<build>. A tag's VERSION file must say the same as the tag. With /etc/studio/update-signers in place, the tag (or, on beta, the commit) must carry a valid SSH signature by one of those keys.
  2. System step, as root, from the new build: its installer/requirements.env names the PHP versions, the PHP that runs Studio and the Node major; installer/lib/system.sh installs 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.
  3. Upgrade scripts, phase before: installer/upgrades/<version>.sh of 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.
  4. Build next to the running release, on the shared .env and storage: Composer without dev dependencies, the assets.
  5. 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.
  6. Switch: the new build's helper, templates, services, PHP-FPM pool and Caddyfile, then /opt/studio/current points at it; upgrade scripts, phase after; caches, restarts, maintenance off.
  7. 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), gh or az. Configuration files changed by hand are kept.
  • Outside apt: Composer (self-update), Claude Code (npm, @latest), glab (its newest release), the azure-devops extension, through the system step of the installed release, which also installs what that release names and is missing.
  • Services: needrestart restarts 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 certificates runs the check alone.
  • Reboot: a new kernel shows reboot required on the System page. With SYSTEM_REBOOT=1 in /etc/studio/studio.env the 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.

On the server, as root
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 · certificates

Domain & 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:

On the server, as root
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 served

Changing 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.

Administration → Domains: a verified domain with a project's public address, public, one waiting for its DNS
Administration → Domains. The records to create, what the DNS answered, the projects at each domain, public or not.

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:

On the server, as root
studio-recover admin # the main administrator: the oldest admin account
studio-recover admin you@agency.test # that account instead; unknown = created

The 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).