How to Set Up a Raspberry Pi

by | Apr 30, 2016

Raspberry Pi ComputerIf you’re new to the world of Raspberry Pi Computers then I suggest that you head over to the Raspberry Pi Foundation and familiarize yourself with who they are and what they do.  With millions of these little microcomputers out in the wild, there is a wealth of information available and a very strong community. There are several versions of the Raspberry Pi available so if you want a quick overview head here first.

When it comes to the operating system there are many options available from both the Foundation and 3rd party providers, for the purposes of this tutorial I will show you how to install the Raspbian OS using both the NOOBs (New Out Of the Box) operating system installer and directly from a Raspbian Image file along with some optional configuration settings to enable further functionality and remote (headless) access.

 

Materials

 

In this tutorial I will be using the following materials:

When it comes to setting up a Raspberry Pi there are several options:

 

 

Install Raspbian using the NOOBs Installer

 

Head to the Raspberry Pi Foundation downloads page and select the NOOBs option, from the choices download either the “NOOBS – Offline and Network Install” version or the “NOOBS Lite – Network Install Only” to your PC. Once the file is downloaded “unzip” the files into a local directory.

Note: If you choose to download the “NOOBS Lite – Network install only” then you will need to have the Pi physically connected with an Ethernet (Network) cable.

From here you will need to copy the NOOBS files from your local directory to an SD card, if you need to format your SD card first then download the SD Formatter for Windows or Mac from the SD Association, follow the instructions to install the software.

Insert your SD card into your PC and then if required launch the SD Formatter, select the SD drive to format, add a volume label (optional) and then select “Format” as shown below.

 

SD Formatter Screen Shot

 

Once the SD card is formatted and the NOOBS files unzipped Drag and Drop the NOOBs files to your SD card drive, once this is completed safely remove the SD card from your PC and insert it into your Raspberry Pi.

We are now ready to do the first boot of the Raspberry Pi, with the SD card installed, connect your USB keyboard, USB mouse (or insert wireless dongle) and monitor cables, finally plug in the USB power cable to start the boot process. Shown below are the connections for the Raspberry Pi 2/3 and the Raspberry Pi 4.

With the monitor connected and after powering up you should be presented with the NOOBs operating system menu, from the choices select the checkbox for “Raspbian Full” then select install and confirm.

Note: The installation can take a while.

Once Raspbian is installed, select “OK”, the system will reboot and present the configuration menu, Select “Next”.

 

Raspberry Pi Raspian initial config screen

 

Set your Country, Language, Timezone and Keyboard type.

 

Raspberry Pi Raspian initial set country config screen

 

Next change your password, the default user and password that comes with Raspbian is

User = “pi”

Password = “raspberry”

it is recommended that you change the default password for security reasons.

 

Raspberry Pi Raspian set password screen

 

The next step is to set up your screen size, if there is currently a black border around the Pi desktop select the checkbox and the OS will resize the screen when the Pi is rebooted.

 

Raspberry Pi Raspian screen size setup

 

If you want to connect to your Wi-Fi network and it is detected by the Pi,  choose your network and select “Next”, if you don’t have a Wi-Fi network or you don’t want to connect at this time select “Skip”.

 

Raspberry Pi Select Wi-Fi Screen

 

Enter your Wi-Fi network password

 

Raspberry Pi Raspian Wi-Fi config screen

Raspberry Pi Raspian Wi-Fi connecting screen

 

Finally, we will update the operating system and application software by selecting “Next”.

Note: If you are performing the update It is important that you have a network cable connected or Wi-Fi enabled on the Pi as internet access will be required to perform the update.

Despite downloading the operating system directly from the Raspberry Pi Foundation there are constant updates taking place over time. It is highly recommended that you update the software at this time as there may be important security patches included. If you don’t want to update at this time select “Skip”.

 

Note: The update can take a while.

Once the update is complete select “Restart” to complete the initial configuration, if selected, the screen size should have been adjusted to completely fill the viewing area.

That’s it, if all has gone well you are now ready to start exploring what you can do with your new Raspberry Pi.

 

