Skip to content

How the install works

This page says what the install script does on your machine, in order, and what it keeps there. Install Mesopod is the procedure. Read this page when you want to know why a step behaves as it does.

The claim

The claim, mpc_…, is one-time and expires in 24 hours. Copy it from the console. Do not type it again by hand. A truncated paste fails with unknown claim.

The claim travels in an environment variable, not on the command line. Every user on the machine can read command lines while the install runs.

The command also names its cluster, with MESOPOD_CLUSTER=<your-slug>. The name is not secret. If the claim belongs to a different cluster, the platform refuses it and spends nothing.

Where it runs

On a Mac, the script creates a local k3d cluster and installs into it. The script asks nothing. A later run finds that cluster by its name, mesopod-<your-slug>. For a script, --k3d, or MESOPOD_INSTALL_MODE=k3d in the environment beside MESOPOD_CLAIM, says the same thing explicitly:

curl -fsSL https://console.mesopod.cloud/api/v1/install.sh | MESOPOD_CLUSTER=<your-slug> MESOPOD_CLAIM=mpc_… sh -s -- --k3d

Until 13 October 2026, the script also offered OrbStack's built-in Kubernetes. That mode is retired. The script refuses --orbstack and MESOPOD_INSTALL_MODE=orbstack by name, before it spends anything. If you have such an install, see If you installed on OrbStack's Kubernetes before.

On a Linux machine, the script installs k3s and installs into it. On a Windows PC, the same Linux script runs inside a WSL2 distro of its own. Install Mesopod on Windows (WSL2) says what the Windows installer sets up around it.

Your directories, from the command

The script asks no directory question. Before it spends anything, it checks the directories that the command carries and says which data directory it uses:

> data directory: /Users/you/Mesopod

After the exchange of the claim, the script says where the cluster's app data lands:

> apps keep their own data under /Users/you/Mesopod/volumes/daves-mbp, one folder per app, made when you deploy; nothing to set up there

Your directory answers travel with the command as --data-dir and --share. MESOPOD_SHARED_DIRS= clears any directory list that your shell already exports, so the directories in the command are the whole list.

The script registers every directory that you named at its real location. A symlink therefore registers the directory that it points to. Each registered directory shows under Use a shared directory when you deploy an app.

The script skips a directory that does not exist on the Mac, or that is not a directory. The cluster's page shows that directory as refused, with the reason. Create the directory. Then add it from the cluster's Storage section. The script makes nothing else for you.

If the Mac cannot use the data directory, the install stops before it spends anything. In k3d mode, a directory outside /Users and /Volumes is 1 example. The cluster's page shows why. Change the directory there. Copy the new command. Run it.

A cluster's data directory is fixed after its first install records it. A later command for the same cluster keeps that directory. This applies to a command that you generated again and to a new install. If the command named another directory, the script says so.

On a cluster that you already run, app data stays in the cluster's own storage. The volumes cell of the cluster's row on the Clusters page shows in the cluster's own storage. The script says so, and it still registers the directories that you name.

That path cannot move app data. So it refuses a cluster whose app data already lives under its data directory, that is, a k3d cluster or a Linux k3s install. The install stops before it spends the claim and says why. Run the command in the mode of that cluster's first install, or add a new cluster for this one.

A command with no directory flags takes ~/Mesopod and shares no directory, and the script says both. Such a command comes from a script, or from a console older than this page. A script can pass --data-dir and --share itself, or set MESOPOD_DATA_DIR and MESOPOD_SHARED_DIRS, with 1 directory per line.

The k3d cluster the script creates

This mode must have a Docker engine and k3d. The script installs either one when it is not there, before it exchanges your claim. See What the install puts on a Mac. A download that fails, a checksum or signature that does not match, or an engine that does not start stops the run. The claim stays unspent. Paste the same command again, and the script continues from there.

The script creates a cluster named mesopod-<your-slug> and publishes ports 80 and 443 from the cluster onto the Mac. LAN devices can then reach your apps at the Mac's address. Whether DNS points there is a separate question, outside the scope of this page. Only 1 cluster can hold those ports.

