Raspberry Pi Basics: installing Raspbian and getting it up and running

So, are you a person who got a Raspberry Pi (aka "Pi") and want to start building something with it but don't know how to go about it? If yes, then this tutorial is for you. Here in this howto, we go about installing the Raspbian OS and initiating a desktop environment.


Raspberry Pi is a credit card sized micro processor available in different models with different processing speed starting from 700 MHz. Whether you have a model B or model B+, or the very old version, the installation process remains the same. People who have checked out the official Raspberry Pi website, might have seen them recommending the "NOOBS" or "NOOBS LITE" Operating System (aka "OS") for beginners. But using the Pi is very easy and from being a beginner, one will turn pro in no time. So, it's better to go with the more powerful and more efficient OS, the Raspbian. The main reason why Raspbian is extremely popular is that it has thousands of pre built libraries to perform many tasks and optimize the OS. This forms a huge advantage while building applications.


1 Downloading Raspbian and Image writer

Download the latest version of Raspbian from here. You can download it directly or via the torrents.

You will be needing an image writer to write the downloaded OS into the SD card (micro SD card in case of Raspberry Pi B+ model). So download the "win32 disk imager" from here.

2 Writing the image

Insert the SD card into the laptop/pc and run the image writer. Once open, browse and select the downloaded Raspbian image file. Select the correct device, that is the drive representing the SD card. If the drive (or device) selected is different from the SD card then the other selected drive will become corrupted. SO be careful.

After that, click on the "Write" button in the bottom. As an example, see the image below, where the SD card (or micro SD) drive is represented by the letter "G:\"

Once the write is complete, eject the SD card and insert it into the Raspberry Pi and turn it on. It should start booting up.

3 Setting up the Pi

Please remember that after booting the Pi, there might be situations when the user credentials like the "username" and password will be asked. Raspberry Pi comes with a default user name and password and so always use it whenever it is being asked. The credentials are:

login: pi
password: raspberry

When the Pi has been booted for the first time, a configuration screen called the "Setup Options" should appear and it will look like the image below.

If you have missed the "Setup Options" screen, its not a problem, you can always get it by typing the following command in the terminal.

sudo raspi-config

Once you execute this command the "Setup Options" screen will come up as shown in the image above.

Now that the Setup Options window is up, we will have to set a few things. After completing each of the steps below, if it asks to reboot the Pi, please do so. After the reboot, if you don't get the "Setup Options" screen, then follow the command given above to get the screen/window.

  • The first thing to do:

    select the first option in the list of the setup options window, that is select the "Expand Filesystem" option and hit the enter key. We do this to make use of all the space present on the SD card as a full partition. All this does is, expand the OS to fit the whole space on the SD card which can then be used as the storage memory for the Pi.
  • The second thing to do:

    select the third option in the list of the setup options window, that is select the "Enable Boot To Desktop/Scratch" option and hit the enter key. It will take you to another window called the "choose boot option" window that looks like the image below.

    In the "choose boot option window" , select the second option, that is, "Desktop Log in as user 'pi' at the graphical desktop" and hit the enter button. Once done you will be taken back to the "Setup Options" page, if not select the "OK" button at the bottom of this window and you will be taken back to the previous window. We do this because we wan to boot into the desktop environment which we are familiar with. If we don't do this step then the Raspberry Pi boots into a terminal each time with no GUI options.

Once, both the steps are done, select the "finish" button at the bottom of the page and it should reboot automatically. If it doesn't, then use the following command in the terminal to reboot.

sudo reboot

4 Updating the firmware

After the reboot from the previous step, if everything went right, then you will end up on the desktop which looks like the image below.

Once you are on the desktop, open a terminal and enter the following command to update the firmware of the Pi.

sudo rpi-update

Updating the firmware is necessary because certain models of the Pi might not have all the required dependencies to run smoothly or it may have some bug. The latest firmware might have the fix to those bugs, thus its very important to update it in the beginning itself.

5 Conclusion

