Uninstall an instance
Use the uninstaller inside the instance you are removing. It reads that installation's manifest to identify its services and other resources. Review the plan before changing the machine.
Before removal
- Identify the exact instance name and install root. The manifest is
<install-root>/Setup/instance-<name>.json. Do not infer ownership from a service name alone. - Back up application data and databases using your normal backup process. Doctor's
snapshotrecords file hashes; it is not a data backup. - Run the installed script with
--dry-run(PowerShell:-DryRun) and read everyKEPTor warning line, especially on a host with more than one instance.
Choose the scope
| Scope | Effect |
|---|---|
| No removal flags | Stops and unregisters this instance's OS services or launchd jobs. Files, web site, privilege rule and service account stay. |
--remove-web-site / -RemoveWebSite | Removes the nginx or IIS site recorded as created by this installation. |
--delete-files / -DeleteFiles | Removes owned files. The web-site flag must accompany it, because removing the manifest first could leave an orphaned site. |
--all / -All | Requests services, site, files, privilege rule and service account. Shared resources remain guarded when another instance uses them. |
On macOS, the privilege-rule flag is --remove-privilege-rule (--remove-polkit-rule is accepted as an alias). Run elevated: sudo on Linux/macOS, Administrator PowerShell on Windows. An unattended destructive run also needs --yes or -Yes.
Linux
Set INSTALL_ROOT to the actual root and replace Main01 with the manifest's instance name. Preview a full removal:
INSTALL_ROOT="/opt/createrun"
sudo bash "$INSTALL_ROOT/Services/Application Service/Scripts/uninstall-instance.sh" \
--instance Main01 --install-dir "$INSTALL_ROOT" --all --dry-runAfter reviewing the plan and your backup, run the same command with --dry-run replaced by --yes. Omit --all to remove service registrations only.
Windows
Run in an Administrator PowerShell window. Preview a full removal:
$instanceRoot = 'C:\Createrun'
& "$instanceRoot\Services\Application Service\Scripts\uninstall-instance.ps1" `
-Instance Main01 -InstallDir $instanceRoot -All -DryRunAfter reviewing the plan and your backup, replace -DryRun with -Yes. Omit -All to remove service registrations only. The Setup Bootstrapper's uninstall sub-command delegates to this installed script when it is present.
macOS (Apple Silicon)
The macOS installer source includes a separate launchd-aware script. If you have a macOS installation, verify that this script exists in its actual root before using it. Its behavior has not yet been accepted on a real Mac.
INSTALL_ROOT="/opt/createrun"
sudo bash "$INSTALL_ROOT/Services/Application Service/Scripts/uninstall-instance-macos.sh" \
--instance Main01 --install-dir "$INSTALL_ROOT" --all --dry-runReview the launchd jobs, nginx site (if configured), sudoers rule, account and KEPT lines. Only then replace --dry-run with --yes. A workstation user's own account is outside the script's service-account removal scope.
Read the result
| Exit code | What to do |
|---|---|
0 | Every requested scope completed. Warnings may describe resources that this installation never created. |
1 | Partial removal. Read the failed scope, correct the cause and rerun the same command; the manifest remains for recovery. |
2 | Usage or instance-resolution error. Correct the arguments; no removal began. |
3 | Administrator/root privileges are required; no removal began. |
4 | Another instance was left unusable. Stop further removal and inspect that instance. |