What is .pkg?

.pkg files are macOS installer packages used by the Apple Installer system to install applications, system components, and configuration payloads. A PKG describes what files to place where, what scripts to run, and how to register the software with the operating system.

This quick guide explains when to use .pkg files, how to open them on any device, and how to share them instantly with FileXhost.

When to use .pkg files

  • You are distributing macOS software that needs a guided installer or system-level changes.
  • You want to install files into privileged locations like /Applications, /Library, or system directories.
  • You need a format that works well with MDM solutions and enterprise deployment tooling.
  • You are packaging drivers, plugins, or utilities that require pre- or post-install scripts.

How to open .pkg files

On macOS, double-clicking a PKG file launches the built-in Installer app, which walks the user through the installation steps. Advanced users and admins can run PKG installs via the `installer` command in Terminal for scripted or silent deployments. Tools like pkgutil and productbuild can inspect or create PKG packages. When you upload PKG files to FileXhost, they can be shared as downloadable installers for macOS users.

Algorithm details

PKG files encapsulate one or more installation payloads plus metadata and optional pre/post-install scripts. Modern PKG formats use flat packages that can be signed and notarized. The macOS Installer reads package metadata (distribution XML, BOMs, payloads) to determine what to install and how to handle upgrades, receipts, and rollback information.

Browser & platform support

  • Desktop: Browsers on macOS download PKG files as binaries; double-clicking them launches the Installer app.
  • Mobile: iOS and other mobile platforms cannot run PKG files; they can only store or transfer them.
  • OS: Only macOS uses PKG natively. Other operating systems require specialized tools to inspect or unpack PKG contents.

Format comparison

FeatureDetails
PKG vs DMGDMG is a disk image container; PKG is an installer format. A DMG often contains a PKG when a richer installer is needed.
PKG vs .app BundleAn .app bundle is the actual application; a PKG installs that bundle (and other resources) into the correct locations.
PKG vs ZIPZIP is a generic archive format; PKG encodes installation logic, scripts, and metadata for the macOS Installer.
Enterprise UsePKG is preferred for managed deployments via MDM or enterprise tools, while DMG is more common for direct user downloads.

How to create pkg files

  • productbuild: Use Apple's productbuild and pkgbuild tools to create signed, flat PKG installers.
  • Xcode: Some Xcode workflows export signed PKG files for distribution and notarization.
  • Third-Party Tools: Installer builders and packaging tools can generate PKG files from app bundles and configuration.
  • MDM/IT Pipelines: Enterprise packaging workflows often produce PKG artifacts for deployment to fleets of macOS devices.

How to convert pkg files

  • FileXhost: Host PKG installers on FileXhost so users and administrators can download and run them on macOS.
  • Extraction Tools: Use tools like pkgutil or third-party packages to inspect or extract PKG contents for debugging.
  • Repackaging: IT teams may repackage software into PKG format to standardize deployment, though this can affect vendor support.
  • Notarization: Use Xcode or command-line tools to notarize PKGs for modern macOS security requirements.

Advantages & disadvantages

Advantages

  • Native installer format for macOS with strong system integration
  • Works well with MDM and enterprise deployment tooling
  • Supports scripts, complex payloads, and system-level installs

Disadvantages

  • Apple-specific; not suitable for non-macOS platforms
  • Authoring and signing can be more complex than simple DMG or ZIP distribution
  • Requires careful handling to meet notarization and Gatekeeper requirements

Tools & software

Authoring

pkgbuild, productbuild, Xcode, third-party packaging tools

Deployment

Jamf, Munki, Intune, other macOS MDM and software management platforms

Inspection

pkgutil, Pacifist, command-line tools for viewing package metadata

Frequently asked questions

How do I install a PKG file on macOS?

Double-click the PKG file to open it in the Installer app, then follow the prompts. For scripted installs, use the `installer` command with appropriate options in Terminal.

Is a PKG file safe to open?

Only open PKG files from trusted developers or organizations. macOS Gatekeeper and notarization checks help, but you should still verify the source and use signed, notarized installers.

Should I ship my app as a DMG or a PKG?

DMGs are great for simple drag-and-drop installs. PKGs are better when you need controlled installation to system locations, scripts, or enterprise deployment.

Can I inspect the contents of a PKG?

Yes. Use pkgutil, Pacifist, or similar tools to view payloads, scripts, and metadata. This is useful for debugging or verifying what an installer will change.

Technical specs

File type
Executable
Extension
.pkg
MIME type
application/vnd.apple.installer+xml, application/octet-stream
Compression
Uncompressed
Max file size on FileXhost
Up to 25 MB per file on the free plan and up to 1 GB on Pro FileXhost accounts.

Share .pkg files instantly

Upload your .pkg file to FileXhost to get a clean, shareable URL in seconds. View the file in a modern browser, protect access with optional settings, and let others download it without any confusing ads or cluttered file pages.

Upload .pkg file