If something else already has them, usually a k3d cluster from an earlier install, the script says so before it spends your claim. It then asks whether to quit or to install without 80 and 443 published. That is how you run more than 1 k3d cluster on 1 Mac.

Without 80 and 443, other devices cannot open the web addresses of your apps. The console then shows Other devices can't open apps on this cluster. A later run of the install command can add 80 and 443 after they are free. See troubleshooting.md.

The ports that apps expose on your network are not part of that answer. The script publishes them from the cluster's claims on every run.

--no-port-publish is a different choice. It publishes nothing on the Mac: not 80 and 443, and not the exposed ports.

The script creates the cluster with your Mac's /Users and /Volumes mounted into the node at the same paths. A k3d node is a container. A Mac path exists inside the node only if it was mounted when the script created the cluster. The mounts let you register host directories later, without a change to the cluster. Examples are a Plex library under /Users/you/… or a drive under /Volumes/….

The mount is wide on purpose, and the roots are narrow. The node can see your whole home directory, but apps reach only the directories that you register as roots. The outpost cannot mount anything else.

The mount adds no reach that the node did not have. The node runs privileged, and the Docker VM already exposes the whole Mac filesystem to it. So anything at node level could read your disk with or without this mount.

On Linux, nothing is mounted, because the node is the machine itself. A cluster that an earlier version of this script created has no such mounts. A new run of the install command adds the mounts to the node in place. Nothing is recreated or restarted. This is tested on OrbStack. If every directory that you register fails with doesn't resolve on the server, see troubleshooting.md.

A new run is idempotent. The script reuses a mesopod-<your-slug> cluster that exists and does not recreate it.

The kubectl context is k3d-mesopod-<your-slug>.

Your data directory

What lands where, with the default answers:

Directory What it holds
~/Mesopod/volumes/<cluster-slug>/ 1 directory per app volume, named pvc-…_<app namespace>_pvc-…. The volume's page in the console names the exact directory. The install makes this directory only where it owns the cluster's storage setting, that is, k3d here and k3s on a Linux machine. On a cluster that you already run, the volumes cell of the cluster's row on the Clusters page shows in the cluster's own storage. App data in the cluster's Storage section shows the same. The install then does not make this directory.
Any directory that you named Registered at its real location, wherever it already is. The console lists it on the Volumes page, and the deploy form offers it under Use a shared directory.

To add a directory later, create it in Finder. Add it on the Volumes page as a Node Directory volume. Then run the install command again with no claim.

The script registers every directory on the list. The script writes k3s's storage setting so that new app volumes land in the directory above. On a Linux machine the setting is a config drop-in. On a Mac it is the same file inside the k3d node.

A new run reads the setting back. If something undid the setting, the script restores it and restarts the cluster node to do so. If the script cannot restore it, the script stops before it installs the outpost and says why. An earlier Mesopod install on the same machine can leave a setting behind. If the cluster keeps app data in its own storage, the script removes that setting instead.

On the cluster's page, Setup shows the data directory that you asked for and the directory that the cluster recorded. It also shows each directory that you named, with what the Mac made of it. Storage shows where app volumes land and the registered directories.

Register a host directory on Linux

On a machine that the script set up, the console shows the registration command for a host directory with sudo. The reason is the same as for the install: k3s keeps its kubeconfig readable by root only. The console fills in the cluster and every registered directory. Copy the command from the console. Then run it on the machine:

curl -fsSL https://console.mesopod.cloud/api/v1/register-roots.sh | sudo bash -s -- --cluster-id … --root …

If you run it without sudo, the script stops and prints the line to run again. If you installed onto a cluster that you already run, with your own kubeconfig, leave sudo out.

What the script actually does

