As part of building a custom OS X installer ISO for my ESXi server, I wanted the ability to include Server.app as part of my installation process. One problem with that is that Server.app is only available via the Mac App Store and doesn’t have a separate installer available for download.
However, if you have already purchased Server.app, it is possible to get a copy of the Server.app installer from the Mac App Store. See below the jump for details.
To install Server.app, the Mac App Store will download an installer package from Apple, install Server.app, then delete the installer package as part of the post-installation clean-up. However, it is possible to make the App Store leave behind a copy.
1. Go to a machine that does not have Server.app installed.
2. If it is open, quit out the App Store application
3. Open Terminal and run the following command:
defaults write com.apple.appstore ShowDebugMenu -bool true
4. Launch the App Store application. It should now have a Debug menu showing.
5. If needed, sign into the App Store and go to Purchases. From there, find OS X Server.
6. Begin the installation process for OS X Server, then click the Pause button to pause the download.
7. Under the Debug menu, select Show Download Folder…
At this point, you should see a folder inside the displayed folder. In that directory, you’ll see a package with a long randomized name. That will be the Server.app installer package.
8. In Terminal, run the following command:
ln /path/to/package_from_mac_app_store_name_here.pkg /path/to/name_you_want_to_save_package_as_here.pkg
Using the ln command will set up a hard link to the downloaded installer package. This will create name_you_want_to_save_package_as_here.pkg in the location specified, which is then linked to the contents of package_from_mac_app_store_name_here.pkg. The reason to do this is that the hard-linked name_you_want_to_save_package_as_here.pkg will not be deleted when the Mac App Store deletes package_from_mac_app_store_name_here.pkg from the Mac as part of the post-installation cleanup.
9. Go back to the App Store and click the Resume button to have the installation complete.
10. Once the installation finishes, name_you_want_to_save_package_as_here.pkg will available as a signed Server.app installer package. From there, you can use it on its own or as part of a deployment workflow.
Hat tip to @tvsutton for letting me know about the Mac App Store’s Debug menu and how to use hard links to capture downloads from the Mac App Store.