An overview of D7 install profiles


Yet another key component to the Drupal Platform is the install profile and it's another one that deserves a few posts to cover it adequately. The goal of this series of posts will be to build an install profile capable of creating a basic brochure-style website - more or less what WordPress's core functionality offers (ok, we'll be doing a bit less for this example ;-)).

Drupal 7 install profiles differ quite significantly from Drupal 6 install profiles so a lot of the material covered here won't necessarily apply if you're working on D6 only. There's already a lot of great documentation to help get you started. has an overview of install profiles that's worth taking a read through, for example. The Drupal documentation also covers all of the common hooks that you may want to use in your profile. But the best place, without question, is just reading through the Drupal core profile code (no, I'm not joking). Check out profiles/minimal, and profiles/standard folders that come with Drupal, particularly the .info, .profile, and the .install files.

To be upfront about things here, I've personally never built an install profile in Drupal 7 so this is a bit of a learning experience for me as well. I know that a lot of the limitations that existed in Drupal 6 have been solved so hopefully the process will be smoother. As always, if you notice anything I've done wrong or could do better please leave a comment as I want to promote best practices for building platforms.

There are a few differences between an installation profile that you'll run manually as you install Drupal (an option that would sit next to minimal or standard in the Drupal install process) versus an install profile to be used for automatically creating sites through Aegir. The primary difference is that an install profile to be used in Aegir should have no options that the user needs to fill out or answer. Defaults are important here. Any kind of setup that the user must do will need to be done after the site it created, not before, possibly with some sort of configuration wizard for this which I'll hopefully write more on later.

For this post I'm only going to run through a typical install profile as opposed to an Aegir-specific one which I'll write on later (and conveniently, can be much simpler than a standard profile).

Anatomy of an install profile:

The initial setup for the install profile is quite trivial. All you need to do is create the folder and the files, and then list out the modules you wish to be enabled on site creation. Basically a combination of creating a new site in a multisite setup and creating a module.

Start with this folder structure in your D7 site:


All the non-core modules used on your site will now go into the installation profiles' folder as opposed to sites/all. This isn't required, but will make your install profile more complete and is a good way to keep things organized.


Unlike in D6 install profiles, you define the modules you want to install with your profile in the .info file as a dependency, just as you would with a standard drupal module. This makes install profiles much more consistent with how the rest of drupal packages work, and more importantly, makes our life easier.


The .profile file is equivalent to the .module file in a module or template.php in a theme. This is where you'll define any hooks required for your profile. Unlike Drupal 6, install profiles in Drupal 7 now have the privilege of running under a fully bootstrapped Drupal. This is a huge benefit, and makes the life of an install profile in D7 much more enjoyable than those poor D6 profiles.


The tough part comes in the .install file. Take a look at the profiles/standard/standard.install file. It starts by defining and creating filter formats and then blocks. It also includes the creation of content types, fields, rdf mappings, roles, and menus.

The good news is that a huge percentage of this, the heavy lifting, can be removed by the use of features. For example, we don't need to create content types, fields, roles, menus, etc. by hand as they're all defined and created by the features we use on our site (see A simple feature for reference).

The bad news is that for more complex profiles you will need to get into the nitty gritty of the Drupal API. In some cases the install profile api ( can simplify things for you (at the time of writing there is not yet a D7 version), but for most things you should look at other install profiles for examples.

In my next post I'll demonstrate creating the skeleton of a basic profile based off of the Drupal minimal and standard profiles as well as a little pinch of our own special sauce.

Peanut Gallery

d7 profile helper module


D7 profiler_api type module at

Also, there is now a simple GUI interface to create a profile:

.... totally annoyed by cool modules such as Ckeditor that only look in sites/all/modules for dependencies, as clearly they can live in other places besides sites/all/modules. I wish Library would catch on.

Doing stuff by hand is great. But leveraging a tool like Profiler + Drush Make can get you there really fast:

Currently building a site via install profile and all the tools i've outlined above. Nice writeup look forward to the followups.

Hello, New to drupal so

Tony Imtiaz


New to drupal so please bear with me. Started off with a distribution profile / subtheme that is based on Zen. However I cannot see the contents of the subtheme on my webpage ( despite enabling and configuring the subtheme. Your help will be much appreciated.


This is a good introduction

This is a good introduction to installation profiles but I have one question (actually I've got a few, lol). How is the cascade defined? For example, I installed Commerce Kickstart and despite both Standard and Minimal installation profiles being there, it "knew" to load the Kickstart profile when I went to site.local - where is this defined?

Answer to Matt's Question


You're referring to the 'exclusive = "1" ' property that is found in the .info file. Basically, it tells Drupal, "Hey, don't let them choose any other install profile, and set me as the default install profile." If you look in the URL when you hit your site.local for the first time to install, you should see something like
site.local/?profile={profilename}. If you change {profilename} to say standard or minimal, you will change the installation profile that is used. Sorry for commenting so late, I'm sure you've figured it out by now, but having gone through this week learning about install profiles, I couldn't help but share some of my found knowledge.