In order, so that you know what you pasted:

  1. The script reads the machine's architecture. It accepts amd64 or arm64. Apple Silicon Macs report arm64. Any other architecture stops the script here, with a message.
  2. The script resolves the mode from a flag, an env var or the machine. In k3d mode, the script then makes sure that a Docker engine runs and that k3d is there. It installs either one when it is not there. None of that spends the claim. Then the script makes sure that kubectl is on PATH. A command with no claim then finds its cluster and the cluster's token. See Run the install again for one cluster. Then the script checks ports 80 and 443, and asks the port question if something holds them. Last, it checks the directories that the command carries: the data directory, and each directory to register.
  3. The script exchanges the claim and checks the Kubernetes version floor. The order depends on the mode, because each mode spends the claim only after the thing to check first exists:

    • k3d exchanges the claim. The response names the slug that the cluster is named after. Then the script creates the cluster, or reuses it. Then it checks the version floor, now that a cluster exists to check.
    • A cluster that you already run (--kube-context) gets the version floor check first. The script exchanges the claim after that check.

    In both modes, the script exchanges the claim before any step that can fail for reasons outside the script's control. The exchange carries your data directory, the directories to register and the cluster's name. The script keeps the token in the cluster's pending file, mode 0600, before any further step. See The pending token. The script then reads the cluster's record back: its data directory, where its app volumes land, and the directory list. It makes the cluster's storage setting match.

    This order matters. If a later step fails, the token waits in the pending file, and the cluster's command with no claim continues from there. See Run the install again. The version floor is Kubernetes 1.30, because the admission policies that cage the outpost must have it. The floor is not a problem on a Mac. k3d ships well above it. 4. The script downloads this cluster's manifests from the platform, authenticated with that token. 5. The cluster pulls the outpost image itself. The manifests name the public, digest-pinned ghcr.io/mesopod/outpost image. The script prints the cluster pulls the outpost image itself (…). No credential is necessary, because the image is public. Only when the platform has no release, the script downloads the image as a tarball. It loads the tarball into the cluster's container runtime. That is the local development case. For k3d, the fallback uses docker exec … ctr images import. 6. The script applies the manifests and registers the directories on the cluster after the manifests' CRD is established. Then it waits up to 3 minutes for the outpost to roll out. After that, it waits up to 3 minutes for the access gate. The access gate is a second small Deployment in mesopod-system. It handles sign-in to apps whose access is gated. On a failure, the script prints the pod state before it exits. See troubleshooting.md.

The outpost runs on your machine as an ordinary in-cluster Deployment, in namespace mesopod-system, with a small, caged Kubernetes identity. It is not a host daemon, and it never holds your cluster's admin credentials.

What the script does on Linux

The Mac install command does not use sudo. The Linux k3s path still must have root, and the script knows it. If you are not root, the script stops immediately and prints the exact line to run with sudo. The script already holds your claim and the cluster's name, so it can echo the full command back to you. The echo includes your directories and any other flag that you passed, quoted for the shell that you paste it into:

curl -fsSL https://console.mesopod.cloud/api/v1/install.sh | sudo MESOPOD_CLUSTER=<your-slug> MESOPOD_CLAIM=mpc_… MESOPOD_SHARED_DIRS= sh -s -- --data-dir '~/Mesopod' --share '/srv/media'

sudo prompts for your password on the terminal, not on the pipe, so the prompt appears as usual. Then, in order:

  1. The script reads the machine's architecture: amd64 or arm64.
  2. The script checks the data directory and the directories that the command carries. When you ran it with sudo, ~ is your own home, not root's. Then the script exchanges the claim for this cluster's token. It keeps the token in the cluster's pending file under /etc/mesopod/pending, mode 0600, before it touches anything else.
  3. The script writes k3s's storage setting, /etc/rancher/k3s/config.yaml.d/mesopod.yaml. The setting points new app volumes at <data dir>/volumes/<slug>. Then the script installs k3s from get.k3s.io, if k3s is not already there, pinned to the v1.33 channel. It waits for the node to be Ready. Apart from the outpost image, this is the only thing that the install fetches from outside Mesopod. Set MESOPOD_K3S_CHANNEL to pin a different line. The setting is cluster-wide. A workload that you add to this k3s yourself lands under volumes/<slug> also. A k3s that was on the machine before Mesopod keeps its own storage, and app data stays there. A k3s that an earlier Mesopod install put here carries Mesopod's storage setting. When you add a cluster again on it, the script points the setting at the new cluster's volumes/<slug>. When the path changes, the script rewrites it and restarts k3s once. That takes approximately 10 seconds, and apps that run continue to run. If a cluster's record keeps no storage directory, but an earlier install's setting is still there, the script removes it. It restarts k3s only when that setting was the one in effect.
  4. The script checks the Kubernetes version. Below 1.30, it stops. The admission policies that cage the outpost must have 1.30. With a k3s already on the machine, this check runs first, before the exchange. A machine below the floor then spends no claim. A k3s that this run installs can be checked only after it is up.
  5. The script downloads this cluster's manifests, authenticated with that token.
  6. The cluster pulls the outpost image itself. The manifests name the public, digest-pinned ghcr.io/mesopod/outpost image, and the script prints the cluster pulls the outpost image itself (…). No credential is necessary, because the image is public. The script downloads the image as a tarball only when the platform has no release. That is the local development case. It then loads the tarball with k3s ctr images import.
  7. The script applies the manifests and registers the directories on the cluster. Then it waits up to 3 minutes for the outpost to roll out. After that, it waits up to 3 minutes for the access gate. The access gate is a second small Deployment in mesopod-system that handles sign-in to apps whose access is gated.

