How do I set up a Raspberry Pi 3 using my Mac?

The Raspberry Pi is a superb microcomputer designed to help people learn about computing. Rather than a fully contained computer, like the Apple Mac, the Raspberry Pi is just a bare-bones board that you can hack into all kinds of electronics projects, but it offers huge potential at a price that's manageable for kids, students and amateur enthusiasts.

For just £30, it's no wonder that the Raspberry Pi has sold so well (it's currently the biggest-selling British computer). The latest model, the Raspberry Pi 3, features a much faster processor as well as on-board Bluetooth and Wi-Fi. It doesn't have a hard drive, however. Instead, you install the operating system directly on to an Micro SD Card and insert this into the Raspberry Pi. Several different operating systems are available, but most users opt for Raspbian (the recommended OS).

To set up Raspbian on a Raspberry Pi, you'll need a computer - a proper, conventional computer - to begin with. This is where Mac OS X steps in. It's really easy to set up a Raspberry Pi 3 using OS X on a Mac. You use OS X to format the SD Card, download Raspbian from the Raspberry Pi foundation and install the files on to the SD Card. This can then be plugged into the Raspberry Pi and booted.

There are two ways to set up Raspbian on a Mac. The first is to use NOOBS (New Out Of Box Software) and the second is to use the "dd" command in Terminal. In this simple tutorial we'll look at both options.

Read next:

How to set up and learn Python coding on a Mac

How to write apps with Apple Swift 2

How to make an iOS game

Best ways to learn Swift and develop apps for iPhone

How to set up Raspberry Pi 3 with a Mac: Copying the NOOBS files

How to set up Raspberry Pi 3 with a Mac: Format the SD Card

The easiest way to set up a Raspberry Pi on a Mac is to copy the NOOBS files from the Raspberry Pi organisation to a blank SD card. If this is the first time you've set up a Raspberry Pi, then we recommend you go this route:

  1. Download SD Formatter for Mac from this website. Open the SDFormatter.pkg file in your Downloads folder and follow the instructions to install the app. Use SD Formatter instead of Disk Utility (it uses the right format and creates the right partitions automatically).
  2. Attach an 8GB Micro SD Card to your Mac. (Be warned that the next steps will erase everything from the card.)
  3. Open SD Formatter and choose Overwrite Format (you can use Quick Format in the future).
  4. Click Format.
  5. When the format has finished, check that the SD Card has appeared in Finder.
  6. Open Safari and download the latest version of NOOBS from the Raspberry Pi organisation.
  7. Open Downloads and double-click the NOOBS zip file to unpack it.
  8. Open the NOOBS folder and drag all of the files from the NOOBS folder to the SD Card. Make sure you're dragging the contents inside the NOOBS_v1_9_0 folder and not the folder itself.
  9. After the files have finished copying open the SD Card and check that all of the files are in the root. You should see "bootcode.bin" and "BUILD-DATA" files, and a "defaults" folder (among other files).
  10. Eject the SD Card (drag the SD Card folder to Trash, or click the Eject icon next to it in Finder).
  11. Remove the SD Card from your Mac and insert it into the Raspberry Pi 3. Attach the power, HDMI cable and other peripherals.
  12. Attach the USB power cable to the Raspberry Pi.

You'll now see the Raspberry Pi boot into Raspbian, the default OS. You will see a grey screen with the Raspberry Pi logo on it.

Setting up Raspberry Pi: copying the NOOBS files to an SD Card

How to set up Raspberry Pi 3 with a Mac: Copying the image file

Using NOOBS is the way to go for beginners, but as you continue using your Raspberry Pi you'll quickly want to switch to installing the operating system from the image file. This is smaller than NOOBS, so you get more space to use. It's also a faster installation and the process works for other operating systems, so you're not limited to Raspbian any more.

Unlike other computers, you'll end up re-installing the operating system on a Raspberry Pi far more frequently (it's designed to be set up, wiped and reused over and over again - it's a computer for prototyping).

How to set up Raspberry Pi 3 with a Mac: Using DD from the Terminal

Here's how to set up a Raspberry Pi 3 with a Mac using Terminal:

  1. Use SD Formatter to format your SD Card. Eject the SD Card and remove it from your Apple Mac.
  2. Open Safari and head to raspberrypi.org/downloads and click on Raspbian. Click Download ZIP under Raspbian Jessie (the full version, not Raspbian Jessie Lite).
  3. Double-click the Raspbian zip file in your Downloads folder to extract the image file. Ours is 2016-03-18-raspbian-jessie.img (you may have a later version).
  4. Open Terminal.
  5. Enter "diskutil list". You will see a list of all your drives. If you're using a Mac with just one hard drive, then two appear: /dev/disk0 and /dev/disk1. If you have external hard drives, or more volumes, then there will be more drives.
  6. Attach the Micro SD Card to your Mac.
  7. Enter "disktuil list" again. Check carefully to locate the new disk. It will be one more on from the last list (ours is /dev/disk2) and have "(external, physical)" after it. Check that its SIZE matches the SD Card. It's important that you get this right so you don't end up overwriting content on the wrong drive.
  8. Enter sudo diskutil unmountDisk /dev/disk[n] (replacing with the number of the disk, ie: /dev/disk2).
  9. Enter this carefully: "sudo dd bs=1m if=~/Downloads/2016-03-18-raspbian-jessie.img of=/dev/rdisk[n]" - replacing [n] with the number of the disk
  10. Tip: you can use tab to expand file paths in Terminal. Enter "if=~/Downloads/2 " and press Tab to get the rest of the filename (you may need to add "img" to the end).

The image file will be copied to the SD Card. You won't get any feedback while it copies, and it can take several minutes. Leave Terminal to do its thing. When the copy is finished enter "sudo diskutil eject /dev/disk[n]" to eject the disk. Remove the SD Card and insert it into your Raspberry Pi 3.