Overview
m87 provides powerful deployment management for running applications on remote devices. Deployments allow you to register jobs that execute automatically when devices come online, making them ideal for managing fleets of intermittently-connected edge devices.Use deployments when:
- Your devices are not always online
- You need to deploy to multiple devices
- You want automated deployment workflows
- You need to observe and monitor running services
- You want deployment rollback capabilities
Deploy Command
Add a run spec (docker-compose or custom) to a deployment.Syntax
Options
| Flag | Description |
|---|---|
--type <TYPE> | Spec type: auto, compose, runspec, or deployment (default: auto) |
--name <NAME> | Optional display name for the run spec |
--deployment-id <ID> | Add to specific deployment (defaults to active deployment) |
Examples
How Deploy Works
- Automatic conversion: Docker Compose files are automatically converted to m87 run specs
- Active deployment: If no deployment ID is specified, the file is added to the active deployment
- Auto-creation: If no active deployment exists, a new one is created automatically
- Execution: The deployment runs when the device is online
Undeploy Command
Remove a run spec from a deployment.Syntax
Options
| Flag | Description |
|---|---|
--deployment-id <ID> | Remove from specific deployment (defaults to active) |
Examples
Undeploy removes the run spec from the deployment configuration but doesn’t immediately stop running containers. The deployment system handles cleanup according to the spec’s configuration.
Deployment Subcommands
Manage deployments on devices with thedeployment subcommand group.
List Deployments
View all deployments for a device.- Deployment ID
- Creation date
- Active status
- Number of run specs
Create New Deployment
Create a new deployment.Show Deployment Details
View details of a deployment including all run specs.Deployment Status
Check the execution status of a deployment.- Deployment execution state
- Run spec states (pending, running, completed, failed)
- Health check results
- Timestamps
- Logs (with
--logsflag)
Activate Deployment
Set which deployment is active.Only one deployment can be active at a time. Activating a new deployment deactivates the previous one.
View Active Deployment
Check which deployment is currently active.Remove Deployment
Delete a deployment.Clone Deployment
Duplicate an existing deployment.- Create staging/production variants
- Test configuration changes safely
- Prepare deployment rollbacks
Update Deployment
Modify an existing deployment (advanced).The update command supports advanced operations like removing, replacing, moving, and renaming run specs. See
m87 <device> deployment update --help for detailed options.Real-World Workflows
Initial Deployment
Update Deployment
Staging and Production
Rollback Deployment
Fleet Deployment
Docker Compose Conversion
When you deploy a Docker Compose file, m87 automatically converts it to a run spec.Example Conversion
Input (docker-compose.yml):- Converting compose format to m87 run spec
- Uploading build contexts if needed
- Configuring restart policies
- Setting up environment variables
- Managing container lifecycles
Deployment vs Direct Docker Commands
| Feature | Deployment | Direct Docker |
|---|---|---|
| Works when offline | ✓ Queued for execution | ✗ Requires online device |
| Automatic retry | ✓ Built-in | ✗ Manual |
| Health monitoring | ✓ Continuous | ✗ Manual |
| Rollback support | ✓ Easy | ✗ Manual |
| Fleet management | ✓ Centralized | ✗ Per-device |
| Immediate execution | Depends on device | ✓ Immediate |
| Simple one-off tasks | ✗ Overhead | ✓ Simple |
Monitoring Deployments
Best Practices
Related Commands
- Docker Integration - Direct Docker commands
- Device Access - Monitor deployed applications
- File Transfer - Deploy application files