A new run with no claim reads the token from the cluster's own Secret, through k3s kubectl. A Linux machine runs 1 cluster. If the command names a different cluster, the script stops before it changes anything, and names both clusters. See Run the install again for one cluster.

State on your Mac

The install keeps no lasting copy of the outpost token. The token lives in the cluster, in the Secret mesopod-outpost-bridge in namespace mesopod-system. Under your home directory, unprivileged, the install keeps these files:

File What it holds
$HOME/.mesopod/pending/<console host>/<your-slug>, mode 0600 The outpost token of 1 cluster, only during its install. The script writes the file after the claim exchange and deletes it after the apply. See The pending token.
$HOME/.mesopod/bin/k3d The k3d that the install downloaded, when there was none on your PATH.
$HOME/.mesopod/OrbStack.dmg The finished OrbStack download. The script keeps it until OrbStack is installed and checked. A later run uses it instead of a new download.
$HOME/.mesopod/OrbStack.dmg.part Only while an OrbStack download is unfinished. The next run resumes it. The script deletes it after OrbStack is installed.

Your data directory and the location of app volumes are not kept here. The cluster records them at its first install, and every run reads them back. An earlier version of the script kept outpost-token, cluster-slug and install-mode here. See An install from an earlier version of the script. An older version also left data-dir and volumes-path. Nothing reads them now.

On a Linux machine with k3s, the pending file is under /etc/mesopod instead. The k3s path runs as root already.

Run the install again for one cluster

Every command that the console gives names its cluster, with MESOPOD_CLUSTER=<your-slug>. The first command carries the name beside the claim. The command to run the install again carries the name alone:

curl -fsSL https://console.mesopod.cloud/api/v1/install.sh | MESOPOD_CLUSTER=<your-slug> sh

Run the install again has the command for Linux and for Windows. A saved script takes the name as --cluster <your-slug>. If the flag and the variable name different clusters, the script stops.

With no claim, the script does the rest of the install again: the manifests, the image, the apply and the directory list. It reads the cluster's data directory back from the platform. It registers the current directory list again. That is how a directory that you added in the console reaches the machine.

Where the token comes from

With no claim, the script first finds the named cluster on this machine:

  • On a Mac, the cluster is the k3d cluster mesopod-<your-slug>. If the cluster is stopped, the script starts it. A Linux machine where you installed with --k3d is the same.
  • On a Linux machine or a Windows PC, the cluster is the machine's 1 k3s.
  • On a cluster that you already run, the cluster is the context that --kube-context names.

The script then reads the outpost token from the cluster's own Secret, mesopod-outpost-bridge in mesopod-system. The platform says which cluster the token belongs to. If that is not the cluster that the command names, the script stops before it applies anything, and names both:

x install: this machine's cluster holds the token for Mesopod cluster 'lab', but this command is for 'home'. Run it on the machine that hosts 'home'.

That is the message for a command on the wrong machine. On a Mac, a command for a cluster that the Mac does not have stops earlier. Its message names the Mesopod clusters that the Mac has.

If the console does not accept the token, the script stops and names the console. For a cluster that you did not remove, generate a new install command on its page. A cluster that you removed in the console leaves its k3d cluster and a dead token on the Mac.