Install Raspbian from an Image

 

Head to the Raspberry Pi Foundation downloads page and select the Raspbian option, from the choices download the “Raspbian Stretch with Desktop and Recommended Software” to your PC.

If you need to format your SD card first then download the SD Formatter for Windows or Mac from the SD Association, follow the instructions to install the software.

Insert your SD card into your PC and then if required launch the SD Formatter, select the SD drive to format, add a volume label (optional) and then select “Format” as shown below.

 

SD Formatter Screen Shot

 

Once the SD card is formatted you need to write the downloaded Raspbian image files to the SD card, this can not be done using drag and drop.

You will need an image writing tool to install the image onto the card, for this purpose, I recommend using “Etcher“, download the program for your operating system (Windows/Mac/Linux) and follow the installation instructions.

Once installed select the downloaded Raspbian zip file from your PC (Etcher can handle .zip or .img files so there is no need to unzip the file downloaded from the Raspberry Pi Foundation).

 

Etcher Select Image Screen

 

Next, if not automatically detected, select the SD card drive you want the image loaded onto.

 

Etcher Select Drive Screen

 

Finally, select “Flash!”, once flashed Etcher will then validate the image and finish writing the image.

 

Once you have flashed the SD card successfully, a popup from Windows may appear trying to reformat the unknown file partition you have created, DO NOT FORMAT THE PARTITION, select ‘Cancel’.

We are now ready to do the first boot of the Raspberry Pi, with the SD card installed connect your USB keyboard, USB mouse (or insert wireless dongle) and monitor cables, finally plug in the USB power cable to start the boot process.

With the monitor connected and after powering up you should be presented with the Raspbian configuration menu, Select “Next”.

 

Raspberry Pi Raspian initial config screen

 

Set your Country, Language, Timezone and Keyboard type.

 

Raspberry Pi Raspian initial set country config screen

 

Next change your password, the default user and password that comes with Raspbian is

User = “pi”

Password = “raspberry”

it is recommended that you change the default password for security reasons.

 

Raspberry Pi Raspian set password screen

 

The next step is to set up your screen size, if there is currently a black border around the Pi desktop select the checkbox and the OS will resize the screen when the Pi is rebooted.

 

Raspberry Pi Raspian screen size setup

 

If you want to connect to your Wi-Fi network and it is detected by the Pi,  choose your network and select “Next”, if you don’t have a Wi-Fi network or you don’t want to connect at this time select “Skip”.

 

Raspberry Pi Select Wi-Fi Screen

 

Enter your Wi-Fi network password

 

Raspberry Pi Raspian Wi-Fi config screen

Raspberry Pi Raspian Wi-Fi connecting screen

 

Finally, we will update the operating system and application software by selecting “Next”.

Note: If you are performing the update It is important that you have a network cable connected or Wi-Fi enabled on the Pi as internet access will be required to perform the update.

Despite downloading the operating system directly from the Raspberry Pi Foundation there are constant updates taking place over time. It is highly recommended that you update the software at this time as there may be important security patches included. If you don’t want to update at this time select “Skip”.

 

Note: The update can take a while.

Once the update is complete select “Restart” to complete the initial configuration, if selected, the screen size should have been adjusted to completely fill the viewing area.

That’s it, if all has gone well you are now ready to start exploring what you can do with your new Raspberry Pi.

 

Optional Configuration Settings

 

Once Raspbian is running further configuration settings are available as well as updating previous settings that were performed during the initial installation.

Once you have started you Pi and are presented with the desktop select the “Raspberry” icon from the top left menu, select “Preferences” and then “Raspberry Pi Configuration”.

 

Raspberry Pi Config Menu

 

This will open the Raspberry Pi configuration menu, the menu contains 4 tabs, System, Interfaces, Performance, and Localisation.

 

Raspberry Pi System Tab

 

From the System tab, you can

  • Change the password
  • Change the Hostname
  • Boot to the Desktop or the Command Line Interface (Terminal)
  • Auto Login (Determines whether a password is requested when starting the Pi)
  • Wait for a Network connection before completing startup
  • Enable and Disable the splash screen during startup
  • Set the screen resolution
  • Enable and Disable Overscan (to fix screen resolution issues)
  • Enable and Disable Pixel Doubling (magnifies everything on the screen by a factor of 2)

 

