RASPBERRY PI GETTING STARTED GUIDE SERIES
How To Setup Raspbian Lite
In this lesson, I will walk you through the full process of installing the latest Raspbian Stretch operating system on an SD card. In this guide, and in the Raspberry Pi Full Stack course, we use the minimal version of Raspbian.
You Raspberry Pi will not be able to do anything without an operating system. This is very different to how a microcontroller, like the Arduino, works. A microcontroller does not need an operating system. The Raspberry Pi, though, does, as it really is a full computer.
In this lesson, I will walk you through the full process of installing the latest Raspbian Stretch operating system on an SD card. In this guide, and in the Raspberry Pi Full Stack course, we use the minimal version of Raspbian. This means that we will not be needed any of the graphical user interface elements of the operating system, so the operating system will need a much smaller SD card.
I describe the process in this video (or, if you prefer to read, do so below):
To follow along with the instructions in the video, you will need a Class 10 SD card with at least 8GB available space. You will also need a computer running Windows or Mac OS, with an SD card slot or an external SD card reader/writer device.
You will need to download the Rasbian Lite version of the operating system, and a small program needed to "burn" (i.e. copy) this OS on your SD card.
To download the Raspbian OS image, go to the Raspberry Pi Foundation download page. Download the Zip version of the option titled "Raspbian Stretch Lite".
The term "image" refers to an archive of the contents of a disk, or in our case, an SD card. It usually is distributed compressed as a ZIP file. When you extract the contents of the ZIP file, you have the disk image.
To burn the image on the SD Card, I recommend a small free program called Etcher. You can download Etcher from its website. Install it on your computer as you do with any other program.
You now have everything you need to proceed with the setup.
Download the operating system image file
To do that, we'll go in to raspberrypi.org/downloads and then click onto the Raspbian operating system logo.
That will take you to the page where you have the option to downloading either the desktop version, the full version of Raspbian with the GUI elements or the light version.
At the time writing this, the latest Raspbian operating system version is called "Stretch".
Go ahead and click on the download button to download it.
It's a process that takes a few minutes to a few hours to complete, depending on the speed of your internet at your location.
The zip file that you have downloaded is an archive that contains the compressed version of the image that we want to put onto the SD card.
First you will need to expanded it, as you do with any other ZIP file.
Once the ZIP file is expanded is completed you'll have an image file that is around 1.6 GBytes in size. Look for a file with the "IMG" extension. This is the image file that we want to copy onto the SD card.
Transfer the image to your SD card
When it comes to transferring this image file onto the SD card there's a few different ways of which you can do that.
Different utilities allow you to do this sort of thing or you can also do it on the command line.
But it seems like the easiest way to go about this is to use the Etcher application.
The nice thing about this application is that it's cross-platform compatible so you can download a version for the Mac, for Windows, or for Linux, and it works exactly the same way on all three operating systems.
Download the version of Etcher for your operating system.
Install and then start the application.
The Raspberry Pi requires a mini SD card that goes into the connector at the bottom of the board.
In my setup, I'll use an SD card that is 16 gigabytes in size. I've tested the process with an 8 gigabyte SD card on a Raspberry Pi 2 and it worked with no problem at all. I am going to have a lot of empty space with this card.
After you have started Etcher, select the image that you want to transfer to the SD card. Look in your download folder, for the file with the IMG extension, then click on "Open".
After that, you will want to confirm the target. Etcher should be able to automatically detected the target SD card. If not, select it manually. A nice feature of Etcher is that it will only show you the SD card drives on your computer. It isn't going to show you any other hard disks or network drives that very often confuse people. It will only show you the actual SD cards, so it makes it very safe to use Etcher as opposed to other SD card utilities.
Accept the correct target SD card with click on Continue, and then click on the Flash button. Etcher will probably ask for your password at this point. Provide it, and click Ok to continue.
Then the process of copying the image onto the SD card will begin and take about a minute. Etcher will show you the progress.
Etcher will flash that image onto the SD card and then verify it as well to make sure that the copying was correct.
When the process is completed you can now close Etcher and remove the SD card from your computer.
There's a couple more things to do before you actually plug the SD card into your Raspberry Pi for the first time.
Because we are going to be using the Raspberry Pi in headless mode, which means no monitor and no keyboard attached to it, we need a way to be able to remotely access the Raspberry Pi in order to be able to find its IP address.
If you're using a Raspberry Pi with integrated Wi-Fi, such as the Raspberry Pi 3 or the Raspberry Pi Zero W, then you also like to be able to setup Wi-Fi before you actually boot it for the first time.
Before you go ahead to insert the SD card in the Raspberry Pi and boot for the first time, you should setup SSH and Wifi. You can learn how to do this in the next lesson in this guide.
Ready for some serious learning?
Start right now with Raspberry Pi Full Stack - Raspbian
This is our most popular Raspberry Pi course.
This course is a hands-on project designed to teach you how to build an Internet-of-Things application based on the world’s most popular embedded computer.
Learn how to:
- Setup your Raspberry Pi as a web server using a minimal version of the Raspbian OS.
- Use only the console to interact with your PRi.
- Setup Python in a container dedicated to your web application, install the necessary modules to control the GPIOs and sensors.
- Build the web application, one level of the stack at a time, using high-performance open-source software.
Jump to another article in this series.
Jump to another article
1: What is the Raspberry Pi?
2: Raspberry Pi vs Arduino
3: Raspberry Pi operating systems
4: Headless and graphical (GUI) operating systems
5: How to install Raspbian Lite
6: SSH and headless configuration
7: How to set a host name
8: Booting for the first time
9: How to set a fixed IP address for your Raspberry Pi
10: Basic configuration
11: Working as the 'root' user
12: Raspberry Pi pins, roles, and numbers
13: A taste of Python on the Raspberry Pi
14: Python functions
15: A simple Python program
16: A simple circuit
17: Control an LED with GPIOZERO
18: Read a button with GPIOZERO
19: Setup the DHT22 sensor with Git
20: Use the DHT22 sensor
21: Raspberry Pi OS 64-bit vs 32-bit