Skip to content

Managed instances

This page is for hosters who rent out machines with Envoryx on them, and for their customers who want to know why some things look different on their instance. If you run Envoryx for yourself, none of it applies: without a plan and without a fleet manager, Envoryx behaves exactly as it always did.

A plan only binds someone who can’t change it. So the idea is a managed machine: the customer gets Envoryx (the web UI, SSH into the project containers, SFTP, the API), but no shell on the machine and no access to the Docker socket.

A plan is the file /config/plan.json. It says how many projects and active users an instance may have, how much disk space in GiB its projects may take (directories, volumes and backups), which runtimes new projects may use, which features are switched off (addons, customImages, branchEnvironments, externalServices, offsite, ideGateway, eolVersions, previewVersions, publicProjects, publicShares) and which instance settings the hoster fixes, such as the base domain.

{
"name": "Starter",
"limits": {
"projects": 5, "users": 3, "diskGb": 50, "runningProjects": 3,
"container": { "cpus": 2, "memoryMb": 1024 },
"containerDefault": { "memoryMb": 512 }
},
"runtimes": ["php", "node"],
"services": ["mariadb", "redis", "mailpit"],
"disabled": ["customImages", "ideGateway"],
"settings": { "baseDomain": "c1042.example.net", "forceHttps": true }
}

Envoryx checks the file every 30 seconds. A plan only limits what comes next: a smaller plan doesn’t delete a project, it just refuses the next one. The refusal comes back with a clear message (HTTP 403, code plan_limit), and the UI hides what the plan leaves out: the Runtime tab of a project offers only the runtimes in the plan (plus those the project already has), and at the project or user limit New project and Invite user are disabled with a hint. The customer finds the plan and how much of it is used under Settings → General; fixed settings show a lock. All fields are listed in DEPLOYMENT.md, Plans.

On a small machine, memory is what runs out first, and that’s what three parts of the plan are for. services is an allowlist of the services and database engines projects may add (mariadb, mysql, postgresql, mongodb, redis, memcached, rabbitmq, meilisearch, typesense, opensearch, ollama, mailpit, storage), and without it everything is allowed. On a 2 GB machine, ["mariadb", "redis", "mailpit"] as in the example keeps Ollama and OpenSearch out, and nobody downloads a language model onto it. Don’t write the two you want to keep out: ["ollama", "opensearch"] allows exactly those and no database. The wizard and the Services tab then only offer what’s in the list, and a project that has a service already keeps it. runningProjects caps how many projects run at the same time: starting one more is refused until another one stops. container caps CPU cores and memory of every project container, and containerDefault is what a container gets when its project sets no limit. The customer can go lower under Resource limits, never higher, and a changed plan reaches the running containers within a minute, without a restart.

eolVersions and previewVersions keep customers off versions that no longer get security fixes (PHP 8.1) and off release candidates. With them switched off, no new project, copy or version switch gets such a version, and the version lists show it as not in your plan. A project that runs one already keeps running, with a warning, until the customer moves it to a supported version.

ideGateway switches off all port forwarding over SSH, so also the tunnels to the project’s services.

publicProjects and publicShares are about who reaches the projects. Without publicProjects every project only lets in people signed in to Envoryx (or with a guest link), whatever its rules say. Without publicShares nobody can put a project on a public share address, and a share that’s running is no longer routed. If you only want new projects to start behind the sign-in and let the customer open a single project again, fix newProjectsPrivate under settings instead. Instances before 0.43 don’t know these names: they refuse a plan that switches off one of the two or fixes newProjectsPrivate and keep their old plan. The fleet manager (0.5.0) leaves them out for such instances; a hand-written plan.json needs the update first. The same goes for services, runningProjects, container, containerDefault and the settings twoFactorRequired, logHistory and imageUpdates before 0.44 (fleet manager 0.6.0).

Besides the base domain and HTTPS, the settings a plan can fix include who has to set up a second factor (twoFactorRequired: off, admins or all), the log history (logHistory, with enabled, retentionDays and maxMb) and the daily restart for newer images (imageUpdates, with autoRestart and hour).

If SSH comes in at another address than the web interface, say your own entry ssh.customer.example.net in front of the node the instance runs on, or a forwarded port, the IDE section would otherwise name the address in the customer’s browser. Fix sshHost and sshPort in the plan, or set ENVORYX_SSH_PUBLIC_HOST and ENVORYX_SSH_PUBLIC_PORT on the instance when the address differs per customer. The remote interpreter rows, the ssh and tunnel commands and the Gateway steps then use it. This needs Envoryx 0.46.5 (fleet manager 0.6.5, which leaves the two out for older instances).