Caution: Delete the k3d cluster only if you removed that cluster in the console that the message names. A cluster of another Mesopod can have the same name.

Delete the leftover k3d cluster. If you installed k3d yourself, use k3d from your PATH:

~/.mesopod/bin/k3d cluster delete mesopod-<your-slug>

A command with a claim asks no question about earlier installs. If this Mac already runs the cluster that the command names, the script reuses that k3d cluster.

The pending token

The claim exchange comes before the slowest steps of the install: the k3d cluster, k3s and the outpost image. From the exchange until the apply, the script keeps the token in 1 file for that cluster, mode 0600:

  • ~/.mesopod/pending/<console host>/<your-slug> on a Mac, for k3d on Linux, and for a cluster that you already run.
  • /etc/mesopod/pending/<console host>/<your-slug> on a Linux machine with k3s, and inside the Windows distro.

The console host is part of the path, for example console.mesopod.cloud, because 1 Mac can install against more than 1 Mesopod. The script deletes the file after kubectl apply succeeds. From then on, the cluster's Secret holds the token. 2 clusters on 1 Mac each get their own file, and neither touches the other.

If a step after the exchange fails, the claim is spent. Do not paste the first command again. The failure message ends with the cluster's command with no claim:

x install: kubectl apply failed — output above; once that is fixed, run this cluster's re-run line:
  curl -fsSL https://console.mesopod.cloud/api/v1/install.sh | MESOPOD_CLUSTER=basement-nuc sh

Correct the problem. Then run that line. The run uses the pending token, and it deletes the file after its apply. If the console refuses a pending token, the token is dead, and the script deletes the file. If you run the first command again instead, the script stops with HTTP 410 and prints the same line.

A command with no cluster name

A command from an older console, or a command that you typed, can carry no cluster name. The script then looks for the Mesopod clusters on this machine. It counts a cluster only if this console accepts its token:

  • 1 cluster: the script installs it again and says so: > re-running cluster 'basement-nuc' (the only Mesopod cluster on this machine).
  • More than 1, on a terminal: the script asks which one:

    This machine runs 2 Mesopod clusters:
      1) home
      2) lab
    Which one should this run re-install? [1-2]:
  • More than 1, with no terminal: the script stops and prints the command for each cluster. Run the command for the cluster that you mean.
  • None: the script stops and says to run the install command from the cluster's page.

The script names each cluster that it did not count, on a line that starts with not counted:. A cluster of another Mesopod and a cluster that you removed are 2 examples. The script does not start a stopped k3d cluster for this search. Its line shows the command that starts that cluster and installs it again.

A lasting copy of the token

--token-file PATH keeps a lasting copy of the token at PATH. The flag is for development and test setups, and the console's commands do not carry it. With a claim, the run writes the token to that file. With no claim, the run reads that file first. If the file is missing, the run reads the cluster's Secret and writes that token to the file. A run with the flag writes no pending file.

--fresh-state and MESOPOD_FRESH_STATE=1 do nothing now. The script accepts them and says --fresh-state is no longer needed: install state is kept per cluster.

An install from an earlier version of the script

An earlier version of the install script kept 3 files: outpost-token, cluster-slug and install-mode. They are in ~/.mesopod, or in /etc/mesopod on a Linux machine with k3s and inside the Windows distro. The files name the cluster that the machine installed last:

  • A run for that cluster uses the token in outpost-token. After its apply, the run deletes the 3 files. It also deletes data-dir and volumes-path if an older version left them.
  • A run for another cluster leaves the files alone. It reads the token from that cluster's Secret.

On a Mac with 2 clusters, the old files name 1 cluster only. The other cluster still has its token in its own Secret. Its command from the console works with no new claim.

An install-mode file that says orbstack stops a run with no claim that names no cluster, or that names the cluster in cluster-slug. See If you installed on OrbStack's Kubernetes before.

A cluster that you already run

If you installed onto a cluster that you already run, run the saved script again with the cluster's name. Use the same flags as the first time: --skip-k3s and --kube-context. The console's command cannot carry those flags. See Install onto a cluster that you already run.

Windows

