To totally unlock this section you need to Log-in
Raspberry pi, available by years now on the market, is a small single-board computer that is capable of doing almost everything that an ordinary Linux-based computer can do. There are many other operating systems out there for Raspberry Pi, such as Windows 10 IoT, Raspbian, Fedora, Ubuntu Mate, Open Elec, Retro Pi etc.
Raspberry Pi OS is an operating system just like Ubuntu, Windows, or Mac OS. The only difference is that it’s for Raspberry Pi only and it is Linux based. Beneath Raspberry Pi OS, there’s a Debian core (a Linux operating system distribution) which is also the core of Ubuntu and may other operating systems.
There are several versions of Raspberry Pi OS that you can choose to download. It really depends on what you would like to do with your Pi.
If you want your Pi install to be a fully functioning computer then you can either download Raspbian with or without the bundled software. Either version will provide the desktop environment, the latter omitting the additional bundled apps. An 8GB memory card is required for these installations.
There is also a slimmed down version called Raspberry Pi OS Lite, which does not contain the graphical GUI. It can be installed on a smaller 4GB SD card. This is ideal if you wish to embed your Pi into some application that does not require a desktop, as it frees up resources otherwise used by the GUI. A great example is using it for an home server with one or multiple services.
Raspberry Pi OS is fast and light, even much more without the GUI components, and it a Debian-based OS. Processes share the same resources during execution without the need for creating process-specific resources unlike in heavyweight systems. This, therefore, increases the efficiency and speed of the operating system.
Usually, Raspberry Pi OS is also very good while using it in CLI-mode only, with no GUI, also because the strong community behind it and the available repositories assure an large pool and availability of many software packages and sources.
The following are the main requirements to be able to get a working Raspberry Pi with Raspbian OS distribution:
- Raspberry Pi 2,3,4
- 5 volt 2 Amp Adapter
- HDMI to VGA Converter (If using non-HDMI LCD)
- keyboard and a mouse
- SD Card Jacket (for wiring Raspbian to SD Card)
- Wi-Fi dongle (only if using Raspberry Pi 2)
- HDMI cable
- Class 10 Micro USB card (no less than 8 GB)
- Go to the following page to access the Downloads section from which we will be able to download the ISO image file for Raspberry Pi OS (ex Raspbian): https://www.raspberrypi.org/software/operating-systems/.
- Download the Raspberry Pi OS Lite ZIP archive file, if you want a minimal setup to build an headless system/server, with no GUI available and no extra software already installed.
- Download and install SD Formatter tool from https://www.sdcard.org/downloads/formatter/.
- Put SD card into your PC or card reader.
- Open SD Formatter.
Set the Format Type to Quick .
Finally, select your SD Card and click on Format.
NOTE: it is strongly recommended to use the SD Memory Card Formatter to format SD/SDHC/SDXC Cards rather than using formatting tools provided with individual operating systems. In general, formatting tools provided with operating systems can format various storage media including SD/SDHC/SDXC Cards, but it may not be optimized for SD/SDHC/SDXC Cards and it may result in lower performance.
IMPORTANT NOTE: Anything over 32GB is most likely going to be an SDXC (Secure Digital Extended Capacity Card) card and will need to be formatted. The Raspberry Pi only supports the FAT16 and FAT32 file systems. Take note the difference between maximum file size and max partition size realted to FAT32: you can use an SDXC card up to 2TB (Terabytes) with FAT32, but each file stored in it can have a size up to 4GB (Gigabytes).
Then extract the files from the ZIP archive file you just downloaded and copy the .img file to your SD Card.
On Windows, to burn the Raspberry Pi OS disk image to the SD card, we have to download a program called Win32DiskImager. It's main purpose is just that: to burn disk image files to actual disks, USB sticks, flash drives and SD cards.
Download and install Win32DiskImager. Open it and choose the previously downloaded Raspberry Pi OS image file (the .img file) as the input and the disk that represents your SD card. Press Burn and wait till the process finishes.
On Linux, locate the device, by running sudo fdisk -l. It will probably be the only disk about the right size. Note down the device name; let us suppose it is /dev/sdx. If you are in any doubt, remove the card, run sudo fdisk -l again and note down what disks are there.
- Insert the SD card again, run sudo fdisk -l and the new disk listed will be the new disk (SD Card).
- Unmount the partitions by running sudo umount /dev/sdx*. It may give an error saying the disk isn't mounted - that's fine.
- Copy the contents of the image file onto the SD card by running
|sudo dd bs=1M if=your_image_file_name.img of=/dev/sdx|
NOTE: adding "status=progress", for example "dd if=raspberrypi.img of=/dev/sdc bs=1M status=progress" will let you see progress of the operation.
- Of course, you'll need to change the name of the image file above as appropriate.
- WARNING: there is a significant risk of damage to your filesystem if you use the wrong /dev/sdx. Make sure you get it right.
Now put your SD Card in your Raspberry Pi, connect the keyboard, mouse, HDMI monitor or LCD, Wi-Fi dongle (only if you are using Raspberry Pi 2) and the power adapter. It will power up and will start running when you plug it in. At the end of the boot process it will be
If it asks for username and password use these defaults:
- Username: pi
- Password: raspberry
If needed, below a table showing default credentials for other available Linux distributions built for the Rasberry Pi platform:
|Arch Linux ARM||root||root|
After you download and unzip the Raspberry Pi OS image, you may notice that it is in .img format. This is a raw disk image format similar to .iso or .dmg and must be mounted like a disk in order to be accessed.
This second method will involve the BalenaEtcher open source tool (https://www.balena.io/etcher/) (BalenaEtcher copies images to drives byte by byte, without doing any transformation to the image itself) as follows:
Firstly click select image button and navigate to and select your downloaded Raspberry Pi OS image.
If you have not inserted your SD card, you are going to need to insert it and allow it to register. Next click select target and ensure your SD card is selected, then click Continue.
Now you should see your Raspberry Pi OS image and SD card selected. If both are correct, click Flash and wait for the flashing and verification to complete. It may take a while.
The SD card is now ready to be used with the Raspberry Pi device; if you wish to connect your Pi device to a screen, keyboard and mouse then you are good to go.
The last more user-friendly method to prepare a microSD card with a compatible OS for Raspberry Pi is Raspberry Pi Imager.
Raspberry Pi Imager makes the imaging process much easier. It centralizes all of the most common imaging tools and software you need into one package. You don't even need NOOBs to install Raspberry Pi OS. Raspberry Pi Imager includes Raspberry Pi OS as well as a few other operating systems. If something isn’t listed, you can use the custom image tool to add your own images.
The whole process with this third method will be like the following:
- Visit the Raspberry Pi download page.
- Download the Raspberry Pi Imager installer for your Operating System.
- Run the Raspberry Pi Imager.
- Click Choose OS. The feature somewhat replaces NOOBS, providing a couple of basic operating systems like Raspbian (Raspberry Pi OS).
- Select an OS from the list.
- Click Choose SD card.
- Select from the list the SD card you want to write to.
- Click Write to begin the image writing process onto your SD Card.
Raspberry Pi Imager comes with a small selection of operating systems (it doesn't replace NOOBS), but it does provide a couple of operating systems, Raspbian, LibreELEC and Ubuntu.
Now, also custom Raspberry Pi image files (like .zip, .img, .tar, .gz, etc) can be written using Raspberry Pi imager. You must download the image file from a third-party source.
- Launch Raspberry Pi Imager.
- Click Choose OS.
- Select Use custom to write an unlisted image.
- Click Choose SD card.
- Select from the list the SD card you want to write to.
- Click Write to begin the image writing process.
Change Raspberry Pi’s Password
You need to consider to change the pi's passowrd even To change a password of the current user in Raspberry Pi, execute the passwd command:
| [email protected]:~ $ passwd|
Changing password for pi.
Retype new password:
passwd: password updated successfully
If you don’t know the current password or you want to change a password of another user, you can run the passwd command, as follows:
|$ sudo passwd <USERNAME>|
For example, to change root password in Raspberry Pi, execute:
| [email protected]:~ $ sudo passwd root|
Retype new password:
passwd: password updated successfully
NOTE: in Linux the password does not show up in the terminal when you type it – no asterisks, no dots, no nothing but that’s expected, for security reason if you are accessing to the system and if there's someone near you. Just type in your password and hit the Enter key.
Accessing Raspberry Pi with SSH
A common request is about accessing the Raspberry Pi without connecting the Pi to a screen, keyboard and mouse and intend on using it via remote control, the first thing we will need to do is access it via Terminal to set up a few things.
In order to access the Pi in terminal, we need to estabilish a connection to it by using SSH, a secure protocol. If you are using Mac or Linux, this can be done directly from the Terminal application within the operating system without any additional software.
If you are using Windows, you will need to download and install an SSH client software. A common choice is PuTTY and you can download it from the official website.
It is not possible to access the Pi with SSH using the default disk image that we just prepared as the option is disabled by default. However it is quite simple to enable this option without having to connect a screen, keyboard and mouse. We simply need to create a blank file in the root of the SD card named ssh with no file extension.
Once you have created the file you can remove the SD card and put it into your Pi. Connect the Pi to your network using the Ethernet port and power it up.
Find the LAN IP address assigned to the Pi
The easiest way to find the IP address assigned by your router, using the embedded DHCP server, to the Raspberry Pi is to log in to the router and give a look at the list of connected devices. This will be a slightly different process for different router/ISP configurations so you will need to consult the manual for your equipment.
Usually navigating to http://192.168.0.1 or http://192.168.1.1 in your browser will yield the router management settings.
Another method to identify the Raspberry Pi without accessing the router is, after putting SD card into the Raspberry Pi and booting it up and waiting for a couple of minutes, the following: run command arp -n -a, or arp -av on Windows, from your desktop or notebook computer that is connected on the same network.
The command will provide a list of IP addressed that is connected to the network. If the Raspberry Pi has a build-in Wifi, it is easy to spot the IP address by looking at MAC address as Raspberry pi MAC address always started as DC:A6:32:xx:xx:xx, B8:27:EB:xx:xx:xx or E4:5F:01:xx:xx:xx.
On Mac/Linux systems we will need to open the Terminal application. Then simply enter the following command:
|ssh [email protected]|
Of course you should replace the IP address with the IP address of your Raspberry Pi. Note that we are using the pi user (not the root):
|ssh [email protected]<your-ip>|
Enter the default password raspberry and be sure to change it once you have access.
On Windows, in order to access the Pi we will use our SSH client, so go ahead and open PuTTY. Enter the Pi IP address and ensure SSH is selected under connection type. The logic port used will default to 22 but you can enter this if it is missing.
By clicking Open button a command line window will open and we will be prompted to enter the login. The default username is pi and the default password is raspberry so be sure to change it when you get the chance (as soon as possible, especially if you are going to expose your device and SSH on Internet side....and this is absolutely NOT recommended in any case).
Add Wifi configuration at first boot
To be able to pre-configure the Raspberry Pi, not only with SSH but also with WiFi connection pre-established we will need to create a file name wpa_supplicant.conf, preferably using Notepad++, and copy it to SD card, in the root folder. The content of wpa_supplicant.conf looks like this:
Replace wifi_ssid and wifi_password with your actual wifi network information. The wpa_supplicant.conf file will get copy to /etc/wpa_supplicant/ directory automatically once the Raspberry Pi is booted up.
Replace the country code with your country’s ISO 3166-1 alpha-2 code, if you are not sure about your country’s alpha-2 code, you can find out from: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements (check the Code column).
If the network you are connecting to does not use a password, the wpa_supplicant entry for the network will need to include the correct key_mgmt entry. For example:
If you are using a hidden network, an extra option in the wpa_supplicant file, scan_ssid, may help connection.
These approaches will work with any Raspberry Pi OS version (Desktop or Lite).
Direct Ethernet Connection
If your PC has a spare Ethernet port (usually this happens when using a laptop only with WiFi connection) or you have an Ethernet-to-USB dongle, you can use a network cable to go directly from your Pi to your computer. Just make sure that you have Bonjour software installed on your PC and SSH enabled on the Pi. Then, you can just connect the two devices over Ethernet.
NOTE: the Bonjour software, by Apple, is an open-source application that implements the Zeroconf technology, when installed on Windows systems, and will send and receive network packets on UDP port 5353. This technology, when used on both endpoints (client and "server") helps, by assigning the system a name (for example the default raspberrypi.local hostname), to easily access from other computers on the LAN the Pi device.
Zeroconf is provided through an optional package called Avahi. It is super easy to install from the command line:
|sudo apt-get install avahi-daemon|
This takes about five minutes. Once installed, the system can be contacted from other computers at hostname.local, where hostname is either the default (raspberrypi) or an alternate name assigned in the Advanced menu of raspi-config.
If you want the Raspberry Pi to get its Internet connection from your PC over the Ethernet port, you need to do the following in Windows 10.
Navigate to the Network Connections menu, which is part of the old-school Control Panel. You can get to this screen by going to Settings -> Network & Internet -> Wi-Fi and then clicking "Change Adapter Settings" on the right side of the screen. This works whether you are sharing an Internet connection that comes to your PC from Wi-Fi or from Ethernet.
Right-click on the adapter (for example Wi-Fi connection) that's connected to the Internet, and select Properties. Then enable the "Allow other network users to connect" on the "Sharing" tab.
Then select the Ethernet port that is connected to the Raspberry Pi from the "Home networking connection" menu, and click Ok.
At this point, if you have installed the Bonjour service on your Windows system, you should be able to enter raspberrypi or raspberrypi.local as the address you wish to connect to in Putty, and clicking Open button. You usually need to add the .local if the Pi is directly connected to your PC via Ethernet cable.
Installing Raspberry Pi OS on SD Card directly from Android
Another method to prepare an SD card with the Raspberry Pi OS, not so used but that could be useful if you do not have a laptop or a SD Card reader available, is by using an Android app called Pi SD Card Imager (you will find a direct download link to the .apk in the download section below).
This handy app can:
- Can use internal / external SD card or USB card reader.
- Write while downloading - doesn't use up GBs of space of phone.
- Safe - by default does not delete files on SD.
- Write Raspbian NOOBS / LibreELEC / Raspberry Pi OS SD cards without root.
What is NOOBS?
Someone could be a bit confused, when searching for Raspbian on search engines, finding "NOOBS" as a result to this search; well, NOOBS is NOT a real operating system, but it could be very useful.
New Out Of the Box Software (NOOBS) is not a conventional Operating System (OS) - it is an Operating System installer which is easy for beginners to use.
NOOBS enables users to install/re-install one or many OS and to configure which OS boots by default.
NOOBS contains Raspberry Pi OS (once it was called Raspbian) and LibreELEC. It also provides a selection of alternative operating systems which can then be downloaded from the internet and installed.
Raspberry Pi OS vs NOOBS
If you only want to run Raspberry Pi OS (the officially supported Raspberry Pi OS) there is no benefit is using NOOBS.
Raspberry Pi OS can be set up to run in headless mode (without a screen or keyboard) - this is not possible with NOOBS.
Once setup NOOBS enables the user to install/re-install OS directly on the Raspberry Pi without any other computer access (but does require a network connection).
NOOBS does permit multi-boot.
Here will be mirrored some useful tools, shown in this article, and ready for direct download.SD Card Formatter 5 Bonjour Service (mDNS Protocol) 2.0.2 Raspi Card Imager 1.08-V83 Win32diskimager 1.0.0