Skip to content

Services ​

Use [bootstrap.services] to keep a program running in the background as your user on Linux, macOS, and Windows, or to start, stop, and enable the Linux systemd units that a package installed. Several bootstrap sections can run something in the background; pick the one that fits:

You want toUse
Run one program in the background on Linux, macOS, and WindowsA user service (scope = "user")
Save dotfile edits or update tools in the backgroundA built-in service
Start, stop, or enable a unit that a package or managed file providesA system service
Start, stop, or enable a systemd user unit that a package providesAn existing user unit
Use systemd features such as timers, dependencies, or hardening[bootstrap.linux.systemd.units]
Use launchd features such as calendar schedules or queue directories[bootstrap.macos.launchd.agents]
Run a program at boot on macOS, as root or a service account[bootstrap.macos.launchd.daemons]
Run containers[bootstrap.compose]
Run a project's database or development server while you work on it[daemons]

User services ​

A user service runs a program as you, starts it when you log in, and restarts it after a failure. mise writes the service definition your platform's service manager expects, without root.

Run your own program ​

Set scope = "user" and the command to run, then start it with mise bootstrap services apply and check it with mise bootstrap services status. This example assumes my-agent is installed at that path:

[bootstrap.services.my-agent]
scope = "user"
command = "~/.local/bin/my-agent --serve"
sh
mise bootstrap services apply
mise bootstrap services status

mise creates a definition for your platform and starts the service:

PlatformDefinitionManager
Linux~/.config/systemd/user/dev.mise.<name>.servicesystemctl --user
macOS~/Library/LaunchAgents/dev.mise.<name>.plistlaunchctl
WindowsScheduled Task mise\<name>, with its definition under $MISE_STATE_DIR/user-services/schtasks

mise runs command directly, not through a shell, so pipes, redirection, and globs do not work there; put such a command in a script or run sh -c '...'. A leading ~/ in the program path is expanded.

On Linux, the command becomes the unit's ExecStart= line, so systemd expands $VAR, ${VAR}, and specifiers such as %h; write $$ or %% for a literal $ or %. launchd on macOS receives the words unchanged, so a command meant for both platforms should not rely on $VAR or % specifiers; write the values out, or set the variables the program reads in environment.

The service does not get your shell's mise activation, so tools from [tools] are not on its PATH. Use absolute paths, or run the tool through mise exec, and add requires_tools = true so that the full mise bootstrap installs your tools before it starts the service.

Set up a development stack shows a complete example: a user service that keeps the Pitchfork supervisor running from login.

Existing user units ​

Some packages install systemd user units, such as gnome-keyring-daemon from gnome-keyring. To start and enable one without writing a definition of your own, set scope = "user" and leave out command and builtin:

[bootstrap.packages]
"pacman:gnome-keyring" = "latest"

[bootstrap.services.gnome-keyring-daemon]
scope = "user"
state = "running"
enabled = true

mise runs systemctl --user against the unit that already exists, which needs no root, and writes no dev.mise.* unit. A name without a unit suffix gets .service; sockets and timers such as gnome-keyring-daemon.socket work too. state, enabled, and masked behave as they do for system services. command, builtin, description, restart, environment, working_directory, requires_tools, and state = "absent" configure a definition, so they are rejected here; add a command to define the service instead.

This is Linux-only. mise does not guess when the unit is missing or the user manager is unavailable, such as in a container without a login session: status and plans report the service as unknown, and apply fails. mise bootstrap applies packages before services, so one configuration can install the package and start its unit. Managed files cannot notify a user unit.

Built-in services ​

A built-in service runs mise itself. Name it with builtin, which also implies scope = "user":

[bootstrap.services.mise-history]
builtin = "history-watch"
builtinWhat it doesGuide
"history-watch"Runs mise dot watch, which saves edits to your tracked files as you make themAutomatic saves
"tool-update"Checks tools that set auto_update once an hour and updates the ones that are dueAutomatic tool updates

