Mac – Generic DMG Installer – JumpCloud
November 13, 2025
5 min read
ByNetNXT
Purpose
Install macOS applications distributed as .dmg files using a single reusable script executed from JumpCloud → Commands. This is ideal for Chrome, Firefox, Slack, and similar DMG-based apps.
Prerequisites
- Admin access to the JumpCloud Admin Portal
- Target macOS devices enrolled in JumpCloud
- A direct DMG download URL or a URL that redirects to a DMG (validated via headers)
- Network egress allowed to the app vendor’s CDN
Tip: If you’re setting up new Macs, see our SOP on Automated macOS Device Enrollment via JumpCloud MDM (ADE + ABM + ZTE)
to make this part of your zero-touch flow.
Step-by-Step Instructions
Step 1 — Create the command
- Log in to JumpCloud Admin Portal.
- Go to Devices → Commands.
- Click + to add a new command.
- Select macOS (Shell).
- Give the command a clear name (for example, Install – Chrome (DMG)).
Step 2 — Configure the script
- In the script, set DownloadUrl="DOWNLOAD_URL" to the app’s DMG link.
- The URL must either:
- End with .dmg, or
- Return a Location header that points to a DMG (the script checks this).
You can quickly verify with:
curl -s --head "<your URL>"
Look for a Location header ending in .dmg.
Step 3 — Scope and run
- Assign the command to the target device(s) or device group.
- Click Save, then Run (or schedule as needed).
- Monitor the command logs for “Copied … to /Applications” and cleanup messages.
Command (use as-is; set the DownloadUrl)
#!/bin/bash # *** USAGE *** Version: 1.2 # NOTE: Designed for DMG files only (not .pkg, .zip, or DMGs containing .pkg). # Set the DMG download URL below. DownloadUrl="DOWNLOAD_URL" ### Modify below this line at your own risk! # Locate DMG Download Link From URL regex='^https.*.dmg
