# Uninstalling Deployments

> When a solution deployment is no longer needed, you can uninstall it from the target environment. This removes the deployment configuration and deactivates all associated processes.

When a solution deployment is no longer needed, you can uninstall it from the target environment. This removes the deployment configuration and deactivates all associated processes.

:::tip Trusting custom certificates
For Orchestrator instances signed by a private Certificate Authority (such as UiPath Automation Suite), this command also accepts `--ca-cert` and `--pinnedpubkey` parameters. See [Trusting custom certificates](https://docs.uipath.com/cicd-integrations/standalone/2025.10/user-guide/trusting-custom-certificates) for scenarios and examples.
:::

## What is uninstalling?

Uninstalling a deployment:

- Removes the deployment from the target folder in Orchestrator.
- Deactivates all processes included in the solution.
- Stops any running triggers or schedules.
- Cleans up deployment-specific configurations.
- **Does not delete the package** from Solutions (use delete-package for that).

## Command syntax

```bash
uipcli solution deploy-uninstall <deployment-name> [options]
```

### Parameters

| Parameter | Description | Required |
|-----------|-------------|----------|
| `<deployment-name>` | Name of the deployment to uninstall | Yes |
| `-U` | Orchestrator URL | Yes |
| `-T` | Tenant name | Yes |
| `-A` | Organization name | Yes |
| `-I` | External App ID | Yes |
| `-S` | External App secret | Yes |
| `--applicationScope` | Required scopes | Yes |
| `--traceLevel` | Logging level | No |
| `--ca-cert` | Trusted root CA file(s) (PEM, DER, or PKCS#7) for the Orchestrator/Identity TLS certificate. Repeat or comma-separate. See [Trusting custom certificates](https://docs.uipath.com/cicd-integrations/standalone/2025.10/user-guide/trusting-custom-certificates). | No |
| `--pinnedpubkey` | Pin the leaf public key (`sha256//<base64>`). See [Trusting custom certificates](https://docs.uipath.com/cicd-integrations/standalone/2025.10/user-guide/trusting-custom-certificates). | No |

## Authentication

See [Authentication and scopes](https://docs.uipath.com/cicd-integrations/standalone/2025.10/user-guide/solutions-authentication-and-scopes) for required scopes and External App setup.

## Example

```bash
uipcli solution deploy-uninstall MySolution-Prod-v1.2.3 \
  -U https://cloud.uipath.com/ \
  -T DefaultTenant \
  -A myorg \
  -I 12345678-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
  -S **** \
  --applicationScope "AutomationSolutions Solutions.Deployments Solutions.Deployments.Read Solutions.Deployments.Write Solutions.Packages Solutions.Packages.Read Solutions.Packages.Write" \
  --traceLevel Information
```

## What happens during uninstall

When you uninstall a deployment:

1. **Deactivation** - The deployment is marked as inactive.
2. **Process cleanup** - All processes in the solution are removed from the folder.
3. **Trigger cleanup** - Scheduled triggers are stopped and removed.
4. **Configuration cleanup** - Deployment-specific bindings and configurations are deleted.
5. **Package retention** - The package remains in Solutions and can be redeployed.

## Uninstall vs. Delete

It's important to understand the difference:

| Operation | What it does | When to use |
|-----------|-------------|-------------|
| **Uninstall** | Removes deployment from folder | When you want to deactivate a deployment but keep the package for future use |
| **Delete Package** | Removes package from Solutions Management | When you want to permanently remove a package version |

### Typical cleanup workflow

```bash
# 1. First, uninstall all deployments using the package
uipcli solution deploy-uninstall MySolution-Dev-1.2.3 ...
uipcli solution deploy-uninstall MySolution-Test-1.2.3 ...

# 2. Then delete the package if no longer needed
uipcli solution delete-package MySolution -v 1.2.3 ...
```

## Best practices

### 1. Keep only necessary deployments

Don't accumulate old deployments. Uninstall them as part of your deployment pipeline:

```bash
# After successful deployment, always clean up
uipcli solution deploy-uninstall <old-deployment-name> ...
```

## 2. Use deployment naming for cleanup

Include version in deployment names to make cleanup easier:

```bash
# Good naming convention
MySolution-Prod-v1.2.3

# Easy to identify and uninstall old versions
for old_version in 1.2.1 1.2.2; do
  uipcli solution deploy-uninstall MySolution-Prod-v$old_version ...
done
```

## Next steps

After uninstalling deployments:

1. [Delete packages](uploading-and-deleting-solution-packages#deleting-a-package) if they're no longer needed.
2. Review other deployments in the folder for cleanup opportunities.
3. Document deployment history for audit purposes.
