Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Create a DMG File on Mac

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Creating a DMG (Apple Disk Image) file on a Mac packages files and folders into a single, compressed container. It's the standard way to distribute apps and software on macOS, and it also works well for archiving or transferring a group of files. You can make one with the built-in Disk Utility app—no extra software needed. Here's the complete process.

What You'll Need

  • A Mac running macOS (any recent version works; menu names may differ slightly).
  • The files or folder you want to include in the DMG.
  • Enough free disk space to hold the uncompressed data plus the DMG itself.

Step-by-Step

  1. Prepare your source folder. Put everything you want inside the DMG into one folder. Name it clearly—that name will appear as the volume name when the DMG is mounted. For example, if you're distributing an app, include the app file and a shortcut to the Applications folder (drag the Applications folder into the sidebar of a Finder window, then drag the alias from the sidebar into your folder).
  2. Open Disk Utility. Go to Applications > Utilities > Disk Utility, or use Spotlight (Cmd+Space) and type "Disk Utility."
  3. Start a new image. In Disk Utility's menu bar, click File > New Image > Image from Folder (or press Shift+Cmd+N). A file picker will appear.
  4. Select your folder. Choose the folder you prepared and click Choose.
  5. Set the image options. A dialog will appear with these settings:
    • Save As: Type the name for the DMG file itself (e.g., "MyApp.dmg").
    • Where: Choose a destination (Desktop, Downloads, etc.).
    • Name: This is the volume name that appears when the DMG is mounted. It defaults to the folder name—you can change it.
    • Format: Choose read/write if you want the DMG to be editable (you can add or remove files later). Choose compressed to save space, but it becomes read-only. For distribution, compressed is standard.
    • Encryption: Optional. Choose 128-bit or 256-bit AES to password-protect the DMG. If you choose encryption, you'll be asked to set a password.
    • Image Format: Select compressed for the best balance of size and compatibility. Other options include read-only, read/write, and hybrid (for cross-platform use).
  6. Click Save. Disk Utility will create the DMG. The time depends on the size of your files. Once done, you'll see a confirmation message.
  7. Verify and close. The DMG will automatically mount (appear as a disk on your desktop and in Finder). Open it to confirm the files are there. Then unmount it by right-clicking the disk and selecting Eject, or by dragging it to the Trash. Your DMG is ready to distribute or store.

Common Mistakes

  • Forgetting to include an Applications shortcut. If you're distributing an app, users expect to drag it to their Applications folder. Without the shortcut, they may not know what to do.
  • Choosing the wrong format. Selecting "read/write" when you meant "compressed" results in a larger, editable DMG. Conversely, choosing "compressed" when you need to update files later means you'll have to recreate the DMG.
  • Not checking the DMG after creation. Always mount and test the DMG to ensure all files are present and not corrupted.
  • Using the wrong menu. Disk Utility also has "New Image > Blank Image"—that creates an empty DMG, not one from your files. Make sure you pick "Image from Folder."

Tips

  • Use a custom icon. You can change the DMG's volume icon by selecting the mounted volume, pressing Cmd+I, and pasting a custom icon into the top-left of the info window. This makes your DMG look professional.
  • Compress after editing. If you create a read/write DMG, you can later convert it to a compressed, read-only DMG via File > Convert Image in Disk Utility. This is handy for final distribution.
  • Password protect sensitive files. Use the encryption option when the DMG contains personal or confidential data.
  • Keep a master copy. If you plan to update the DMG later, keep a read/write version as your master, then convert to compressed for distribution.

Troubleshooting

If the DMG doesn't mount after creation: Try double-clicking the DMG file in Finder. If it still doesn't mount, open Disk Utility, go to File > Open Disk Image, and select the DMG. If that fails, the file may be corrupted—recreate it.

If the DMG is larger than expected: Check the image format. If you selected "read/write" or "UDIF", the DMG is not compressed. Use File > Convert to change it to compressed.

If you forgot the password for an encrypted DMG: There is no way to recover it. You'll need to recreate the DMG without encryption (if you still have the original files).

If the DMG won't open on another Mac: Ensure the other Mac is running a compatible macOS version. Older macOS versions may not open DMGs created with newer formats. Try creating the DMG with the "UDIF" (read-only) format for maximum compatibility.

Frequently Asked Questions

Can I create a DMG from a folder without Disk Utility?

Yes, you can use the hdiutil command in Terminal, but Disk Utility is easier for most users. The command would be: hdiutil create -volname "MyVolume" -srcfolder /path/to/folder -ov -format UDZO output.dmg.

How do I add files to an existing DMG?

If the DMG is read/write, mount it, copy files into it, then eject. If it's compressed or read-only, you'll need to recreate it from the original source folder.

Can I make a bootable DMG?

Yes, but that's more advanced. You'd typically use hdiutil to convert a bootable disk image. For most users, Disk Utility's "Image from Folder" is not for bootable media—that requires special formatting.

What's the difference between DMG and ZIP?

DMG is a disk image that preserves file permissions and metadata, making it ideal for app distribution. ZIP is a simple archive that may not preserve permissions. For most file transfers, ZIP is fine, but for macOS apps, DMG is the standard.

Why does my DMG show a different name than the file?

The DMG file has a filename (e.g., "MyApp.dmg"), but when mounted, it displays the volume name you set in the "Name" field. These can be different; the volume name is what users see after double-clicking.

Is there a size limit for DMG files?

No practical limit for typical use, but very large DMGs (tens of GB) may take time to create and open. For huge transfers, consider splitting or using a different format.