So, we have covered the steps to get the Pi up and running. This method works on all the different models of Raspberry Pi ( model A, B, B+ and also RPi 2) as Raspbain was made to be supported on all models. However, while installing other software or libraries , the procedure might change a bit while installing depending on the model of the Pi or the version of Raspbian itself. The concept of Raspberry is to keep trying till you get he result or build that you want. This might involve a lot of trial and error but spending the time will be worth it. The actual usage doesn't end here. This is just the beginning. It is up to you to go ahead to build something amazing out of it.

Share this page:

Suggested articles

15 Comment(s)

Add comment


By: sjau

and how do you install the image if you're using linux?

By: Mitxy

You don't need to install the image, just copy all the files from the NOOBS folder into your SD card.


By: Anders

Just download NOOB and unzip its contents into the root of the SD-card. Yes, the SD card should be formated as FAT.Or just copy the img-file into the sd-card device.  Don't forget to unmount all devices if they are auto mounted. YOU MUST HAVE THE RIGHT /dev/sdX DEVICE. IF NOT, YOU CAN RUIN YOUR LINUX INSTALLATION. NOTICE THAT X should be a lower case characer a, b, c etc.  Usually the later in the alphabet of those you have. For example /dev/sdk

Easiest way to check.  Do 'ls -lh /dev/sd*' before you insert the SD card, and then run the command after you inserted the card. Any new /dev/sdX device should be the SD card. You could also check that the size is resonable close to you SD cards size. Those with a number after are partitions, and need to be unmounted. Run umount on them, just to be convinced, and if it complains about not mounted, then it is ok. 

sudo umount /dev/sdX1                   # unmount the sdX are the SD device and sudo cp IMAGE-FILE.img /dev/sdX  # overwrite ALL old data on the SD device, no way to get it back later

where IMAGE-FILE.img are the Raspbian image file and sdX are the device name of the SD card.

By: Nicholas

OH YESS!! FINALLY!! This guide helped me when I had no other options. MAN.. just... oh man.. I am so freaking happy this worked. :D 

Who(m)ever wrote this; THANK YOU SO MUCH! :D

By: Michael

The Rasperry Pi B doesn't have an SD card...

By: Steffin

Yeah.. It kinda has an SD card slot :)

By: veer kuamr

i installed the respian in SD card as stated in step 2.

and then i connected my pi to monitor via HDMI to VGA cable. but nothing showing on monitor.

now what should i do ?

how to boot the pi ?

By: meghgoswami835

I tried it too, HDMI to VGA doesn't work... it only works HDMI to HDMI.

You can get some displays made for raspberry pi on amazon, though, for around Rs.3000.

By: klingerj85

I have my raspi3 rev connected with hdmi to vga connector, and have yet to have an issue as a result. Make sure that your raspi is throwing a green light once in a while, if not there is a sdcard or software issue. This will cause no video, but has nothing to do with your hdmi connection.

By: chris owen

Make sure you ahve enough power.  This is usually the problem running a keyboard, a monitor and a mouse (or combinations of these).  You need a good power plug and you need an additional powered USB hub connecting your peripherals. With this - no problem

By: Austin

 I tried step 2 and it said "there was an error running option 3 boot option". What do I do now?

By: Mike

the log in "pi" and password "raspberry " did not work. What now?

By: Neil

Please add a recommendation to change the default passord.

By: Amare Mahtsentu

OK my question, I did all this things installation of OS, opencv, python ....

But If Ineed to use raspberry pi independent of the computer how that will be possible? I know raspberry pi is a mini computer.... 

I am planning to use raspberry pi for motion detection with a fixed camera..... I have done the codes on my computer  then what should I do to use the raspberry pi the motion detection environment.....how the codes re loaded on raspberry pi.....

By: LtGlahn

These tutorials really should have a timestamp!

This is a great tutorial, but it would be so much better if I had any way of knowing if it's written in 2016 or 2020. These things evolve. Truly great tutorials all have time stamps (or even better: version info).