{"id":37,"date":"2019-01-25T06:00:00","date_gmt":"2019-01-25T06:00:00","guid":{"rendered":"https:\/\/www.alansiu.net\/munkiguide\/?p=37"},"modified":"2025-08-07T04:51:52","modified_gmt":"2025-08-07T04:51:52","slug":"reposetup","status":"publish","type":"post","link":"https:\/\/www.alansiu.net\/munkiguide\/reposetup\/","title":{"rendered":"Setting up a server for the Munki repository"},"content":{"rendered":"<h2>Before you begin&#8230;<\/h2>\n<p>Please read the following before you start rolling up your sleeves and setting up Munki:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.alansiu.net\/munkiguide\/why-should-your-school-use-munki-to-manage-its-macs\/\">Why should your school use Munki to manage its Macs?<\/a><\/li>\n<li><a href=\"https:\/\/www.alansiu.net\/munkiguide\/basic-requirements-for-munki\/\">Basic requirements for Munki<\/a><\/li>\n<li><a href=\"https:\/\/www.alansiu.net\/munkiguide\/how-does-munki-work\/\">How does Munki work?<\/a><\/li>\n<\/ul>\n<h3>tl;dr<\/h3>\n<p>This guide will walk you through getting set up a certain way so you can get up and running quickly with some sensible defaults. There are many ways to set up Munki. After you get really comfortable with it, for example, you may want to change things up a bit (for example, run Nginx instead of Apache or use Linux instead of macOS). Covering all the ways to run Munki is not <a href=\"https:\/\/www.alansiu.net\/munkiguide\/about\/\">the point of this site<\/a>.<\/p>\n<h2>Turning on Apache<\/h2>\n<h3>Don&#8217;t use Server.app<\/h3>\n<p>On your Mac Mini (or whatever Mac you&#8217;re setting aside to be your server), do not use Server.app. Make sure Server.app has either never touched that Mac or that you&#8217;ve completely removed it. <a href=\"https:\/\/support.apple.com\/en-us\/HT208312\" target=\"_blank\" rel=\"noopener noreferrer\">Starting with Server 5.7.1, it may even be a non-issue, since Websites has been stripped out of it<\/a>. That was in 2022, so I hope it doesn&#8217;t need to be said, but I&#8217;ll said it anyway: don&#8217;t use Server.app.<\/p>\n<p>We&#8217;re going to use the built-in Apache.<\/p>\n<h3>Turning on the built-in Apache<\/h3>\n<p>Go to <strong>\/Applications\/Utilities\/Terminal.app<\/strong> and paste in this command to turn on Apache:<\/p>\n<p><code>sudo apachectl start<\/code><\/p>\n<p>If it worked, you should be able to go to <a href=\"http:\/\/localhost\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/localhost<\/a> and see <strong>It works!<\/strong>.<\/p>\n<h2>Creating the directories needed for your Munki repo<\/h2>\n<p>Paste in these commands to create subdirectories in \/Users\/Shared for the Munki repo<\/p>\n<p><code>cd \/Users\/Shared\/<br \/>\nmkdir munki_repo<br \/>\nmkdir munki_repo\/catalogs<br \/>\nmkdir munki_repo\/icons<br \/>\nmkdir munki_repo\/manifests<br \/>\nmkdir munki_repo\/pkgs<br \/>\nmkdir munki_repo\/pkgsinfo<\/code><\/p>\n<p>Let&#8217;s set proper permissions for these directories:<\/p>\n<p><code>chmod -R a+rX munki_repo<\/code><\/p>\n<p>Now, we&#8217;re going to create a symlink from the munki_repo folder we created in <code style=\"white-space: nowrap;\">\/Users\/Shared<\/code> to the <code style=\"white-space: nowrap;\">\/Library\/WebServer\/Documents<\/code> directory (which is where Apache looks to serve up files):<\/p>\n<p><code>sudo ln -s \/Users\/Shared\/munki_repo \/Library\/WebServer\/Documents\/<\/code><\/p>\n<p>Now you should have an empty Munki repo. In order to populate it, we&#8217;ll have to install Munki tools.<\/p>\n<h2>Setting up Munki tools to manage your repo<\/h2>\n<p>It&#8217;s important to know that a &#8220;Munki server&#8221; is just a web server. All it does is host files. So even though we&#8217;re about to install Munki on this Mac, which is also the Munki server, a Munki server does not need to have Munki tools installed. In fact, many Munki servers (for example, ones hosted on Linux or Windows) cannot have Munki tools installed on them. If you were to eventually host your repo on Linux, you would install Munki tools on a Mac, and then remotely manage your Linux-hosted Munki repo from that Mac (or another Mac).<\/p>\n<h3>Installing Munki tools<\/h3>\n<p>You can always get the latest Munki tools from <a href=\"https:\/\/github.com\/munki\/munki\/releases\/latest\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/munki\/munki\/releases\/latest<\/a><\/p>\n<p>I&#8217;d recommend you do the standard install, which installs all the components. If, in the middle of installation, you click to <em>customize<\/em>, you&#8217;ll see there are five components:<\/p>\n<ul>\n<li>Munki core tools<\/li>\n<li>Munki admin tools<\/li>\n<li>Managed Software Center<\/li>\n<li>Munki app usage monitoring tool<\/li>\n<li>Munki launchd files<\/li>\n<\/ul>\n<p><strong>Munki core tools<\/strong> are what allows Munki to do most of its work (analyze what&#8217;s installed and compare it to what should be installed, and install or remove what needs to be installed or removed, etc.).<\/p>\n<p><strong>Munki admin tools<\/strong> are what we&#8217;re about to use to populate and manage the Munki repo. There&#8217;s really no harm in installing it on your client machines, because, without write-access to the Munki repo, your clients can&#8217;t really do anything with the tools.<\/p>\n<p><strong>Managed Software Center<\/strong> is the App Store\u2013like graphical interface your users will see to install updates that require user interaction (for example, ones that require a reboot or logout) or to self-select software that you make available as optional installs.<\/p>\n<p><strong>Munki launchd files<\/strong> gives Munki a dynamic quality, for example, allowing Munki to do its background runs every hour or so.<\/p>\n<p><strong>Munki app usage monitoring tools<\/strong> keep track of how often users are launching applications or quitting them, so that if you want to remove software that hasn&#8217;t been used in a while, you can specify how long it should be before unused software is automatically removed. You don&#8217;t have to remove unused software, but there isn&#8217;t a ton of overhead to install this, so feel free to install this along with the other four components.<br \/>\n<!--\nBecause you're installing the launchd agents, you'll have to reboot after you install the Munki tools. Go ahead and do so when prompted.--><\/p>\n<h3>Setting up munkiimport<\/h3>\n<p>For now, we&#8217;re just going to use the Munki server to manage itself. Really, though, if you configure file sharing properly (via SMB, for example), you should be able to use any Mac to manage the Munki server.<\/p>\n<p>In the terminal, run this command, and then answer the prompts appropriately.<br \/>\n<code>munkiimport --configure<\/code><\/p>\n<p>\n<code>Repo URL (example: afp:\/\/munki.example.com\/repo): <strong>file:\/\/\/Users\/Shared\/munki_repo<\/strong><\/code><\/p>\n<p>Again, this is a file address for if you&#8217;re using the Mac you&#8217;re using as the server to access itself. If you were mounting the server share from another machine, you&#8217;d configure munkiimport to use an smb:\/\/ or afp:\/\/ address instead.<\/p>\n<p><code>pkginfo extension (Example: .plist): <strong>.pkginfo<\/strong><\/code><\/p>\n<p>You can just press Return here to use the .plist extension. Some people choose to use .pkginfo instead. It&#8217;s up to you. Both are fine. Or leaving it blank, too, can work. I like to put in <em>.pkginfo<\/em> as an extension, so that&#8217;s what you&#8217;ll see in future tutorials.<\/p>\n<p><code>pkginfo editor (examples: \/usr\/bin\/vi or TextMate.app; leave empty to not open an editor after import): <strong>BBEdit.app<\/strong><\/code><\/p>\n<p>If you have strong opinions about what text editor you like to use, go ahead and put it in here. If you&#8217;re not sure what to use, I&#8217;d recommend <a href=\"https:\/\/www.barebones.com\/products\/bbedit\/\" target=\"_blank\" rel=\"noopener noreferrer\">BBEdit<\/a>.<\/p>\n<p><code>Default catalog to use (example: testing):<\/code><\/p>\n<p>Just hit Return here. <em>testing<\/em> is a fine default catalog to use.<\/p>\n<p><code>Repo access plugin (defaults to FileRepo):<\/code><\/p>\n<p>Hit Return here as well, and then you&#8217;re all set.<\/p>\n<p>Now we have a Munki repo set up and munkiimport configured to use the repo. Next time, we&#8217;ll work on actually setting up the repo to be useful to clients.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before you begin&#8230; Please read the following before you start rolling up your sleeves and setting up Munki: Why should your school use Munki to manage its Macs? Basic requirements for Munki How does Munki work? tl;dr This guide will walk you through getting set up a certain way so you can get up and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_shortlink":"https:\/\/wp.me\/paDrAJ-B","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":33,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":536,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/37\/revisions\/536"}],"wp:attachment":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}