DMG vs PKG: which one to ship your Mac app in
A DMG is a disk image the user drags your app out of. A PKG is an installer that puts files where it's told. Most Mac apps should ship as a DMG, and a few really do need a PKG. Here's how to tell which one you are.
If you distribute a Mac app outside the App Store, you have to pick a container for the download. The two main choices are a .dmg and a .pkg.
The short answer: ship a DMG if your app is a single .app bundle that can live in the Applications folder. Ship a PKG if you need to install anything outside that bundle, such as a system-wide helper, a launch daemon, a driver, or audio plug-ins in the Library folder. That one question decides it for nearly every app.
What a DMG is
A DMG is a disk image: a file that macOS mounts as if it were a drive. The user double-clicks it, a window opens showing your app (often next to a shortcut to the Applications folder), and they drag the app across. Then they eject the image and delete it.
Nothing is "installed" in the Windows sense. The app bundle is copied, and that's the whole process. No scripts run and no admin password is needed, unless the user's account can't write to Applications.
What a PKG is
A PKG is an installer package. The user double-clicks it and macOS's Installer app walks them through a few screens: introduction, license, destination, install. The package contains a payload (the files) and instructions for where each file goes, and it can run scripts before and after copying.
That's its power. A PKG can put files anywhere on the system, set permissions, load a launch daemon, and run setup logic. It usually asks for an admin password, because it's usually writing somewhere that needs one.
DMG vs PKG side by side
| DMG | PKG | |
|---|---|---|
| What it is | A mountable disk image | An installer package |
| How the user installs | Drags the app to Applications | Clicks through the Installer |
| Can install outside the app bundle | No | Yes, anywhere |
| Can run scripts | No | Yes, before and after install |
| Admin password | Usually not needed | Usually needed |
| Uninstalling | Drag the app to the Trash | No built-in uninstaller |
| Signing certificate | Developer ID Application | Developer ID Installer |
| Notarization | Yes | Yes |
| Tools to build it | hdiutil, create-dmg |
pkgbuild, productbuild |
| Fits managed deployment (MDM) | Works, less convenient | The standard format |
| Typical for | Regular apps | Plug-ins, drivers, system tools, enterprise software |
When a DMG is the right choice
- Your app is self-contained. Everything it needs is inside the
.app. - You want the lightest install: no password, no wizard.
- You want users to be able to remove it by dragging it to the Trash.
- You use an auto-updater like Sparkle that replaces the app bundle in place.
This describes most Mac apps: editors, utilities, menu bar apps, design tools, Electron and Tauri apps.
The one real weakness of a DMG is that some users never drag the app out. They run it straight from the mounted image, or from the Downloads folder. macOS then runs the app from a randomised read-only location (a Gatekeeper feature called app translocation), which breaks auto-updates and anything else that expects the app to stay where it is. That's why good DMGs make the "drag me to Applications" arrow obvious, and why many apps check on launch whether they're in Applications and offer to move themselves.
When you need a PKG
- You install system-wide components: launch daemons, privileged helpers, kernel or system extensions, drivers.
- You install files in shared locations: audio plug-ins (
/Library/Audio/Plug-Ins), fonts, command-line tools in/usr/local/bin, screen savers, preference panes. - You need scripts to run at install time, to migrate settings or register something.
- You sell to companies that deploy software with MDM. IT teams push PKGs to fleets of Macs with tools like Jamf, and a PKG is what they'll ask you for.
- You ship several components that the user picks from, for example plug-in formats (VST3, AU, AAX).
If none of those apply, a PKG just adds friction: more clicks, a password prompt, and no clean way to uninstall.
Uninstalling is the PKG's real cost. macOS has no "remove this package" feature, so files the installer scattered around the system stay there unless you ship an uninstaller or document what to delete. If you use a PKG, do one of those.
What about a ZIP?
There's a third option people forget: zip the .app. Safari unzips it automatically, and the user gets the app in Downloads. It's the smallest and simplest, and it's what many auto-updaters download behind the scenes.
As the main download it's weaker than a DMG. There's no window telling the user to move the app to Applications, so more people run it from Downloads and hit the translocation problem above. If you do ship a zip, create it with ditto -c -k --keepParent MyApp.app MyApp.zip; other zip tools can drop symlinks and metadata, which breaks the code signature.
A common setup is a DMG for the first download from your website, and a zip for the updates the app fetches itself.
Signing and notarizing each one
Both formats need to be signed and notarized, or Gatekeeper will block them on your customers' Macs. The detail that trips people up is that they use different certificates.
For a DMG: sign the app with your Developer ID Application certificate, build the DMG, sign the DMG with the same certificate, then notarize and staple it.
codesign --force --options runtime --timestamp --sign "Developer ID Application: Your Name (TEAMID)" MyApp.app
hdiutil create -volname "MyApp" -srcfolder MyApp.app -ov -format UDZO MyApp.dmg
codesign --timestamp --sign "Developer ID Application: Your Name (TEAMID)" MyApp.dmg
xcrun notarytool submit MyApp.dmg --keychain-profile "notary" --wait
xcrun stapler staple MyApp.dmg
For a PKG: sign the app with Developer ID Application as before, then build and sign the package with your Developer ID Installer certificate, then notarize and staple.
pkgbuild --component MyApp.app --install-location /Applications \
--sign "Developer ID Installer: Your Name (TEAMID)" MyApp.pkg
xcrun notarytool submit MyApp.pkg --keychain-profile "notary" --wait
xcrun stapler staple MyApp.pkg
pkgbuild makes a single component package. If you need the Installer to show a license, let the user choose components, or combine several packages, wrap it with productbuild.
If a signed build still shows "is damaged and can't be opened" after download, the signature was broken somewhere between signing and packaging. The developer guide to the "app is damaged" message walks through each cause and its fix, and the page on xattr -cr explains what the workaround does.
How updates differ
With a DMG-distributed app, updating is replacing one bundle. Sparkle, the standard open-source updater for Mac apps, downloads the new version, swaps the app and relaunches. It needs no admin rights when the app is somewhere the user can write.
With a PKG, an update usually means running an installer again, with the password prompt again. Sparkle can install package-based updates, but it's a heavier experience, and many PKG-distributed products end up writing their own update helper. If frequent updates matter to you, that's another reason to stay with a DMG when you can.
Whichever you choose, if you sell the app you'll want updates to go only to customers with a valid license. LicenseSeat hosts your release files and serves a license-aware update feed; see the guide to shipping desktop updates.
So, DMG or PKG?
- Regular app, everything inside the bundle: DMG.
- Anything installed outside the bundle, or install scripts: PKG.
- Audio plug-ins: PKG.
- Selling to enterprises with managed Macs: offer a PKG, possibly alongside a DMG.
- Mac App Store: neither is your choice; Xcode handles the upload.
- Not sure: DMG. You can add a PKG later if a customer needs one.
After packaging comes selling. The guide to licensing macOS apps covers payments, license keys and Sparkle updates for apps sold outside the App Store, and how to sell software online covers the business side. LicenseSeat handles the licensing and takes 0% of your revenue.
Common questions about DMG and PKG
What is the difference between a DMG and a PKG file?
A DMG is a disk image that holds your app; the user copies the app out by dragging it. A PKG is an installer that copies files to locations it specifies and can run scripts. A DMG delivers an app, and a PKG performs an installation.
Is DMG or PKG better for a Mac app?
For a self-contained app, DMG: it's simpler to install, needs no password, and uninstalls by dragging to the Trash. PKG is better only when you have to install files outside the app bundle or deploy through MDM.
Is a PKG file safe to open?
A PKG can run scripts with admin rights, so it can do more to your system than a dragged app can. Open one only from a developer you trust. A properly signed and notarized package shows the developer's identity when you click the lock icon in the Installer window.
Can a DMG contain a PKG?
Yes. Some products ship a DMG with a PKG inside, mostly to show a branded window or to bundle an uninstaller next to the installer. It works, but it's two steps for the user, and you have to sign and notarize both.
Do I need to notarize both the app and the DMG?
Notarize the outermost thing you distribute. If you submit the DMG, Apple checks the app inside it as well, and you staple the ticket to the DMG. The app inside must already be signed with the hardened runtime.
How do I uninstall an app installed from a PKG?
There's no built-in uninstaller. Delete the app from Applications, then remove whatever else the package installed, which the developer should document or provide an uninstaller for. pkgutil --pkgs lists installed packages and pkgutil --files <package-id> lists what one installed.
Does Sparkle work with PKG installers?
Sparkle supports package-based updates, but its normal mode replaces an app bundle from a zip or DMG, and that's the smoother experience. Apps that update often are usually better off as a DMG.