Prerequisites
- A machine on your network that can reach your private services
- A the Morph Platform account with an active project
- Outbound HTTPS from that machine (see Network access). No inbound ports are required.
- A supported operating system
Supported operating systems
Windows on ARM is not supported. The installer detects it and stops before making any changes.
Install each daemon on an operating system matching its pool’s platform. A pool only routes work to machines that match.
In the Morph Platform‘s platform vocabulary, macOS belongs to the Linux family, because what the platform choice really decides is whether generated commands are written for a POSIX shell or for PowerShell. A macOS machine joins a Linux pool.
Network access
All connections are outbound and initiated by the daemon. More than the daemon needs network access, and they do not all talk to the same place. Your exact hostnames are shown in the daemon’sconfig.toml and in the install command the UI generates — read them from there rather than assuming:
Outbound proxy
If the machine reaches the internet through an explicit proxy, give the daemon that proxy in its own configuration. A daemon running as a service does not see theHTTPS_PROXY set in your shell, so setting it there is not enough.
mcode config set no_proxy replaces the whole list, so to add a host later, run mcode config show first and keep the hosts it lists. Hosts in a NO_PROXY the daemon’s service already inherits stay off the proxy too.
Then restart the daemon (see Changing the daemon’s settings). The daemon, including the connection it receives new work on, and every job it runs use that proxy. If the daemon is online but no step ever starts, your proxy may not keep that long-lived connection open; if the machine can reach your job_server_url host directly, add it to no_proxy. The daemon always keeps localhost, 127.0.0.1 and ::1 off the proxy, so your application’s own local traffic never goes through it.
Installing
Run the command the UI generates for you — it already contains your API key, your pool name, and the right download for the machine’s platform. Two names are involved, and they are not the same thing:
Two related behaviors worth knowing:
- A
POOL_NAMEset in the daemon’s environment overrides the value inconfig.tomlevery time it starts, so the file can disagree with reality. Runmcode config showto see the pool actually in effect. - Re-running the installer without
POOL_NAMEdoes not clear the existing pool. “Reinstall to fix it” quietly keeps the old one.
Verifying the install
PATH is picked up.
Running as a service
The steps below install and run the ModelDaemon service so the daemon starts again after a reboot. On Windows, installing the service needs Administrator access: use an elevated (Run as administrator) PowerShell session.mcode run in the foreground instead. The terminal must stay open, and sleep or hibernation interrupts it.
Which user the daemon runs as
- macOS: installs a launch agent for the user who installed the daemon, which restarts on failure. It starts when that user logs in and stops when they log out, so after a reboot the daemon stays offline until they log in.
- Linux: installs a user-level service for the user who installed the daemon.
mcode install-servicealso turns on lingering for that user, so the daemon keeps running after they log out and starts at boot. If that step fails, it prints the command to ask an administrator to run (sudo loginctl enable-linger <user>). If the machine has no user login session, which is common in containers, it falls back to a simpler supervision mode with no automatic restart. - Windows: installs a Windows service named ModelDaemon. The service itself always runs as
LocalSystem, and starts jobs as the user you choose when you install it (see below).
Windows: choosing the user jobs run as
mcode install-service asks which user the service should run jobs as. Choose your own user (the default) so jobs use your profile: %USERPROFILE%\.npmrc, .gitconfig, pip config and your certificate store. You can only choose the user signed in to Windows, and only if the daemon is installed in that user’s profile (the default location); otherwise LocalSystem is the only choice. To script the install, pass --current-user or --local-system instead of answering the prompt.
When installed for a user, the daemon only runs jobs while that user is signed in (a locked screen or a disconnected RDP session counts as signed in). It stops at sign-out and starts again at the next sign-in. Choose LocalSystem if the daemon must run while nobody is signed in; jobs then do not see your user profile. When you switch from LocalSystem to your user, the environments LocalSystem built are deleted, so the next job on each project takes longer while it rebuilds them.
Upgrading an existing Windows install:
mcode update keeps the service as it is, so a daemon installed before this option existed keeps running jobs as LocalSystem. To run jobs as your user, run mcode install-service again from an elevated PowerShell. Do the same if you changed the logon account with sc.exe before: it resets the logon account to LocalSystem. If the host must run jobs with nobody signed in, stay on LocalSystem and put your .npmrc, .gitconfig and pip config in LocalSystem’s profile folder, C:\Windows\System32\config\systemprofile.mcode start and once the daemon has registered, it logs a line like Running as user: name=DOMAIN\jdoe ... home=C:\Users\jdoe. If it shows NT AUTHORITY\SYSTEM, jobs run without your user profile; run mcode install-service again and choose your user. To find the latest such line:
Logs
Service logs are written tologs/build_agent.log next to the daemon binary. mcode logs follows that file.
So that logs don’t fill the disk, the daemon starts a new file when build_agent.log reaches 50 MB, and keeps the 5 most recent files, the current one included. To change those limits, add these lines at the top of config.toml, before any [section] line, then restart the daemon. mcode config edit opens the file; mcode config set doesn’t take these keys.
logs/crash.log.
On macOS, and on Linux without systemd, the service also writes stdout.log and stderr.log in the same folder. The daemon trims them, and crash.log, at each start: the most recent 50 MB (or your log_max_size_mb) is kept in a .1 copy and the rest is deleted.
Changing the daemon’s settings
Change a setting withmcode config set, and remove it again with mcode config unset. Both edit config.toml and leave the rest of the file as it is:
mcode run, stop it and run it again instead.
A value that is not valid for its key, such as a proxy that is not a URL, is refused and the file is left unchanged.
Corporate certificates and TLS-inspecting proxies
If your network terminates and re-signs TLS with an internal certificate authority, the daemon needs to trust it. Two settings in the daemon’sconfig.toml cover this:
There is a platform difference that matters:
- On Linux, the host trust store is complete, so the daemon configures the tooling automatically and merges any bundle you supply.
- On Windows and macOS, the tools cannot rely on the host trust store. To cover pip, git, curl, Python and Rust you must supply a complete bundle and set
ca_cert_bundle_completetotrue.
-
Get your proxy’s root certificate as a
.pemfile from your IT team, and save it on the daemon’s machine. If some of that machine’s traffic does not go through the proxy, ask for a.pemthat also includes the public root certificates. -
Run this on the daemon’s machine:
- Restart the daemon.
Certificate authorities that browsers no longer trust
Browsers have stopped trusting eMudhra’s emSign G3 roots and the authorities issued under them. The daemon’s own connections reject sites that rely on them. The CA bundle the daemon gives to the tools jobs run (npm, pip, git, curl and the AI agent) also leaves them out, even if they are in the machine’s trust store or yourca_cert_bundle. The daemon logs a warning for each one it leaves out.
Which tools use that bundle depends on the OS:
- Linux: every tool.
- Windows: every tool when your
ca_cert_bundleis a complete bundle; otherwise only Node. - macOS: every tool when you set
ca_cert_bundle; otherwise none.
ca_cert_bundle.
Registry mirrors
When installing its base dependencies, the daemon uses public registries:
Many enterprise deployments cannot use those defaults — an air-gapped network with no public route, or a policy requiring all third-party artifacts to come from an approved internal registry.
Before running MD, please verify that user has access to the registries.
[registries] table to config.toml. Your registry must be a full mirror of the public one, since the Morph Platform chooses which packages the base environment installs.
Registry overrides apply only to npm and pip during base dependency setup. They do not affect how your own application’s dependencies are fetched.
npm or pip use — .npmrc, pip.conf, or a network policy that allows the daemon’s subnet through. 401 errors may occur if ModelDaemon is running as LocalSystem, while your engineer has registry settings in their user-level .npmrc. Please see the above section on Running as a service to install it for the engineer’s user instead.
pixi channel mirrors
The isolated toolchain is installed with pixi from two channels:conda-forge (from conda.anaconda.org) and github-releases (from prefix.dev). If the machine cannot reach them, point the daemon’s pixi at a full mirror of each channel, then restart the daemon:
[proxy-config] already set in that user’s own pixi configuration (for example ~/.pixi/config.toml) is also respected; one set with mcode config set wins over it.
Keeping the daemon up to date
Runmcode update on the host. It downloads the current version, verifies it, replaces the binary, and restarts the service. There is no automatic update.
mcode update --check reports whether an update is available or required, without installing anything.
The Morph Platform enforces a minimum version. If every machine in a pool is below it, work stops with a message naming the pool and telling you to run mcode update. A single out-of-date machine is quietly skipped instead — so if one machine never seems to pick up work, check its version.
Where things live
The daemon generates an encryption key pair on first run and keeps it in its data directory. Only the public half ever leaves the machine.
mcode uninstall deletes it along with everything else — use --keep-data if you want the configuration preserved.
Disk space grows with the number of projects on the machine and the number of separate environments each one declares, plus a package cache. A small single-project host needs a few GB; a monorepo with one environment per service needs considerably more. For a firm figure for capacity planning, contact support@modelcode.ai.
Telemetry
The daemon sends the Morph Platform a small set of numbers about the machine it runs on. They are on by default and you can turn them off per daemon.Why
When a job is slow, the cause is often the machine rather than the code: the CPU is busy with other work, memory runs out, the disk fills up, or the laptop went to sleep. These numbers let you and our support team see that at a glance instead of guessing. When machine health is enabled for your organization, each daemon in the project sidebar shows its CPU now and its interruptions over the last 24 hours. Its Details view charts CPU over that day and lists each interruption with its time.What is sent
- Always sent, telemetry on or off: the machine’s hostname, operating system and architecture, details of the daemon process (an ID for this run, its process ID and start time, how it was started, a one-way hash of its install folder, and how its previous run ended), when the daemon restarts or loses its connection, and how long its regular check-ins take. the Morph Platform needs these to route jobs to the right machines and to show the daemon in its pool.
- Machine description, when the daemon starts and each time it reconnects: operating system, version, build and kernel, CPU model and core count, total memory, workspace disk size, free space and filesystem type, container CPU and memory limits when the daemon runs in one, whether the machine is on battery or in battery saver, when the machine last booted, and a one-way hash of the machine’s ID, so the same machine is recognized across reinstalls.
- Usage samples: CPU, memory and disk usage, and how busy the daemon’s own processes are. Sampled every 10 seconds and sent as summaries once a minute.
- Interruptions: when the machine sleeps or stalls.
- Network timing: how long the daemon’s background network checks take.
job_server_url, the same host the daemon already reports job status to, so there is nothing new to allowlist.
Turning it off
Telemetry is a per-daemon setting. Run this on the machine:mcode run, stop it (Ctrl+C) and run it again. mcode telemetry enable turns it back on, and mcode telemetry status shows the current setting.
On daemons older than the November 2026 release, which don’t have the telemetry command, add host_telemetry_enabled = false near the top of config.toml (see Where things live), before any [section] line, then restart the daemon. For a daemon you start with mcode run, you can instead set the environment variable HOST_TELEMETRY_ENABLED=false in the shell you start it from. A daemon running as a service doesn’t read your shell’s environment, so use config.toml for it. The environment variable takes precedence over the file.
With telemetry off, the daemon’s machine numbers are no longer shown, even where machine health is enabled for your organization. What it still sends is what the Morph Platform needs to run your jobs: everything listed under Always sent above, job status and logs, and timings of its own work such as clones and environment setup.
Command reference
Prerequisite checks
Before a step starts on a self-hosted project, the Morph Platform asks each online daemon in the project’s pool to check its own machine: that it reaches the hosts and registries the step needs, and that the machine lets the Morph Platform‘s tools run. The checks take a few seconds and run alongside the repository checks. When a check fails, the project page shows one message per problem. Each one names the daemon, says what it cannot do, and gives the commands to run on that daemon’s machine. Problems with the same cause on several hosts are shown as one message.Blocked or warning
A failure the daemon is sure about blocks the steps that need it. When it cannot be sure, the message is a warning that blocks nothing, for example:- The request timed out, or a proxy or the registry refused it.
- A registry is the public default (such as Maven Central) and your project may install from a mirror instead.
- A git host failed with the daemon’s own network settings, when git on that machine may get through with a proxy of its own.
mcode update to get the checks on an older daemon.
When only warnings are left, they show in an amber banner that you can close. It stays closed in that browser, across reloads and later visits, until the warnings change: a new warning, or one that goes away, brings the banner back. Warnings listed under a failure, or with a refused step’s Continue button, cannot be closed.
Check results per daemon
Each daemon’s latest result shows as a tag next to it, in the project’s ModelDaemon pool section (under See daemon list) and in the Daemons list of the pool details page. The tag shows the daemon’s worst result. Hover over it to see which checks passed, which could not be confirmed and which were skipped, or the problems behind a failure or warning.
A daemon with no tag has not been checked, for example because it is too old to run the checks.
After you apply a fix
- Restart the daemon (
mcode stop, thenmcode start), since most fixes change its configuration. - Click Recheck on the project page.
Troubleshooting
When a daemon shows as offline
Start with the UI: the project’s Daemon pool section and the pool details page show each machine’s last-known state, which usually tells you whether this is one machine or the whole pool. If the setup step cannot confirm the daemon, you will see this:
- Is it running? Start it again with
mcode start(service) ormcode run(foreground). - Can it reach the network? Check firewall, proxy, and VPN changes against Network access.
- What do the logs say?
mcode logs— look for connection or authentication errors.
- The host rebooted and
mcode install-servicewas never run, so nothing restarts the daemon - Windows, installed for a user: that user signed out, or the machine rebooted and they have not signed in yet. The service shows as running, but no jobs run until that user signs in. Run
mcode install-service --local-systemif the host must work with nobody signed in. - macOS: the user who installed the daemon logged out, or the machine rebooted and they have not logged in yet. The daemon starts again when they log in.
- Linux, lingering not enabled: the daemon stops when its user logs out and doesn’t start at boot. Ask an administrator to run
sudo loginctl enable-linger <user>. - A VPN disconnect or firewall change blocked outbound HTTPS
- The API key was rotated in the UI but not updated on the host
- Your the Morph Platform account was paused. The daemon stops and stays stopped; after the account is resumed, run
mcode start(from an elevated PowerShell on Windows)
When a daemon is running but gets no work
- Platform mismatch. A machine whose OS does not match its pool’s platform registers and looks healthy, but receives nothing. Check the pool’s platform on the pool details page.
- Architecture pin. If the pool pins an architecture, machines on other architectures are not sent work.
- Version too old. A machine below the minimum version is skipped silently. Run
mcode update.
When registration is refused
The daemon reports the reason in its log. Some refusals are permanent — the daemon will disable its own service and exit cleanly rather than retrying forever, so a clean exit is a signal rather than a crash:
Deleting a daemon in the UI is a real deletion: the machine clears its own registration, stops its service, and stays down until reinstalled.
”ModelDaemon is already running”
Only one copy of the daemon can run from an installation at a time. If you runmcode run while the service is already running, or start the daemon twice, the second copy waits up to 45 seconds for the first to exit, then stops with:
mcode start.
After mcode update or a restart, the new copy can wait up to 45 seconds for the old one to shut down. A log line saying it is waiting is expected, not an error.
”Command not found” after installing new tools
The daemon captures the hostPATH when it is installed as a service. If you install new tools afterwards, run mcode refresh-path and restart the daemon. On Windows, when the service runs jobs as a user, run mcode refresh-path from that user’s own PowerShell (it does not need to be elevated). Then restart the service from an elevated shell (mcode stop, then mcode start), or sign out of Windows and back in.
Authentication failures (“Unauthorized”, “Authentication failed”)
Check that the API key inconfig.toml matches the one shown in the UI. If it was rotated, update the file and run mcode start again.
Build, run, or health-check failures
These are usually about the application rather than the daemon. The Validation Hub shows which script failed and its output.- Build fails — most often a dependency only available on your private network, or a command that needs a different working directory. Verify it by hand on the same machine as the same user.
- Application does not start — check the port is free, and that required services are reachable from this host.
- Health check times out — confirm the URL and port, check the application binds to
0.0.0.0orlocalhostrather than a specific interface, and allow more time if startup is slow.
Migrating from V1
Older “V1” daemons are deprecated but have not been switched off.- Existing V1 projects keep working. There is no forced migration and no deadline.
- New projects require the current daemon. A new project cannot attach to a V1 daemon.