The Plan card under Settings, General: plan Starter, managed by the hoster as Customer 1042 and connected, 3 of 5 projects, 2 of 3 running projects, 2 of 3 users, 7.3 GB of 50 GB disk space, the runtimes PHP and Node.js, the services MariaDB, Redis and Mailpit, at most 2 cores and 1 GiB per container with 512 MiB by default, custom images and the IDE gateway not included, base domain and HTTPS fixedThe Plan card under Settings, General: plan Starter, managed by the hoster as Customer 1042 and connected, 3 of 5 projects, 2 of 3 running projects, 2 of 3 users, 7.3 GB of 50 GB disk space, the runtimes PHP and Node.js, the services MariaDB, Redis and Mailpit, at most 2 cores and 1 GiB per container with 512 MiB by default, custom images and the IDE gateway not included, base domain and HTTPS fixed

Writing plan.json onto every machine by hand gets old quickly. The fleet manager is a separate service where you keep the plans and the instances in one place. You add an instance there and get a one-time token; the instance starts with

Terminal window
ENVORYX_FLEET_URL=https://fleet.example.net
ENVORYX_FLEET_TOKEN=…

and enrolls on its first start with a key of its own (kept in /config/fleet.json, never in an instance backup). From then on it keeps a connection to the manager open. It dials out, so the customer’s machine needs no open port. The manager pushes the plan, and the instance reports its version, projects, users, disk space and backups every minute.

On the instance the customer sees Managed by your hoster under Settings → General.

If you removed an instance from the manager and want it back, add it again to get a new token, set that as ENVORYX_FLEET_TOKEN on the instance and restart it. A token it hasn’t enrolled with before makes it enroll again, so there’s no need to delete /config/fleet.json.

The manager’s address has to start with https://: the instance trusts the manager because of its certificate. Plain http:// is only taken for the same machine, or with ENVORYX_FLEET_INSECURE=1 for a test setup, which the instance logs as a warning at every start.

Your billing system drives the manager with API tokens of its own (Settings → API tokens in the manager). Each has a scope: read only reads, operate also suspends, resumes, backs up and updates instances, admin also adds, changes and deletes them. Give a monitoring script read and only the billing admin. The manager keeps the plans, with their offsite credentials, and the webhooks’ secrets encrypted in its database; the key is FLEET_SECRET_KEY or the secret.key it creates in its data directory. Back the key up apart from the database: without it the manager can’t read its plans and doesn’t start.

An instance with a plan or a fleet manager is assumed to be on the internet, so two defaults are different there. The projects’ host ports listen on 127.0.0.1 only (ENVORYX_HOST_PORTS=local), and new projects start behind the Envoryx sign-in (Settings → Domains & HTTPS → Who sees new projects). The projects stay reachable through the proxy by their host names. Customers reach databases and debug ports through an SSH tunnel, and the services’ web interfaces through their proxy addresses. On a server on the internet explains all of it from the customer’s side.

If your machines have a firewall of their own and your customers want the ports open, set ENVORYX_HOST_PORTS=all on the instance. Projects that were running when the binding changed keep the old one until they’re restarted.

When an invoice stays open, you can suspend the instance from the manager, with a message for the customer if you like. The instance then stops all projects (as if the customer had stopped them), refuses everything else and shows signed-in users only a page with your message and a sign-out button. The API, MCP, SSH and SFTP refuse too. Nothing is deleted.

The page a suspended instance shows after signing in: This instance is suspended, the hoster's message about an open invoice, a note that the projects are stopped and the data kept, the time of the suspension and a Sign out buttonThe page a suspended instance shows after signing in: This instance is suspended, the hoster's message about an open invoice, a note that the projects are stopped and the data kept, the time of the suspension and a Sign out button

Lifting the suspension opens the instance again, but starts no project: the customer decides what runs. A suspended instance comes back suspended after a restart, and it stays suspended when you remove it from the fleet, so lift it first if the customer should keep using it.

Sometimes you need to look at a customer’s instance to help. Envoryx only lets you in when the customer’s admins allow it, under Settings → General → Support access: for an hour, a day, a week or until they take it back. While it’s allowed, the manager offers Support login, which opens the instance in a new window, signed in as the user “Hoster support”.

