Bootstrap
mise bootstrap sets up a machine from your mise configuration: host packages, system files, services, Git repositories, dotfiles, shell activation, tools, and your bootstrap task. Use it when a machine needs more than the tools in [tools].
mise never applies [bootstrap] on its own. It runs only when you run mise bootstrap or one part's apply subcommand, such as mise bootstrap packages apply. Parts that declare state skip whatever already matches, so you can run it again after each configuration change.
Quick start
Put this in your global config, ~/.config/mise/config.toml, to make it this machine's setup:
[bootstrap.mise_shell_activate]
zsh = true
[tools]
node = "24"
[tasks.bootstrap]
run = "node --version"For Bash, use bash = true instead. For fish, use fish = "auto", which activates mise at the prompt and uses shims in scripts; see shell activation. Preview the run, apply it, then check the result:
mise bootstrap --dry-run
mise bootstrap
mise bootstrap statusThe dry run lists what each part would change and prints the bootstrap task instead of running it:
mise bootstrap: shell activation
edit ~/.zprofile (block:activate)
edit ~/.zshrc (block:activate)
mise bootstrap: tools
mise node@24.x.x ⇢ would install
mise bootstrap: running `bootstrap` task
[bootstrap] $ node --versionThe real run writes the activation blocks, installs Node.js, and runs the task. Add --yes to apply without confirmation prompts, and open a new shell after mise edits your shell startup files.
The same configuration also works in a project mise.toml, but a project file needs mise trust before mise reads it. The global config does not. Tasks from an untrusted project can also stop the bootstrap task from running; see The bootstrap task.
What you can declare
Each section has its own page, and most have their own status and apply subcommands.
| Config | Use for |
|---|---|
[bootstrap.packages] | Host packages from apt, dnf, pacman, Homebrew, WinGet, and other package managers |
[bootstrap.apt.sources] | apt repositories and PPAs that apt: packages install from |
[bootstrap.plugins] | Package manager plugins that add more package sources |
[bootstrap.users], [bootstrap.groups] | Linux and macOS users and groups |
[bootstrap.files], [bootstrap.directories] | System files and directories, with their content, owner, and permissions |
[bootstrap.ssh] | Authorized SSH keys for each user, and client Host entries in ~/.ssh/config |
[bootstrap.secrets] | Secret values that [bootstrap.files] and [dotfiles] templates read from the environment |
[bootstrap.services] | User services on Linux, macOS, and Windows, and existing Linux system services |
[bootstrap.linux.firewall] | Linux host firewall policy and rules |
[bootstrap.macos.firewall] | macOS Application Firewall settings and per-application rules |
[bootstrap.compose] | Docker Compose projects |
[bootstrap.repos] | Git repositories, cloned before dotfiles are applied |
[dotfiles] | Dotfiles: tracking files in place, creating files from sources, and editing blocks or lines |
[dotfile_groups], [bootstrap] dotfile_groups | Directory trees of dotfiles, and which of them a machine applies |
[bootstrap.mise_shell_activate] | mise activation in shell startup files |
[bootstrap.user] | Your login shell |
[bootstrap.settings.git] | Keys in your global Git configuration, such as user.email and safe.directory |
[bootstrap.settings.macos] | macOS user preferences for the Dock, Finder, keyboard, trackpad, login items, and any defaults write domain, and Spotlight indexing; power settings, machine-wide preferences, and host checks |
[bootstrap.settings] | Settings that bootstrap settings plugins apply, such as a Linux desktop's appearance |
[bootstrap.macos.launchd.agents] | macOS LaunchAgents, written and loaded with launchctl |
[bootstrap.macos.launchd.daemons] | macOS LaunchDaemons, which run at boot without a login, written and loaded with launchctl |
[bootstrap.linux.systemd.units] | systemd user units, managed with systemctl --user |
[bootstrap.repeat] | Entries declared once and applied once per item, such as one LaunchDaemon and directory per CI runner, with the count from a host's vars |
[tools] | Tools that mise installs and manages |
[bootstrap.tools] | Tools that mise installs as another account, such as a CI runner's service account |
[bootstrap.hooks] | Commands that run at named points in the run |
[tasks.bootstrap] | Setup that the sections above do not cover |
[bootstrap.remote] | SSH hosts for mise bootstrap remote |
Start from a repository
To set up a machine from configuration you keep in Git, pass the repository to mise bootstrap. Use --from for a setup project that stays apart from your own configuration, such as a team's workstation repository, and --adopt for a repository that becomes this machine's own configuration:
# a bootstrap project: a mise.toml and the files it uses
mise bootstrap --from https://github.com/you/workstation.git
# global mise config, cloned as a Git checkout into ~/.config/mise
mise bootstrap --adopt you/mise-config
# a setup repository from `mise dot origin set`: tracked files go to their paths
mise bootstrap --adopt you/setupBootstrap from a repository explains where each kind goes, how --adopt tells them apart, refs, and --update. Set up a machine walks through adopting a setup repository.
Run order
Before it changes anything, mise resolves the [bootstrap.secrets] inputs used by [bootstrap.files] templates and by [dotfiles] entries with mode = "template", and renders those templates. A missing value stops the run before the first change.
mise bootstrap then runs these steps in order. The part name in the second column works with --only and --skip, and a part's hooks run only when the part runs. The older names in parentheses still work but print a deprecation warning. They will be removed in mise 2027.10.4.
| Step | Part (--only, --skip) | Applies | Hooks |
|---|---|---|---|
| 1 | accounts | [bootstrap.users] and [bootstrap.groups] | |
| 2 | plugins | [bootstrap.plugins] | |
| 3 | files | Files and directories with phase = "pre-packages" | |
| 4 | packages | [bootstrap.apt.sources], then [bootstrap.packages] from built-in package managers | pre-packages, post-packages |
| 5 | files | The remaining [bootstrap.files] and [bootstrap.directories] | |
| 6 | services | [bootstrap.services], except user services with requires_tools = true | |
| 7 | firewall | [bootstrap.linux.firewall] | |
| 8 | compose | [bootstrap.compose] | |
| 9 | repos | [bootstrap.repos] | pre-repos, post-repos |
| 10 | dotfiles | [dotfiles] | pre-dotfiles, post-dotfiles |
| 11 | mise-shell-activate (shell) | [bootstrap.mise_shell_activate] | |
| 12 | macos-defaults (defaults) | [bootstrap.settings.macos] | pre-defaults, post-defaults |
| 13 | macos-launchd-agents (launchd) | [bootstrap.macos.launchd.agents] | |
| 14 | macos-launchd-daemons | [bootstrap.macos.launchd.daemons] | |
| 15 | linux-systemd-units (systemd) | [bootstrap.linux.systemd.units] | |
| 16 | user | [bootstrap.user] | pre-user, post-user |
| 17 | tools | [tools], as mise install would, then [bootstrap.tools] for other accounts | pre-tools, post-tools |
| 18 | packages | Packages from package manager plugins | |
| 19 | settings | [bootstrap.settings] through bootstrap settings plugins, and [bootstrap.settings.git] | |
| 20 | services | User services with requires_tools = true | |
| 21 | task | The bootstrap task, if one exists | |
| 22 | final-hook | final |
In step 4, the pre-packages hook runs before mise adds apt sources.
The post-packages hook runs right after step 4, unless a package in [bootstrap.packages] comes from a package manager plugin. Then it runs after step 18 instead, once those packages are installed. Step 20 runs even with --skip tools.
Reruns and failures
The declarative parts compare the configuration with the machine and change only what differs. Hooks and the bootstrap task run every time, so make them safe to repeat. A run is a sequence, not a transaction: if a later step fails, earlier changes stay. Fix the reported failure and run mise bootstrap again.
History checkpoints
Once at least one file is tracked, or history already exists, every run that changes something records checkpoints of your tracked files before and after it, so mise dot undo can reverse what the run wrote to them. That covers mise bootstrap, each mise bootstrap <part> apply, and other commands that change files or bootstrap config in place, such as mise dot add, mise dot edit, mise bootstrap packages use, and mise bootstrap unapply. A bootstrap with nothing tracked does not start a history, dry runs record nothing, and history.enabled = false turns recording off.
Choose what runs
--only runs only the parts you name, and --skip runs everything except them. Both take the part names from the run order, repeated or comma-separated, and you cannot combine them:
mise bootstrap --only dotfiles,tools --dry-run
mise bootstrap --only dotfiles,tools
mise bootstrap --skip tools,taskSelect every part your change depends on. --only services does not install the packages or unit files that supply those services, and a new account used as a file owner needs both accounts and files.
These flags change what the selected parts do:
| Flag | Effect |
|---|---|
--update | Fast-forward a global config checkout, refresh package metadata, and update declared repositories |
--upgrade | Also upgrade installed packages and tools, within package pins and tool version ranges, as mise bootstrap packages upgrade and mise upgrade do |
--self-update | Run mise self-update first, then run the bootstrap with the new version; if the update fails, nothing is applied |
--force-dotfiles | Replace existing files that conflict with whole-file [dotfiles] entries instead of stopping |
--prune-dotfiles | Remove files that dotfile groups deployed and no active entry deploys now, like mise dot apply --prune |
--skip-dirty | Skip [bootstrap.repos] checkouts with local changes instead of failing |
--prompt-secrets | Prompt for secret inputs missing from the environment |
--prompt-vars | Ask for [vars] with a prompt that have no saved answer |
--save-env | Save the environments of -E or MISE_ENV to miserc.local.toml, so later runs select them without -E |
-y, --yes | Apply without confirmation prompts |
How --update refreshes package metadata depends on the package manager, and some managers have nothing to refresh; see Apply packages. --upgrade does not update mise itself, repositories, or container images, and does not restart services. --self-update is skipped by --dry-run.
Preview and inspect
mise bootstrap --dry-run previews the selected parts. It lists the changes each part would make, and it prints hook commands and the bootstrap task instead of running them. It does not render [dotfiles] templates, but it does render [bootstrap.files] content templates (template = true) to compare them with the files on disk, so an exec() call in one of them runs during the dry run, as it does for mise bootstrap plan and mise bootstrap status. See Templates that run commands.
Plan declarative resources
mise bootstrap plan lists the changes to declarative resources in dependency order: accounts, packages (including packages from plugins), system files and directories, system and user services, firewall policy and rules, Compose projects, and Git repositories (create to clone, update to pull). Commands in [bootstrap.hooks] are listed with the action run and a hook_phase, since a command cannot be diffed; they run on every bootstrap, so they do not count as changes. The plan does not cover dotfiles, shell activation, macOS defaults, LaunchAgents and LaunchDaemons, systemd user units, the login shell, tools, or the bootstrap task. Use mise bootstrap --dry-run for those.
mise bootstrap plan
mise bootstrap plan --json
mise bootstrap plan --detailed-exitcode
mise bootstrap plan --unprivileged # never ask for sudo; root-only state is unknownWith --detailed-exitcode, the exit code reports what the plan found:
| Exit code | Meaning |
|---|---|
| 0 | Nothing would change |
| 2 | The plan has changes |
| 1 | Planning failed, or a resource is unknown |
A resource is unknown when mise cannot reach its declared state on its own, for example a package whose manager is unavailable on this platform or cannot install the requested version, or a repository with local changes, which bootstrap refuses to touch (--skip-dirty leaves it unchanged and moves on). mise reports it instead of skipping it, so you can resolve it by hand.
Check state
mise bootstrap status
mise bootstrap status --missing # exit 1 if anything differs from the config
mise bootstrap status --json
mise bootstrap status --last-applied # only the record of the last applystatus lists every configured part, the tools in [tools], and the system dependencies that installed tools need. --missing still lists everything and only changes the exit code, which suits CI. Each part also has its own status subcommand, such as mise bootstrap packages status, and mise dot status covers dotfiles and their history. The exception is [bootstrap.settings] plugin sections, which only mise bootstrap settings status checks.
Last applied
Every mise bootstrap that applies changes and finishes without an error, including one started by mise bootstrap remote, writes a small record of the run. mise bootstrap status ends with it, and --last-applied shows only the record:
mise bootstrap status --last-applied
mise bootstrap status --last-applied --json2h ago (2026-11-28T21:03:00Z) by me@laptop with mise 2026.11.5, env mac-ci, commit bfb7b1f: 3 changed, 41 unchangedThe record holds the mise version, the time, the user who applied it, the selected config environments, a hash of the config files as they are at the end of the run (including any the dotfiles step wrote), the parts named by --only or --skip, and resource counts per kind (changed, unchanged, and unknown) from the plan taken just before the run. Taking that plan renders templates, so a run has no counts when it skips files, when a config file calls exec(), or when a [bootstrap.files] entry is a template: a command a template runs must not run a second time. A remote run adds the source's Git commit, whether a local checkout was dirty, and the user@host that started it. It never holds secrets or file contents. A dry run, a failed run, or a run where a confirmation was declined writes nothing.
mise writes it to a root-owned file when it can do so without a password prompt, that is when it runs as root or sudo -n works (for example right after the run used sudo):
| Platform | Location |
|---|---|
| macOS | /var/db/mise/bootstrap/last-applied.json |
| Linux | /var/lib/mise/bootstrap/last-applied.json |
Otherwise it goes to $MISE_STATE_DIR/bootstrap/last-applied.json, normally ~/.local/state/mise/bootstrap/last-applied.json. Readers show whichever is newer.
Follow-up items
If a run leaves something for you to do, such as starting a new login session after a login shell change or handling a part mise skipped on this platform, mise bootstrap ends with a bootstrap: follow-up list. A dry run prints bootstrap: follow-up if applied instead. mise prints the list even when a later step fails.
Hooks
Hooks run commands at named points in a run. Set a phase to a command string, an array of commands, or a table with run:
[bootstrap.hooks]
post-defaults = "killall Dock || true"
[bootstrap.hooks.post-tools]
run = [
"mise exec -- node --version",
"mise exec -- python --version",
]
[bootstrap.hooks.final]
run = "mise exec -- gh auth status"On Windows, run_windows replaces run. A table with only run_windows does nothing on other platforms:
[bootstrap.hooks.post-tools]
run = "mise exec -- node --version"
run_windows = "mise exec -- node.exe --version"A table can also set description. mise bootstrap prints it in place of the command, which is useful when the command is a long script:
[bootstrap.hooks.final]
description = "Remove the root copy of pam_reattach if Homebrew removed the module"
run = '''
copy=/usr/local/lib/pam/pam_reattach.so
if [ ! -e /opt/homebrew/lib/pam/pam_reattach.so ] && [ -e "$copy" ]; then
sudo rm -f "$copy"
fi
'''Without a description, mise prints $ and the first line of the command, cut to the width of the terminal, as it does for tasks. With a run array, the description is printed once, before the first command. --verbose prints each full command, and so does --dry-run, which shows what a real run would execute. When a config file and a file it includes both have a hook for the same phase, mise runs the included file's commands first, then the file's own, and prints them without the descriptions.
The phases are pre-packages, post-packages, pre-repos, post-repos, pre-dotfiles, post-dotfiles, pre-defaults, post-defaults, pre-user, post-user, pre-tools, post-tools, and final. The run order shows where each one runs. Hooks from every config file are combined, global config first, so a global config can set up the machine while a project adds its own commands.
Hooks run during mise bootstrap. The pre-dotfiles and post-dotfiles hooks also run around mise dot apply. Other part subcommands, such as mise bootstrap repos apply, do not run hooks, and --no-hooks, MISE_NO_HOOKS=1, and safe mode skip them all.
Each command runs with the shell from unix_default_inline_shell_args (or windows_default_inline_shell_args), as inline tasks do. A failing hook stops the run, and a dry run prints each command instead of running it. A dry run never calls exec(), so it prints a hook whose template calls exec(), or reads a var computed with it, as written, with a note that gives the render error. Hooks run in mise's own environment, not a task environment, so a command that needs tools from [tools] should go through mise exec --, as above, or move to the bootstrap task.
Hook commands are Tera templates rendered with the declaring config's context, such as {{ config_root }}, {{ xdg_config_home }}, and {{ vars.name }}.
These hooks run on the machine being bootstrapped, so in a remote run they run on each host. For commands that run on your own machine before and after a remote run, or around each host, see [bootstrap.remote.hooks].
The bootstrap task
After the other parts, mise bootstrap runs the task named bootstrap if one exists, such as a [tasks.bootstrap] table. It runs like any other task, with the tools from [tools] available.
Use the declarative sections when mise can check and apply the state. Use the task for setup they do not cover, such as checking authentication or seeding local data:
[tasks.bootstrap]
run = [
"install -d -m 700 ~/.ssh",
"gh auth status",
]The task runs on every mise bootstrap, so guard steps that should happen only once. On machines that share a setup repository, adoption runs it once the files are restored. A shared change that mise dot pull or the watcher restores does not run it; run mise bootstrap to apply the change and run the task. --skip task leaves it out.
A project file with only [tasks] loads without trust, and its tasks can replace yours by name. mise therefore runs the bootstrap task only when it and every task it reaches (its depends, and tasks its run entries name) come from the global config or a trusted project. Other project tasks do not matter. A task file is judged by where mise found it: a project file that is a symlink into ~/.config/mise/tasks is a task of that project, not a global one. Otherwise the run stops at this step with an error that names the untrusted file. Trust the project, run mise bootstrap from another directory, or pass --skip task.
Templates
Not every value under [bootstrap] is a Tera template. These are rendered:
| Where | What is rendered |
|---|---|
[bootstrap.linux.systemd.units] | Every string value in a unit |
[bootstrap.macos.launchd.agents] | Every string value in an agent |
[bootstrap.macos.launchd.daemons] | Every string value in a daemon |
[bootstrap.compose] | Text and list values in a Compose project, not fields such as state |
[bootstrap.hooks] | The hook command |
[bootstrap.files] | File content, only with template = true |
[dotfiles] | File content, only with mode = "template" or template = "tera" |
[bootstrap.repeat] | Every key and string, with repeat.item; file content as above |
Everything else, including section keys, package specs, repository paths, and macOS defaults, is used exactly as written.
Rendering uses the template context of the config file that declared the entry, so {{ config_root }} does not depend on where you run mise bootstrap. In units, agents, Compose projects, and hooks it is the config's root: the project directory, or MISE_GLOBAL_CONFIG_ROOT (default $HOME) for the global config. In [bootstrap.files] content templates it is the directory that contains the declaring file; see render content as a template. A managed file's content template also gets {{ target }}. Every bootstrap template gets {{ bootstrap.host }}, the machine being set up, with the inventory values and vars of a remote host. [bootstrap.files] templates and [dotfiles] entries with mode = "template" can call {{ secret(name="...") }}; block, line, and merge edits with template = "tera" cannot.
Values without template syntax skip the renderer, so a literal %h, %i, or $HOME in a unit, agent, or Compose project reaches the generated file unchanged. Any ~ expansion a section documents still happens afterwards.
Templates that run commands
{{ exec(...) }} works in [bootstrap.hooks] and in file content templates, but not in unit, agent, or Compose values. Unit, agent, and Compose values render the same way for status, plan, --dry-run, and apply, so mise leaves exec() out of them to keep those commands from running anything. File content templates do not have that protection: mise renders them to compare their output with the file on disk, and their exec() calls run then:
| Template | Read-only commands that render it |
|---|---|
[bootstrap.files] content | mise bootstrap status, mise bootstrap plan, and mise bootstrap --dry-run |
[dotfiles] content | mise bootstrap status and mise dot status, but not a dry run |
[bootstrap.hooks] commands | A dry run, with exec() disabled; a hook that calls it, or reads a var that needs it, is printed unrendered with a note |
Next steps
- Set up a machine walks through tracking dotfiles, declaring tools and packages, and bringing a second machine to the same state.
- Machine modules groups optional setup into config environments that each machine selects, and removes a module's resources with
mise bootstrap unapply. - Remote hosts applies the same configuration to other machines over SSH.
- To change a dotfile that mise deploys, see Adopt files and capture edits. To add packages from the command line, see
mise bootstrap packages use.