File extensions

What a .pkg file is, and how to open one

macOS installer package · Installer

On a Mac, a .pkg is an installer: double-click it and Installer.app walks through the steps. On Windows it will not install at all, because the contents are macOS software, though an archiver can still open it to look inside. The extension is also used by PlayStation and BSD systems for unrelated formats.

What a .pkg file actually is

A macOS package is an archive with a manifest. Inside are the files to install, a list saying where each one goes, and optional scripts that run before and after. macOS reads that and performs the installation itself.

It is the alternative to a .dmg. A disk image is something you mount and drag an app out of; a package installs, which is why software that needs to place components outside the Applications folder ships one.

Why it will not open

Almost always one of two things. You are on Windows, where nothing can install a macOS package no matter which tool you try. Or you are on a Mac and Gatekeeper has blocked it because the package is unsigned or not notarised, which produces a message about an unidentified developer rather than an obvious refusal.

The other way Mac software arrives

Step by step

Windows

  1. 01Windows cannot install a .pkg. There is no application that does it and no converter that produces a working Windows install, because what is inside is compiled for macOS.
  2. 02You can still look inside. 7-Zip opens the container and shows the payload, which is useful for checking what a package claims to contain.
  3. 03If you actually need the software, go back to the publisher and look for their Windows build. Most cross-platform software offers one, and its download and hash will be listed here if we index it.

macOS

  1. 01Double-click the file. Installer.app opens and takes you through it, and it will ask for your password when the package needs to write outside your home folder.
  2. 02If macOS refuses it as being from an unidentified developer, that is Gatekeeper. Right-click the file and choose Open to get the option to proceed, or allow it under System Settings, Privacy and Security.
  3. 03From Terminal: sudo installer -pkg "file.pkg" -target / installs it, which is the scriptable equivalent.
  4. 04To inspect one without installing: pkgutil --expand "file.pkg" outputfolder unpacks it, and lsbom on the Bill of Materials inside lists every file it would place.
  5. 05Once installation finishes the .pkg is just the installer and can be deleted. Nothing depends on keeping it.

What usually goes wrong

A .pkg can run scripts as root. A .dmg cannot

This is the difference that matters for trust. Dragging an app out of a disk image copies a folder and nothing else happens. A package installs through macOS and may carry pre-install and post-install scripts that run with administrator rights, which is exactly what you granted when you typed your password. That capability is legitimate and widely used, and it is also why a large share of macOS malware arrives as a .pkg rather than a .dmg. Where it came from matters more here than with almost any other format.

Signed and notarised are two different checks

A signature identifies the developer. Notarisation means Apple also scanned the package and issued a ticket for it, which is what macOS looks for before opening something downloaded from the web. A package can be signed and not notarised, and Gatekeeper will still object. Clicking through that warning is a decision worth making deliberately rather than reflexively.

The same extension is used by things that are not this

PlayStation consoles use .pkg for their own package format, and several BSD systems use it for theirs. They share three letters and nothing else: none of them opens with the tools described here, and a PlayStation package will not install on a Mac. We cover the macOS installer, which is the one that turns up when you download Mac software.

Programs that open .pkg

Our pick, in order. Every one links to the publisher's official download URL and the SHA-256 hash of the installer. Once you have downloaded it, you can check the file against our index before you run it.

If you end up downloading one of these from somewhere other than the publisher, what you can and cannot verify about that is worth two minutes.

Common questions

What is a .pkg file?
On macOS it is an installer package: an archive containing the files to install, a manifest saying where each goes, and optionally scripts that run during installation. Double-clicking one opens Installer.app. The same extension is used by PlayStation and BSD systems for entirely different formats.
How do I open a .pkg file on Windows?
You cannot install one, and that is not a missing-software problem: a macOS package contains software compiled for macOS, so there is nothing for Windows to run. You can open it with 7-Zip to see the contents. If you need the program itself, look for the publisher’s Windows build.
How do I install a .pkg file on a Mac?
Double-click it and follow Installer.app, entering your password when asked. From Terminal, sudo installer -pkg "file.pkg" -target / does the same thing and is what you want in a script.
What is the difference between a .pkg and a .dmg?
A .dmg is a disk image you mount and drag an application out of, which copies a folder and nothing more. A .pkg runs an installation through macOS, can place files anywhere and can execute scripts with administrator rights. That extra capability is the reason to care where a .pkg came from.
Can I extract a .pkg without installing it?
Yes. On macOS, pkgutil --expand "file.pkg" outputfolder unpacks it, and the Bill of Materials inside lists every file it would place. On Windows, 7-Zip opens the container. Either way you are inspecting the contents, not installing them.
Can I delete a .pkg file after installing?
Yes. The package is only the installer, so once installation is complete nothing depends on it. Keeping it is only useful if you want to reinstall the same version later without downloading again.
Are .pkg files safe?
The format itself is normal and used by most Mac software vendors, but it can run scripts with administrator rights during installation, which makes the source more important than usual. Prefer the publisher’s own download, take Gatekeeper’s warnings seriously rather than clicking past them, and check the file against a published hash where one exists.

Related formats