MainspringGuides › Zip & DMG
macOS Guide

Stop Safari auto-opening zip and dmg files

Updated August 2026 · 4 min read

Download a .zip in Safari and it expands into a folder before you blink; download a .dmg and a disk image mounts on your desktop on its own. That's Safari's "open safe files" setting treating archives and disk images as safe to open automatically. Untick it in Safari → Settings → General and both types just sit in Downloads until you open them yourself.

Why zips unzip and dmgs mount by themselves

Safari's "safe" list includes archives and disk images, and "opening" them means expanding or mounting. So a .zip gets unarchived — leaving you with both the archive and an unpacked folder cluttering Downloads — and a .dmg gets mounted, adding a drive to your desktop and often auto-showing an installer window. It's meant to save a step, but it makes a mess, and it means a disk image starts presenting its contents before you've decided you want it. Turning it off gives you back the moment of choice.

Turn off auto-open for archives and images

  1. Open Safari and choose Safari → Settings (Cmd+,).
  2. Go to the General tab.
  3. Uncheck Open "safe" files after downloading.

Now a downloaded .zip stays zipped and a .dmg stays a file. To do it from Terminal instead — with the undo line ready:

# Keep zips and disk images from opening automatically
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false

# Undo — allow safe files to auto-open again
defaults write com.apple.Safari AutoOpenSafeDownloads -bool true

Quit and reopen Safari to apply it. Note the command only works if Terminal has Full Disk Access, since Safari's preferences live in a protected container — otherwise use the checkbox. Verified on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

Now you're in control

With auto-open off, you open archives and images deliberately:

Do it in one click

Mainspring turns Safari's "open safe files" setting into a labelled, reversible toggle — no Terminal, no Full Disk Access — so zips and disk images stop opening on their own. It's one of 90+ hidden macOS settings it exposes.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

Working with other archive types

This setting covers the archive formats Safari expands and the disk images it mounts. For formats macOS doesn't open natively, you'll need a tool either way — see opening RAR files — and if leftover disk images pile up, clearing out old .dmg files reclaims real space.