Skip to main content

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

Examples

How Deploy Works

  1. Automatic conversion: Docker Compose files are automatically converted to m87 run specs
  2. Active deployment: If no deployment ID is specified, the file is added to the active deployment
  3. Auto-creation: If no active deployment exists, a new one is created automatically
  4. Execution: The deployment runs when the device is online
The CLI automatically detects whether your file is a Docker Compose file or a custom run spec by looking for the services key in the YAML.

Undeploy Command

Remove a run spec from a deployment.

Syntax

Options

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 the deployment subcommand group.

List Deployments

View all deployments for a device.
Output includes:
  • Deployment ID
  • Creation date
  • Active status
  • Number of run specs

Create New Deployment

Create a new deployment.
Creating multiple deployments allows you to prepare different configurations and switch between them easily.

Show Deployment Details

View details of a deployment including all run specs.

Deployment Status

Check the execution status of a deployment.
Status information includes:
  • Deployment execution state
  • Run spec states (pending, running, completed, failed)
  • Health check results
  • Timestamps
  • Logs (with --logs flag)

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.
Removing a deployment cannot be undone. Make sure you have backups if needed.

Clone Deployment

Duplicate an existing deployment.
Use cases for cloning:
  • 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):
Deployed to device:
The CLI handles:
  • 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

Choose deployments for:
  • Production applications
  • Fleet management
  • Intermittent connectivity
  • Automated workflows
Choose direct docker commands for:
  • Development and debugging
  • One-off tasks
  • Immediate execution needs
  • Interactive work

Monitoring Deployments


Best Practices

Deployment best practices:
  1. Use version tags - Tag deployments with version numbers for easy tracking
  2. Test in staging - Create staging deployments before production
  3. Keep backups - Clone deployments before making major changes
  4. Monitor logs - Use --logs flag to catch issues early
  5. Use meaningful names - Name run specs clearly with --name flag
  6. Document configs - Add comments to docker-compose files
  7. Regular cleanup - Remove old deployments you no longer need