So you have just bought a new Raspberry Pi – how to get it up and running? You will need to provide a power source and install an operating system. Then you can connect to it either locally (monitor, keyboard, mouse) or remotely using your network.
This article focuses on Raspbery Pi 2 model B, but it applies also to all versions of Pi 1.
- Power supply
A 5 V adapter with micro USB connector (a charger for most today’s Android phones). It should be able to provide current of at least 0.8 A (more is required if you plan to connect additional USB devices to the board).
- SD card
Recommended at least 4 GB class 4. If you are buying a new one then you should go directly for class 10 to get higher reading/writing speed.
- SD card reader
Required only the first time to write an OS on the card using your PC workstation.
- Monitor (HDMI), USB keyboard and mouse
This is needed to use Pi locally and perform the initial OS and network setup. It is possible to get an HDMI-to-DVI cable/converter if your monitor does not have HDMI input. Another simple option is to use any high-definition TV. It is just temporary, disconnected after the setup.
Either an Ethernet cable with RJ-45 connector or a USB Wi-Fi dongle. It will allow you to access Pi remotely (head-less setup).
If you are not sure which operating system is the right one for you, then I recommend to start with NOOBS – New Out Of the Box Software. It is a simple OS installer with Raspbian, which also allows you to easily select an alternative OS (automatically downloaded and installed by NOOBS). You can get the latest version here.
Let’s format your SD card:
1) Windows and Mac OS X
- Download, install and open the SD Association’s Formatting tool from https://www.sdcard.org/downloads/formatter
- Make sure you have selected the Drive your SD Card is inserted in
- Click Format button
- Use gparted (or the command-line version parted if you prefer)
- Format the entire disk as FAT32
Now extract the downloaded file (NOOBS_vX_X_X.zip) and copy its content to the SD card.
Insert the card to your Raspberry, connect a monitor, keyboard, mouse and power. If you choose Raspbian installation in the menu, it will run through the process and then first time you boot the system a configuration tool will be shown. Follow its instructions to finish the installation and configure OS (keyboard layout, timezone, passwords, …).
The default account for logging in to Raspbian is:
If the graphical interface does not show up, type “startx” in the command line:
The easiest way to connect to the network is to use an Ethernet cable (with RJ-45 connector). The OS will try to get an IP address and other settings automatically from your DHCP server. Then you just need to find out what is the assigned IP address using ifconfig command:
If you do not have any DHCP server, then a static IP configuration is necessary.
- Open the network configuration file with “sudo nano /etc/network/interfaces”
- Remove the line “iface eth0 inet dhcp”
- Add the following lines (replace IP addresses and mask with your own):
iface eth0 inet static
gateway 192.168.0.1Save the file by pressing CTRL-X and select Y to save the changes.
- Open DNS configuration file with “sudo nano /etc/resolv.conf”
- Enter the following Google public DNS server IP addresses (or modify with your own):
nameserver 184.108.40.206Save the file by pressing CTRL-X and select Y to save the changes.
- Reboot the system with “sudo reboot”
Another option is to connect a USB Wi-Fi. In such case Raspbian offers a graphical user interface to scan and configure the wireless networks. You can find it among other tray icons in the system panel.
Now you should be able to connect to your Raspberry IP address remotely (from your LAN) using any SSH client (e.g. Putty for Windows).