Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community

How to Install Craft Nitro

Installing Craft Nitro on macOS requires Docker, so that means you need to first have Docker Desktop for Mac installed and working.

Installing Craft Nitro on macOS requires Dock­er, so that means we need first to have Dock­er Desk­top for Mac installed and work­ing. This a free macOS appli­ca­tion via the Dock­er project.

Installing Dock­er Desktop

To install Dock­er Desk­top, go to the Dock­er Desk­top page on Dock​er​.com and grab the down­load for Mac.

Note that the require­ments for installing Dock­er Desk­top are that we are run­ning macOS 10.14 or new­er. That cov­ers three ver­sions of macOS going back to Mojave.

We also want to be sure we have at least 4 GB of RAM (but ide­al­ly more). Dock­er is RAM-hun­gry, so if we have an old­er Mac with 16 GB or less mem­o­ry, we might see some slow­downs as we use Dock­er. Every com­put­er is dif­fer­ent, and it depends on the demands oth­er appli­ca­tions put on the RAM.

Once the pack­age down­load is com­plete, we drag the Dock­er appli­ca­tion to the Appli­ca­tions direc­to­ry and then launch it.

At this point, Nitro will do every­thing else for us. One tweak we may want to make is increas­ing the amount of RAM Dock­er Desk­top is allowed to con­sume. The default set­ting might not be enough RAM, so we could have con­tain­ers exit­ing if we have sev­er­al con­tain­ers running.

With Dock­er Desk­top installed, we can now move to install Nitro. There are two ways to install Nitro: via Brew and direct­ly via a com­mand-line command.

Install Nitro via Brew

Installing Nitro via Brew is my pre­ferred way to install Nitro because I han­dle all of my local soft­ware via Home­brew. Home­brew is a pack­age man­ag­er that installs the soft­ware you need on macOS or Linux.

If you already have Home­brew installed, then you can eas­i­ly install Nitro using:

➜ brew install craftcms/nitro/nitro

We need to make sure we do not run this until we have Dock­er Desk­top installed in the pre­vi­ous step.

Now we can run nitro init to set up every­thing and build your Dock­er environment. 

➜ nitro init

The nitro init com­mand will take some time as Nitro down­loads the images and makes them avail­able via Dock­er Desktop.

Install Nitro via Bash Command

Home­brew isn’t the only way to install Nitro. We can also install Nitro from the com­mand line. We will use the bash shell envi­ron­ment and down­load and run the installer.

➜ bash <(curl -sLS

After the down­load is com­plete, the installer runs and builds the envi­ron­ment. Using this method, we do not have to run nitro init as you did with the Home­brew instal­la­tion option.

The next step in the process is to set up a project with Nitro.

Prob­lems Installing?

If you have prob­lems installing Nitro, check out the man­u­al instal­la­tion instruc­tions from the Nitro documentation.

Where does Nitro store its configuration?

Nitro stores project con­fig­u­ra­tions in a YAML file in a hid­den direc­to­ry in the user direc­to­ry (on macOS). To see the file, list the files in the directory:

➜ ls ~/.nitro
nitro.crt  nitro.yaml

The nitro.yaml file is where Nitro stores the site con­fig­u­ra­tions. Let’s look inside it:

➜ cat ~/.nitro/nitro.yaml

The file has YAML sec­tions for the data­base, ser­vices, and sites. Edit­ing this file, for exam­ple, to remove a site, could be done man­u­al­ly and then just run nitro apply to apply the updat­ed set­tings to the Nitro Dock­er setup.

Here are all of the videos in Local Development with Craft Nitro:

1What is Craft Nitro?Craft Nitro is a Docker-based local hosting solution by Pixel & Tonic, the developers of Craft. It is designed as an officially-supported way to handle local development of Craft CMS website builds, as well as when working on plugin development. 04:08
2Is Craft Nitro Right for Me?Five checks to see if Craft Nitro is the local development environment for you. 02:33
3How to Install Craft NitroInstalling Craft Nitro on macOS requires Docker, so that means you need to first have Docker Desktop for Mac installed and working. 09:20
4Creating Your First Site with NitroNow that we have Nitro installed, we are ready to create our first Craft hosted with Nitro. 09:49
5Setting Up A Boilerplate Project with Craft NitroIf you have a boilerplate project that you work with when starting new projects, it’s simple to use that to create a new Nitro project via the `nitro create` command. 04:35
6Migrating an Existing Project to Craft NitroMigrating an existing project to Nitro is probably going to be the most common scenario you run into, assuming you move all of your projects over instead of just using Nitro for new projects. 05:04
7Running Craft Commands Against a Craft Nitro SiteIt's best to run all `craft` commands through the `nitro` command. 02:15
8Craft CMS Multi-Site with Craft NitroSupporting a Craft multi-site installation with Craft Nitro requires using the `nitro alias` command. 04:33
9How to Recall Which Nitro Sites Are RunningI like to be able to get a quick peak and reminds myself of what’s what and if I’ve even set up a project in Nitro yet. 02:58
10Removing a Site from Craft NitroHere is how to remove a site from Craft Nitro. 03:05
11Testing Email Sending in Craft NitroIn addition to the core functionality of local hosting, Craft Nitro also has ancillary services that fill out the total experience of running a Craft site. 05:28
12Updating Craft NitroNitro is an actively maintained project by Pixel & Tonic. You’ll get the best experience with Nitro if you regularly update to get the latest features and improvements. 01:37
13Uninstalling Craft NitroIf you decide that Nitro isn’t for you or you need to troubleshoot an issue by uninstalling Nitro, then this is how to do it. 02:47
Course In-ProgressThis course is still being updated with new content. Check back for more!

Loading next video...