Raspberry Pi Interfaces Tab

 

The Interfaces tab allows you to increase the functionality of your Raspberry Pi depending on the projects that you are attempting, for example, if you want to enable remote access to your Pi then you need to enable “SSH” or if you plan on connecting a Pi Camera then enabling the camera software would be configured here.

 

Raspberry Pi Performance Tab

 

The Performance tab allows you to Overclock the Pi (If Available) and increase the Memory to the GPU (Graphical Processor Unit) to improve the image performance.

 

Raspberry Pi Localisation Tab

 

Finally, the Localisation tab allows you to reconfigure many of the location settings that were made during the initial setup.

Following any changes to these tabs select “OK” and “Restart” if required.

 

Headless Setup (No Monitor or Keyboard)

 

If you are setting up your Raspberry Pi to be Headless then you need to get Raspbian to start the secure shell (ssh) at boot up. To achieve this you need to make a simple addition to the initial image that you load onto the SD card.

To start head to the Raspberry Pi Foundation downloads page and select the Raspbian option, from the image choices download the “Raspbian Stretch” version that you require to your PC.

If you need to format your SD card first then download the SD Formatter for Windows or Mac from the SD Association, follow the instructions to install the software.

Insert your SD card into your PC and then if required launch the SD Formatter, select the SD drive to format, add a volume label (optional) and then select “Format” as shown below.

 

SD Formatter Screen Shot

 

Once the SD card is formatted you need to write the downloaded Raspbian image files to the SD card, this can not be done using drag and drop.

You will need an image writing tool to install the image onto the card, for this purpose, I recommend using “balenaEtcher“, download the program for your operating system (Windows/Mac/Linux) and follow the installation instructions.

Once installed select the downloaded Raspbian zip file from your PC (Etcher can handle .zip or .img files so there is no need to unzip the file downloaded from the Raspberry Pi Foundation).

 

Etcher Select Image Screen

 

Next, if not automatically detected, select the SD card drive you want the image loaded onto.

 

Etcher Select Drive Screen

 

Finally, select “Flash!”, once flashed Etcher will then validate the image and finish writing the image.

 

Note: Flashing the MicroSD card may take some time.

Once you have flashed the SD card successfully, a popup from Windows may appear trying to reformat the unknown file partition you have created, DO NOT FORMAT THE PARTITION, select ‘Cancel’. You may need to remove and re-insert the SD card for your computer to recognize it.

Here’s the extra step, to enable SSH at boot you need to create an empty file call SSH on the SD card, in Windows open Windows Explorer and navigate to the SD Card, right-click in the root folder and select “New – Text Document” and then call it ssh (with no .txt extension). On Mac’s use the terminal to access the SD card and then use touch ssh to create the file.

 

With this completed you can now go ahead and eject the SD card from your computer and insert it into the Pi, connect the Network cable and finally connect the power cable.

You will need to know the IP address of your Pi so you can connect to it, this can be done in several ways depending on your setup. I recommend following the instructions from the Raspberry Pi Foundation.

Finally, you will need some communications software to access your Pi from your PC. A free piece of communications software that you can use is Putty, it is available for both Windows and Mac. Follow the installation instructions and then open the program.

 

Putty login screenshot

 

In Putty enter the IP address of your Pi, select port 22 and ensure that the connection type “SSH” is selected, when you have successfully connected to your Pi you will be required to enter your username and password.

You will now be presented with the command prompt pi@raspberrypi ∼ $

 

Raspberry Pi SSH Login Screen

 

To confirm the Raspbian release that has been installed type in the following command and press enter.

 

Next, we will configure the required options type in the following command and press enter. 

 

You should now be met with the following configuration screen which gives you the ability to configure your Pi with all the same settings that are available from the desktop application.

 

Raspi-Config screen

 