Both run at low priority, restart after a failure, and need no command. Declare them in your global config, ~/.config/mise/config.toml, because they act on your whole account rather than one project. A built-in service starts in the services step of mise bootstrap, before tools are installed, because it needs only mise.

Install mise at a permanent path ​

Built-in services run mise, so the service definition records the absolute path of a mise binary that must stay in place after setup. mise uses the binary that is running, unless it lives in a temporary or remote staging directory; then it uses a permanent mise on PATH. If it finds none, status reports unknown: no durable mise executable; install mise on this host first and mise leaves the service unwritten. Install mise on the host and apply again; for remote bootstrap, pass --install-mise.

User service options ​

KeyValuesDefault
scope"user" or "system""user" with builtin, otherwise "system"
commandCommand line to runRequired unless builtin is set
builtin"history-watch" or "tool-update"
descriptionText the service manager shows
restart"on-failure", "always", or "never""on-failure"
environmentTable of environment variables, such as { LOG_LEVEL = "info" }
working_directoryDirectory to run in; ~ is expanded
state"running", "stopped" (installed but not running), or "absent""running"
enabledtrue starts the service at logintrue
requires_toolstrue starts the service after mise bootstrap installs [tools] and plugin packagesfalse
restart_whenA check that must pass before mise restarts the running service; see Restart only when it is safe

command, builtin, description, restart, environment, working_directory, requires_tools, and state = "absent" apply only to user services. An error that names one of them usually means the entry is missing scope = "user". User services cannot set masked or on_change, and notify from managed files reaches system services only.

Names may contain only letters, numbers, ., _, and -. A name cannot also appear in [bootstrap.linux.systemd.units] or [bootstrap.macos.launchd.agents], because both would write the same definition.

Platform differences ​

On Linux, user services run in your systemd user manager, which starts when you log in and stops when your last session ends. To keep them running on a server without a login session, enable lingering once with sudo loginctl enable-linger $USER; mise does not do this for you. restart maps to systemd's Restart=, with five seconds between attempts.

On macOS, restart maps to launchd's KeepAlive, and "on-failure" uses { SuccessfulExit = false }. enabled controls RunAtLoad. launchd also treats KeepAlive as a request to start when loaded, so mise omits RunAtLoad for a stopped service and omits KeepAlive when enabled = false. A running service with enabled = false starts once on apply, then stays stopped after it exits until you start it again or enable it.

On Windows, "always" and "on-failure" both retry a failed run up to three times, one minute apart. With enabled = true, the task also starts at logon. A successful exit leaves it stopped, so a program that should keep running must loop on its own. Task Scheduler cannot set environment variables, so a service that sets environment runs through mise, which applies the variables and then starts command directly, without cmd.exe. Values and the command are passed as written, including characters such as %, &, and |. Variable names must not be empty or contain =, and no name or value may contain a NUL character. This needs mise installed at a permanent path; without one, status reports the service as unknown. Without environment, the command runs directly.

Task Scheduler starts a console program in a console of its own. mise hides that console for built-in services and for services that run through mise for environment, and the console programs they start inherit it instead of opening windows of their own. A classic Console Host window is hidden. On Windows 11 24H2, Windows Server 2025, and later, a Windows Terminal console is replaced with a windowless one: a terminal window can appear at startup until mise replaces it, and Windows Terminal keeps the disconnected tab if its profile keeps closed tabs open. On older Windows versions, a Windows Terminal window can stay visible. A watcher you start from an interactive shell shares that shell's console, and mise leaves it alone.

Remove a user service ​

state = "absent" removes the installed unit, agent, or task, and keeps it removed while the entry says so. Deleting the declaration instead leaves the service installed; remove it once with mise bootstrap services remove:

sh
mise bootstrap services remove my-agent

The command works whether or not the service is still declared. If it is, the next mise bootstrap installs it again. mise bootstrap unapply also removes the user services that a machine module declared.

Troubleshooting user services ​