That user is an admin, but it doesn’t count towards the plan’s users, isn’t listed and can’t sign in with a password. It can’t create API tokens, store SSH keys or extend its own access. It also keeps away from everything that decides who gets in: it can’t invite, change or delete users, change their project roles, create invitation or password links, touch single sign-on or the instance’s SSH keys, and it can’t restore an instance backup, which would bring back that backup’s accounts and tokens, or reveal or rotate the secret key, with which the secrets in the backups you get could be read after the consent ends. Nor can it install or change addons, set custom images or registry logins (also not through a manifest or by restoring a backup into a new project that brings one), add, change or remove an offsite target (one of its own would keep getting the backups after the consent ends), shorten the audit log’s retention or clear or switch off the log history. Those parts show up read-only for it. When the customer takes the consent back, your session ends at once.

What the support does inside projects stays, like any admin’s work: workers, cron jobs, actions, files and new projects keep running after the consent ends. Everything it does is in the audit log under the user “Hoster support”, and each support login names the hoster’s user who asked for it, so the customer can filter for it and see what changed.

The Support access card, marked allowed: the hoster's support may sign in until the given time, with a Take back buttonThe Support access card, marked allowed: the hoster's support may sign in until the given time, with a Take back button

If every customer gets a domain of their own below yours, say kunde.example.net, each instance needs a wildcard certificate for it. Letting every instance get its own would mean handing each customer’s machine a DNS token for your whole zone, and whoever has root there could change the records of all your other customers. So the manager gets them for you instead (Envoryx 0.42 or newer on the instance).

Under Settings → Certificates in the manager you set up your DNS account once: the same providers Envoryx offers for its own Let’s Encrypt certificate, plus a contact e-mail. Then give an instance its domain, when you add it or on its page. The manager obtains kunde.example.net and *.kunde.example.net, renews the certificate 30 days before it runs out and sends it to the instance, which serves it right away and takes the domain as its fixed base domain. Its projects are then at shop.kunde.example.net, its web UI at envoryx.kunde.example.net. The DNS records that point the domain and *.kunde.example.net at the instance are yours to create; the manager only touches the _acme-challenge records.

The customer sees the certificate under Settings → Domains & HTTPS as Certificate from your hoster and can’t set up Let’s Encrypt or an own certificate meanwhile. On the instance’s page in the manager you see until when it’s valid, whether the instance serves it and why the last attempt failed, with Renew now. A failed attempt is retried every hour, and the webhook event instance.certificate_failed tells your billing about it. Remove the domain and the certificate goes with it; the instance then gets its certificates itself again.

Let’s Encrypt issues at most 50 new certificates per week for one registered domain (renewals don’t count). If you add more instances than that under one domain, spread them out or ask Let’s Encrypt for a higher limit.

A plan can name an offsite target of yours (S3, SFTP or WebDAV, with the same fields as the offsite targets on an instance). Every instance with the plan then copies its daily instance backup there, into a folder of its own (<prefix>/<instance ID>), and with projects also its scheduled project backups. Turn on encryption, so the copies are sealed before they leave the machine.

The customer sees the target under Settings → Backups marked from your hoster and can fetch copies from it after losing the machine, but can’t change or delete it. It keeps working when the plan switches the customer’s own offsite targets off: backups still go up, and copies can still be fetched from it.

In the manager you can take an instance backup right away, and you see the newest ten with the ones that reached your target. An instance whose last backup is older than two days is marked as needing attention.

The manager can update one instance, or every instance that runs an older version, to a newer release. An instance only takes a release newer than the one it runs, so it can’t be moved back to an older version from the manager. The instance pulls the image of that version and starts a short helper container, which replaces the Envoryx container with a new one with the same settings and waits for its health check. If the new version doesn’t come up, the helper brings the old container back, and if the new version had already changed the database, the old one restores it from the backup taken right before. The project containers keep running; only their addresses are unreachable for the few seconds the swap takes, because the proxy is part of Envoryx.

Before the swap, the instance checks where the new image comes from: GitHub has to hold a signed build attestation for exactly that image, made by Envoryx’s release workflow for exactly that version. An image without one is refused, and the manager shows why. So neither the hoster nor someone who got into the registry can slip in an image of their own. The check needs api.github.com and tuf-repo-cdn.sigstore.dev; an instance without internet access, or one that runs its own builds, sets ENVORYX_UPDATE_UNVERIFIED=1 and takes the image unchecked, with a warning in the log.

How the last update went shows in the manager and in the instance’s audit log. A failed update is reported right away, also when the new image is so broken that the helper can’t even run. While an update is under way, the manager refuses to start a second one for the same instance.

Updating from the manager needs Envoryx to run in a container it can find; on Unraid, use Unraid’s own update instead, so the template stays in step.