I would advise that you start by changing the following default settings:

  • Change the default password (Option 1)
  • Change the default hostname (Option 2,1)
  • Change to Locale to something appropriate for you (Option 4,1)

1  Change User Password

2  Network Options

  • Hostname
  • Wi-Fi
  • Network Interface Names

3  Boot Options

  • Desktop / CLI
  • Wait for Network at Boot
  • Splash Screen

4  Localization Options:

  • Change Locale
  • Change Timezone
  • Change Keyboard Layout
  • Change Wi-Fi Country

5  Interfacing Options

  • Camera
  • SSH
  • VNC
  • SPI
  • I2C
  • Serial
  • 1-Wire
  • Remote GPIO

6  Overclock – Only available on Pi 1&2, not on 3

7  Advanced Options

  • Expand Filesystem
  • Overscan
  • Memory Split
  • Audio
  • Resolution
  • Pixel Doubling
  • GL Driver
  • Compositor
  • Pi 4 Video Output

8  Update – Downloads the latest version of Raspi-Config

9  About raspi-config – Information about the configuration tool

Select “Finish” from the configuration tool and if required you will be asked if you would like to reboot now, select “yes” and wait for the Pi to reboot.

Finally, update the Raspbian software with the latest packages.

Update Raspian Software (Recommended)

 

Now that you have the Pi set up and have done all of your initial upgrades its a good idea to regularly keep the software up to date in the future. To achieve this we will use the “update” and upgrade functions of Raspbian.

 

Using the Desktop

 

To update the software on the Pi, use the “Add / Remove Software” application, this can be found in the Main Menu under “Preferences”.

 

Raspberry Pi Add Remove Software Menu Image

 

Before you do any updates first refresh the software package list so that it is current.

Click on the “Options” menu in the top left-hand corner and then select “Refresh Package Lists” to update the list of packages.

 

Raspberry Pi Refresh Package List Menu Option

 

Raspberry Pi Reading Package List

 

Once the package list has been updated click on the “Options” menu again and this time select “Check for Updates”, The Package Updater will open and automatically check whether updates are available. It will display any available updates for your software it finds in a list.

 

Raspberry Pi Check for Updates Menu Option

 

Raspberry Pi Package Updater

 

Once all the packages have been downloaded, click the “Install Updates” button to complete the process, you may be prompted for authentication, enter your password to continue loading the updates. If required the Pi will reboot to complete the upgrade.

Note: If you haven’t updated in a while this may take several minutes.

Using the Terminal (SSH)

 

If you are using a headless set up then log into your Pi using Putty and execute the following commands to update the packages list, upgrade the software, remove packages that are no longer required and finally delete any archived package files in the local repository, freeing up disk space.

 

 

Ideally, it’s good practice to run the Update and Upgrade packages every week to ensure that all of the latest security packages are installed on your system.

 

Create a Backup Image (Optional)

 

After getting your Pi setup just the way you want it now would be an excellent time to create a backup .img file so that in the event of anything going wrong (ie program installed incorrectly, failed SD Card, etc) you can restore back to its current state quite quickly and easily.

In order to create a disk image, you will need to download Win32DiskImager (Windows Only) and follow the installation instructions.

Open Win32DiskImager, shutdown and de-power your Pi, remove the SD Card and insert it into your PC. In the Win 32 Disk Imager window enter a name for your image file eg c:\Users\admin\RPI_Images\RPI_Image_Date.img, select the SD Card drive that you want to image (normally it’s already set)  and then select “Read”.

 

Win 32 Disk Imager screen shot

 

Caution: The Win32DiskImager can also write images to disk so just be careful not to select the “Write” option, in this process however it should be greyed out.

Note: The process of writing the image may take some time

Once the image has been read successfully select “OK” then “Exit”, now if you have any issues you can easily format your SD card and reload the backup image with Etcher within minutes.

That’s it, you should now have all the basic setup of your Raspberry Pi completed and an backup created. If you’ve come this far why not check out my other getting started tutorials.

If you have any thought’s about this article, improvements or errors let me know in the comments below and if you found this helpful, why not share it with others.

Pin It on Pinterest

Share This