# .dmg MIME Type: application/x-apple-diskimage

> macOS disk images, the usual way to distribute Mac apps outside the App Store.

- MIME type: `application/x-apple-diskimage`
- Extensions: .dmg
- Content-Type header: `application/x-apple-diskimage`
- Compress in transit: no (already compressed)

## Good to know

- DMG files have no signature at the start; the identifying `koly` block sits in the last 512 bytes.
- macOS checks downloaded apps with Gatekeeper, which wants them signed and notarized. The Content-Type plays no part.

## Server configuration

### nginx (inside the types block in mime.types)

```
application/x-apple-diskimage dmg;
```

### Apache (.htaccess or server config)

```
AddType application/x-apple-diskimage .dmg
```

### Express

```
res.set("Content-Type", "application/x-apple-diskimage");
```

### Python

```
import mimetypes

mimetypes.add_type("application/x-apple-diskimage", ".dmg")
```

### HTML file input

```
<input type="file" accept=".dmg,application/x-apple-diskimage">
```

## FAQ

### What is the MIME type for .dmg files?

`application/x-apple-diskimage`.

### What Content-Type header should a .dmg file be served with?

`Content-Type: application/x-apple-diskimage`. It's already compressed, so servers shouldn't gzip it.

## Related types

- [.iso — application/x-iso9660-image](https://www.devkult.com/mime/iso.md)
- [.zip — application/zip](https://www.devkult.com/mime/zip.md)

Open the interactive page: https://www.devkult.com/mime/dmg