On Windows, 1 PC runs 1 cluster. The command to run the install again clears $env:MESOPOD_CLAIM first, because the window of the first command still holds the spent claim. Then it sets $env:MESOPOD_CLUSTER, and the installer passes the name into the distro. Inside the distro, the run reads the token from the cluster's Secret. A command for a different cluster stops and names both. For a clean start, run -Uninstall, as Remove Mesopod describes.

Flags

To pass flags, save the script first, instead of a pipe:

curl -fsSL https://console.mesopod.cloud/api/v1/install.sh -o install.sh
chmod +x install.sh
MESOPOD_CLUSTER=<your-slug> MESOPOD_CLAIM=mpc_… ./install.sh --k3d

All flags, optional:

Flag What it does
--claim mpc_… The same as MESOPOD_CLAIM. Convenient for scripts, but visible in ps.
--cluster SLUG The cluster that this run is for. The same as MESOPOD_CLUSTER, which every command from the console sets.
--base https://… Overrides the console origin that the script talks to.
--k3d Runs Mesopod on a local k3d cluster that this script creates. This is the Mac default. The flag says so explicitly.
--skip-k3s On Linux, does not install or expect k3s. It is irrelevant on macOS, where k3s does not run. The install leaves the cluster's storage alone, so it refuses a cluster whose app data already lives under a data directory.
--skip-image Does not download or load the image, because it is already present. This applies only to the tarball fallback.
--no-port-publish k3d: publishes nothing from the cluster node onto this machine. Not ports 80 and 443, and not the ports that apps expose. Apps answer only at the node's own address. Other devices then cannot open the web addresses of your apps. The console shows this choice as a muted line. MESOPOD_INSTALL_PUBLISH_PORTS=0 does the same. To share a machine whose 80 and 443 are taken, answer the port question instead. That keeps the exposed ports.
--publish-web k3d: on a run again of a cluster that was made without ports 80 and 443, publishes them without a question if they are free. If the command also has --no-port-publish, the run ignores this flag.
--web-port N Serves apps on port N instead of 443. N is 443, 4443, 8443 or 9443. The same as MESOPOD_WEB_PORT. App addresses then end in :N, and the install publishes nothing on port 80. With a piped command, the flag goes after sh -s --. It does not work on Windows (WSL2) yet. See Serve apps on another web port.
--kube-context CTX Uses kubectl --context CTX instead of the mode's own cluster and context. On Linux, pass --skip-k3s with it.
--import-cmd CMD Feeds the image tarball to your own import command on stdin. This applies only to the tarball fallback.
--token-file PATH Keeps a lasting copy of the outpost token at PATH, for development and test setups. A run with the flag writes no pending file. See A lasting copy of the token.
--data-dir PATH Where this machine keeps its Mesopod directories. The default is ~/Mesopod. A cluster keeps the directory that its first install recorded.
--share PATH A directory that apps can reach. You can repeat the flag. The script registers the directory when the command carries a claim.
--fresh-state Does nothing now. The script accepts it, and MESOPOD_FRESH_STATE=1, so that older saved commands still run.
--print-k3d-mounts-hook Prints the script that gives a k3d node the Mac's /Users and /Volumes, then exits. That is the script that a new run installs on a node that exists.
--help, -h Prints this flag list on the machine and exits.

If you installed on OrbStack's Kubernetes before

An install made in the retired OrbStack mode continues to run, and the console continues to manage it, until you remove the cluster there. Nothing on that Mac can resume it or run it again. A new run of the install command says so and stops. The console refuses to reissue or edit that cluster's install command, because a run would put a k3d replacement under the old record.

To move to k3d, add a new cluster in the console. Then paste its command on the Mac. The command names the new cluster, so the old files do not stop it. App data does not move with it. Deploy the apps again on the new cluster. Remove Mesopod from a cluster that you already run describes the removal of the old cluster.

The old files stay on the Mac until you delete them. While they are there, a command with no cluster name stops with the OrbStack message. Remove Mesopod shows the command that deletes them.

A non-production Mesopod

The guides write the production names throughout. If you test against a non-production Mesopod, take the origin from your own install command, for example console.staging.mesopod.cloud. Substitute it everywhere. Substitute the apps domain also. On staging it is staging.mesopod-internal.app, not mesopod.app, so the rebind exception and the dig checks use that name instead.