> For the complete documentation index, see [llms.txt](https://docs.intunemacadmins.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intunemacadmins.com/deploy-files-on-a-mac/how-to-deploy-files.md).

# How to deploy Files on a Mac

Deploying files to Intune-managed macOS devices can be challenging. This guide will walk you through the process of creating a .pkg application to securely deploy your files on macOS devices.

{% hint style="success" %}
This method is particularly useful for deploying files like fonts, Teams backgrounds, and license files.
{% endhint %}

## Why Use This Method?

There are several advantages to using a .pkg application for file deployment:

* No need to host files remotely or in the cloud
* No need for secrets in scripts
* Increased security compared to public endpoints or Azure Blob Storage

The main potential disadvantage is the initial setup time, which takes about 10 minutes, and the requirement of a macOS device for packaging.

## Creating the PKG Application

1. **Create the folder structure**
   * Organize your folders into two main directories: `Content` and `Scripts`
   * The `Content` folder will contain the files you want to deploy
   * The `Scripts` folder will contain the `postinstall` script
2. **Create the postinstall script**
   * Place the script in the `Scripts` folder
   * Make it executable with: `chmod a+x postinstall`
   * Remove any file extensions (e.g., .sh)
   * [View the full postinstall script example](https://github.com/ugurkocde/Intune/blob/main/MacOS/Create%20pkg%20/postinstall)
3. **Execute pkgbuild to create the .pkg file**
   * Run the following command in the terminal:

     ```
     pkgbuild --root Content --scripts Scripts --identifier com.yourdomain.yourapp --install-location /var/tmp --version 1.0 YourApp.pkg
     ```
   * Replace `com.yourdomain.yourapp` with your organization's identifier
   * Replace `YourApp.pkg` with the desired name for your .pkg file
4. **Upload the .pkg file to Intune**
   * Go to the Microsoft Intune portal
   * Navigate to **Apps** > **All apps** > **Create**
   * Select **macOS app (PKG)**
   * Upload your .pkg file
   * Configure the app settings as needed
   * Assign the app to your desired groups or users
5. **Deploy the app to your devices**
   * The app will be installed on the devices in the assigned groups or users
   * The files will be deployed to the specified location on the devices

{% hint style="success" %}
You can also use this method to deploy other types of files, such as scripts or configuration files.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intunemacadmins.com/deploy-files-on-a-mac/how-to-deploy-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