If the platform's service manager is unavailable, for example in a container without a systemd user manager, mise reports user services as unknown and skips them with a warning, which mise bootstrap repeats in its follow-up summary. It writes nothing.

Built-in services have start limits so that a crash loop stops: on Linux, systemd allows three starts within five minutes and then stops retrying; on macOS, launchd waits at least five minutes between launches. These limits apply to both built-in services, not to services you define with command. Run mise doctor and read the service's logs, fix the cause, then run mise bootstrap services apply or mise bootstrap again, which resets the limit and starts the service. On Linux you can also restart it directly:

sh
systemctl --user reset-failed dev.mise.mise-history.service
systemctl --user start dev.mise.mise-history.service

Replace mise-history with your service's name. If the history watcher runs but does not save your files, see Checking watcher health.

System services ​

System services start, stop, enable, and mask systemd units that a package or a managed file provides. They are Linux-only and need root: mise uses sudo only when a change is needed, and system_packages.sudo = false forbids it. mise bootstrap applies packages and files first and reloads systemd after file changes, so one configuration can install a unit and start it:

[bootstrap.packages]
"apt:docker.io" = "latest"

[bootstrap.services.docker]
state = "running"
enabled = true

A name without a unit suffix gets .service. Full unit names such as postgresql@16-main.service, sockets, and timers work too. When the unit comes from a package or file in the same config, preview with the full mise bootstrap --dry-run; mise bootstrap services apply on its own does not install the package or write the file first.

System service options ​

KeyValuesDefault
state"running", "stopped", or "unchanged""running"
enabledtrue starts the unit at boottrue
maskedtrue prevents the unit from starting at allfalse
on_change"reload_or_restart", "reload", "restart", or "none""reload_or_restart"
restart_whenA check that must pass before mise reloads, restarts, or stops the active unit; see Restart only when it is safe

Reload a service when its files change ​

A managed file or directory can notify a system service when mise changes it; Restart a service after a change covers the file side and which commands run notifications. The service's on_change value chooses what happens to a running unit:

on_changeCommand
"reload_or_restart"systemctl reload-or-restart
"reload"systemctl reload
"restart"systemctl restart
"none"None
[bootstrap.services.docker]
on_change = "restart"

Before it changes any system service, mise runs one systemctl daemon-reload. A unit that does not exist yet is accepted only when the same run writes its unit file (or its name@.service template) into a systemd unit directory such as /etc/systemd/system through [bootstrap.files], and that file entry lists the service in notify.

Enable a service without starting it ​

state = "unchanged" sets only whether the unit starts at boot, and never starts or stops it. Use it for a unit that should take over later, such as a login manager that would replace the console you are provisioning from:

[bootstrap.services.greetd]
state = "unchanged"
enabled = true

mise runs systemctl enable greetd.service if the unit is not enabled yet, and nothing once it is, whether or not greetd is running. A managed file that notifys the service does not reload or restart it. The same works for an existing user unit, such as one that belongs to a graphical session that has not started yet. "unchanged" cannot be combined with masked = true, because masking stops the unit, and it is not available for user services that mise defines with command or builtin.

Stop and disable a service ​

Deleting a declaration leaves the unit in whatever state it is in. To stop it and keep it from starting again, keep a declaration. A masked unit must also be stopped and disabled:

[bootstrap.services.old-worker]
state = "stopped"
enabled = false
masked = true

mise does not guess when a unit is missing, systemd is unavailable, or a unit cannot be enabled, such as a static unit. Status and plans report the service as unknown, and apply fails instead of running a command that might not be safe.

Restart only when it is safe ​

Applying a changed service restarts its running process, which interrupts whatever it is doing: a CI runner loses its job, a queue worker its message. restart_when names a command that must exit 0 before mise restarts, reloads, or stops a running service. mise runs it until it passes, then applies the service:

[bootstrap.macos.launchd.daemons."ci.actions-runner"]
user = "mise-ci"
program = "/opt/mise-ci/actions-runner/run.sh"
run_at_load = true
keep_alive = true
# the runner runs Runner.Worker only while it has a job
restart_when = { run = "! pgrep -f '^/opt/mise-ci/actions-runner/bin/Runner.Worker'", timeout = "15m", on_timeout = "skip" }
KeyValuesDefault
runShell command that exits 0 when the service may be restartedRequired
timeoutHow long to keep checking, such as "15m" or "1h""15m"
intervalHow long to wait between checks"10s"
on_timeout"fail" or "skip": what happens when the check has not passed in time"fail"

The check runs only when applying the entry would interrupt a running process, which includes removing a running service with state = "absent". A service that is not running, or that is installed for the first time, is applied at once. Every other entry is applied first, and system services wait until the user services that don't set requires_tools are applied; user services with requires_tools are applied later in the run, after the wait. If applying a user service fails, mise reports the error at once, still applies the waiting system services, and then fails. The waiting checks run side by side, and each service restarts as soon as its own check passes, so a slow or busy service holds up no other. Services restart one at a time: when another service restarted after a check passed, mise runs that check again first, so a service that took new work in the meantime is not interrupted.

When the timeout passes, mise leaves the service as it is, still running its old definition. With on_timeout = "fail", the apply fails after the other entries are applied. With "skip", mise warns, lists the service in the summary at the end of mise bootstrap, and succeeds. Either way, status still reports the service as changed, so the next apply checks again.

To skip the checks, pass --force-restart to mise bootstrap, mise bootstrap remote, or the section's apply command. Every service that the run has to restart or stop is then changed right away, interrupting its work; a service that needs no change is not restarted:

sh
mise bootstrap --force-restart
mise bootstrap macos launchd-daemons apply --force-restart

--dry-run runs no check. It prints the wait before the service's commands, such as wait until `true` exits 0 (every 10s, up to 15m, then fail) before restarting docker.service, and mise bootstrap plan adds a restart waits until ... to the service's desired state.

The command runs with sh -c (cmd /C on Windows) as the user who runs mise, not as root or the service's account, so a LaunchDaemon's check sees what that user can see; pgrep and most health endpoints need no privileges. Its output is discarded, and MISE_DEBUG=1 logs its exit status. A check that is still running when the timeout passes is stopped, along with the processes it started, and the service times out.

restart_when works in [bootstrap.services] (user services, system services, and existing user units), in [bootstrap.linux.systemd.units] services (not timers), and in [bootstrap.macos.launchd.agents] and .daemons. When a system service that a managed file notifies is not reloaded in that run, because its check timed out with on_timeout = "skip" or "fail", or applying it failed, mise keeps the reload pending and the next apply makes it, even though the file no longer changes.

How configs combine ​

Services merge by name across the config hierarchy. A more local config replaces the whole declaration for that name; mise does not merge keys across files.

Preview and apply ​

mise bootstrap services covers both scopes:

sh
mise bootstrap services status            # state of each service
mise bootstrap services status --json     # the same, as JSON
mise bootstrap services status --missing  # exit 1 if any service would change
mise bootstrap services apply --dry-run   # print the commands
mise bootstrap services apply             # apply after a confirmation prompt
mise bootstrap services apply --yes       # apply without prompting
mise bootstrap services remove <name>     # remove an installed user service

mise bootstrap status and mise bootstrap plan list user services as user-service:<name>. mise bootstrap status --json includes each user service's generated definition under user_services, so you can inspect it before applying.

On macOS and Windows ​

User services work on all three platforms. System services are Linux-only: on macOS and Windows, mise bootstrap, mise bootstrap status, and mise bootstrap plan ignore them, while mise bootstrap services status and apply fail when one is declared. Keep system services in a config that only Linux machines load, such as a machine module. To run a program at boot on macOS, declare a LaunchDaemon.

See also ​

MIT LicenseCopyright © 2026jdx.dev