The Raspberry Pi is a computer the size of a credit card that can run an operating system. The first Raspberry Pi was released in 2012, and it has been nine years since then. Over these nine years, a variety of interesting Raspberry Pi projects have emerged: satellite manufacturing companies have installed Raspberry Pis in artificial satellites, providing imaging and image transmission capabilities; tech enthusiasts have used Raspberry Pis to set up web servers, NAS, and smart homes; gamers have utilized Raspberry Pi to enable online multiplayer for the 1989 GameBoy; and tech bloggers have used Raspberry Pi to collect and recognize street views, creating a machine that praises passing dogs. The Raspberry Pi is beloved for its credit card-sized dimensions, comprehensive hardware and software features, and the rich playability that comes from the combination of the two, continuously attracting new users. This article serves as a beginner’s guide for those ready to dive into the world of Raspberry Pi.
Is it still necessary to write a Raspberry Pi beginner’s guide in 2021? After some research, I believe the answer is yes. Although there are already many beginner-friendly Raspberry Pi tutorials available online, authors from our team, @ZihuiJun and @Sunbelife, published related articles in 2014 and 2017 respectively. However, on the one hand, the hardware and software of Raspberry Pi have been updated frequently, and some tutorials are outdated and need to be revised or supplemented. On the other hand, some tutorials are scattered and not user-friendly for beginners. Therefore, I hope to compile a comprehensive and easy-to-understand Raspberry Pi beginner’s guide for 2021, avoiding obscure terminology and lengthy code, aiming to allow even the most inexperienced new players to successfully complete the purchase, setup, and use of Raspberry Pi by reading just this article.
Let’s get started.
❗Note: This article requires a computer running Windows or macOS (hereafter referred to as PC). The operations demonstrated in this article are performed on a Windows computer, but I will also provide methods for macOS users.
▍Buying Raspberry Pi and Accessories
As of June 2021, the official Raspberry Pi Foundation website has 11 Raspberry Pi products available for sale. Among these 11 products, one is the Raspberry Pi Pico released in January this year, which is a microcontroller development board; the other 10 products are computers that can run operating systems. Based on appearance, configuration, and performance, these 10 products can be divided into three series:
-
Model B Series: The flagship model -
Model A Series: Smaller in size, with slightly reduced configuration and interfaces -
Zero Series: Extremely compact
I created a simplified product introduction image that displays the model and appearance reference photos of each series. The darker the color of the model number, the later it was released and the higher its configuration and performance; except for the Raspberry Pi 400, the scaling ratio of the other product photos is the same, allowing for a direct comparison of their size differences. The Raspberry Pi 400 is a Raspberry Pi 4 Model B with a keyboard “skin”; both have the same configuration.
▲ The 11 Raspberry Pi products available for sale, product appearance photos sourced from the Raspberry Pi Foundation
According to the electronic product principle of “buy new, not old,” I recommend that new players who are holding off on purchasing and preparing to dive in should buy the Raspberry Pi 4 Model B (also known as “Raspberry Pi 4B”) outright, as it is the latest flagship product with the most complete functions and interfaces. This not only reduces the difficulty of getting started but also provides multiple playability when we are still unsure of what we want to do with the Raspberry Pi.
In addition to the Raspberry Pi itself, we also need to purchase some accessories:
▲ These are sufficient
For purchasing channels for the Raspberry Pi, you can find authorized distributors’ Taobao stores on the Raspberry Pi Foundation’s official website; additionally, the Raspberry Pi Laboratory also has an official Taobao store, both of which are reliable purchasing channels. As for the charger, if you already have one that meets the requirements, you do not need to purchase a new one. It is important to note the power interface type of the Raspberry Pi model you purchase; the Raspberry Pi 4B uses a USB-C interface, while earlier products use a MicroUSB interface.
▍Burning Raspberry Pi System
The Raspberry Pi is a computer, so we need to prepare an operating system for it. After purchasing the Raspberry Pi, the next thing to do is to choose and download the appropriate operating system and burn it onto a TF card.
Currently, the Raspberry Pi Foundation and third-party developers have developed multiple operating systems for the Raspberry Pi. The official system developed is called Raspberry Pi OS, formerly known as Raspbian, and is currently updated to version 5.10, compatible with all Raspberry Pi products (except for Pico). As beginners, we will first use the officially recommended Raspberry Pi OS desktop version to get started, and after getting the hang of it, we can explore other fun systems later. If the TF card has sufficient storage space (≥ 16 GB), we can also use the version with “desktop + common software.” Follow the community and reply “0708” in the background to obtain the download link.
Now, we will connect the TF card to the PC via a card reader.
Next, we will download and install a software called Win32DiskImager used to burn img files to the TF card. Follow the community and reply “0708” in the background to obtain the download link.
Open Win32DiskImager, select the downloaded img file in the “Image File” section, ensure that the “Device” selected is the corresponding drive letter of the TF card, and then click “Write.” At this point, the software will prompt a “Confirm overwrite” warning; click “Yes” to start the burning process.
Once the burning is complete, the TF card will generate another partition that Windows cannot recognize, and the PC will immediately pop up warnings such as “Cannot access volume” or “Needs formatting”; we can ignore these warnings.
At this point, the TF card has Raspberry Pi OS installed; we can insert the TF card into the slot at the back of the Raspberry Pi. The Raspberry Pi is ready, and if we connect a USB keyboard, mouse, a mini HDMI to a monitor, and power it on, we can operate the Raspberry Pi just like any other computer.
▲ Image source:Raspberry Pi Foundation
However, we do not need to treat the Raspberry Pi as our main computer, so we do not need to go through the trouble of equipping it with so many accessories. We only need the TF card and the power cable to access and control the Raspberry Pi from a PC. How to do this? It’s simple, just keep reading.
▲ We only need the TF card and the power cable
🍎 Note: When burning the system to the TF card on a macOS computer, the same approach applies, and you can use the burning software Etcher . Follow the community and reply “0708” in the background to obtain the download link.
▍Setting Up WiFi Connection and Remote Access
Raspberry Pi OS allows us to access and control the Raspberry Pi using a PC on the same WiFi network. This feature is called SSH service. To use this service to access the Raspberry Pi, after burning the TF card on the PC, do not eject the TF card yet; instead, prepare two files to copy to the TF card:
File 1: Create a new txt file, name it “ssh” and delete the extension; note that it is not “ssh.txt.” This file serves to enable SSH functionality on the Raspberry Pi.
File 2: Similarly, create another txt file, open it, and enter the following content:
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WiFi_Name"
psk="WiFi_PassWord"
key_mgmt=WPA-PSK
priority=1
}
Where ssid is the name of our home WiFi, and psk is the WiFi password. Once the content is entered, save and exit, and rename the file with the suffix changed to “wpa_supplicant.conf.” This file serves to allow the Raspberry Pi to connect to WiFi according to the content in our file.
Once both files are prepared, copy them to the root directory of the boot partition of the TF card, and then you can eject the TF card.
▲ Copy the two files to the root directory of the boot partition, paying attention to the naming and suffix of the two files
Now insert the TF card into the back slot of the Raspberry Pi and power it on. The first time the Raspberry Pi starts up, it will automatically read the “wpa_supplicant.conf” file, connect to WiFi according to the file content, and automatically enable the SSH service.
Next, we need to know the IP address of the Raspberry Pi connected to WiFi within the local area network to access it using a PC connected to the same WiFi.We can check the IP address assigned to the Raspberry Pi by accessing the wireless router’s management page:
▲ On the wireless router management page, locate the Raspberry Pi and check its IP address based on connection time, device name, and newly connected devices
Now, we will download and install a tool called PuTTY for accessing the SSH service on the PC. Follow the community and reply “0708” in the background to obtain the download link.
Open PuTTY, enter the Raspberry Pi’s IP address in the “Host Name” field, leave other options unchanged, and click “Open.” If this is the first time connecting to this IP address, the software will pop up a key confirmation warning, and we click “Yes” to proceed.
The software will then pop up a command line window:
In the “login as:” field, enter the default username “pi” for Raspberry Pi OS and press Enter; then in the “xxx password:” field, enter the password “raspberry” and press Enter. Note that the password entered will not be displayed in the command line, so if you see no response while typing, do not doubt whether there is a problem; just type boldly.
When you see the window display “pi@raspberrypi:~ $”, it indicates that you have logged into the Raspberry Pi. Now we can control the Raspberry Pi using various Linux commands.
🍎 Note: To log in to the Raspberry Pi via SSH service on a macOS computer, you can use PuTTY on Mac. Follow the community and reply “0708” in the background to obtain the download link.
▍Accessing Raspberry Pi Desktop Remotely
Although we have successfully logged into the Raspberry Pi on the PC, we have entered its command line interface. As beginners, we certainly hope to access a more familiar graphical desktop. This is possible, and this time we will use the VNC service of Raspberry Pi OS.
First, we need to enable the VNC service. We log into the Raspberry Pi command line window via SSH on the PC and enter the following command to access the Raspberry Pi OS configuration page:
sudo raspi-config
▲ Raspberry Pi OS Configuration Page
In the configuration page, select “3 Interface Options” > “P3 VNC” in sequence, press Enter, and when prompted “Would you like the VNC server to be enabled?”, select “Yes” to enable the VNC service. The system will automatically return to the configuration page; select “Finish” to exit the configuration page and return to the command line window.
Next, we will download and install a client called VNC Viewer for accessing VNC. Follow the community and reply “0708” in the background to obtain the download link.
Open VNC Viewer, enter the Raspberry Pi’s IP address in the top address box, and press Enter to connect. The first time you connect, a security warning will pop up, and we will agree to proceed. At this point, the software will pop up an authorization window; after entering the account password, click “OK,” and the software will successfully log in to the Raspberry Pi’s graphical desktop.
▲ Familiar graphical desktop
🍎 Note: To log in to the Raspberry Pi desktop via VNC service on a macOS computer, you can use VNC Viewer for macOS. Follow the community and reply “0708” in the background to obtain the download link.
Next, I will introduce two common issues that may arise when accessing the Raspberry Pi desktop via VNC Viewer on the PC, along with their solutions.
How to Solve the “cannot currently show the desktop” Issue
We may encounter the following issue: successfully connecting to the Raspberry Pi in VNC Viewer, but the pop-up window is black and displays “cannot currently show the desktop.”
This is due to the desktop resolution of Raspberry Pi OS being inappropriate. The solution is simple:
Log in to the Raspberry Pi command line window using PuTTY, enter “sudo raspi-config” to access the configuration interface, select “2 Display Options” > “D1 Resolution,” and then choose a resolution such as 1280×720 or 1920×1080, save and exit. When reconnecting in VNC Viewer, the desktop should display correctly.
How to Adjust VNC Viewer Display Resolution for Raspberry Pi Desktop
Following up on the previous issue, even if we have set the Raspberry Pi OS desktop resolution to 1920×1080, why does the resolution still appear low when accessing the desktop via VNC Viewer on the PC?
▲ When accessing the Raspberry Pi desktop via VNC Viewer on the PC, even maximizing the window does not fill the PC screen
This is because, although we modified the Raspberry Pi OS desktop resolution, we did not adjust the VNC service resolution. After some research, there is a solution:
In the command line window (you can log in using PuTTY or open the command line window on the desktop connected via VNC Viewer), execute the following command:
vncserver -geometry 1920x1080
This command modifies the display resolution of the VNC service to 1920×1080. After executing it, the Raspberry Pi will prompt that another port “ip address:1” has been generated for VNC Viewer to connect.
We can enter the new port address “ip address:1” in VNC Viewer to connect, and after entering the account password, the resolution in this window will be 1920×1080.

▲ Now the resolution of the Raspberry Pi desktop accessed via VNC Viewer is 1920×1080
However, the mouse pointer in the new window has changed to an “X”. We can execute the second command in the new window:
lxappearance
This will switch the mouse pointer back to the familiar arrow.
▍Transferring Files Between PC and Raspberry Pi
We can now conveniently access the Raspberry Pi’s command line window and desktop on the PC. Now, let’s set up the functionality to transfer files between the PC and the Raspberry Pi by setting up an FTP server on the Raspberry Pi using vsftpd, an FTP server running on UNIX-like systems.
We open the Raspberry Pi command line window (to review: we can use PuTTY to log in to the command line window or log in to the desktop via VNC Viewer and then open the command line window), and enter the following command to install vsftpd:
sudo apt-get install -y vsftpd
Once installed, enter the command to open vsftpd’s configuration file and make some necessary settings:
sudo nano /etc/vsftpd.conf
In the opened configuration file, we will uncomment the following lines to activate them:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
The purpose of these contents is as follows:
▲ Before modifying the “vsftpd.conf” file
▲ After modifying the “vsftpd.conf” file
After making these changes, enter the command in the command line window to start the vsftpd service:
sudo service vsftpd start
The operations on the Raspberry Pi are now complete, and an FTP server has been set up on the Raspberry Pi.
Next, we will download and install a client called FileZilla for accessing the FTP server on the PC. Follow the community and reply “0708” in the background to obtain the download link.
Open FileZilla, enter the Raspberry Pi’s IP address in the “Host” address box, along with the username and password, and set the port to 22. Then click “Quickconnect.” Once connected successfully, we will see the file directory of the Raspberry Pi in the “Remote site” section. Now, we can conveniently transfer files back and forth between the PC and the Raspberry Pi by dragging and dropping, which is very convenient.
🍎 Note: To access the Raspberry Pi’s FTP server on a macOS computer, use FileZilla MACOSX X86 6. Follow the community and reply “0708” in the background to obtain the download link.
▍Backing Up the Raspberry Pi System
Now that we can conveniently access and control the Raspberry Pi from the PC and transfer files, our Raspberry Pi tinkering journey officially begins. During the process of tinkering with the Raspberry Pi, we will inevitably install and configure various software, Python libraries, environmental dependencies, etc. Tinkering comes with risks, and to have a fallback option when things go wrong, we can back up the system at appropriate times so that we can restore it if needed. In the last part of this tutorial, let’s take a look at how to back up the Raspberry Pi system.
Based on research and testing, there are currently two methods for backing up the Raspberry Pi system, each with its applicable scenarios. Below, I will introduce both methods.
Complete Backup of the TF Card
The software we use on the PC to burn the system onto the TF card, Win32DiskImager, can also be used to create a complete backup of the system on the TF card as an image file.
After shutting down the Raspberry Pi, we remove the TF card and connect it to the PC via a card reader (again, ignore any “needs formatting” warnings that may pop up). Open Win32DiskImager on the PC, select the path to store the image file in the “Image File” section, and enter the name of the image file with the “.img” suffix. Ensure that the “Device” selected corresponds to the drive letter of the TF card’s boot partition, and then click “Read.” The software will transfer files from the “Device” to the “Image File”; once completed, the Raspberry Pi system on the TF card will be backed up to D:/Raspberry Pi/systemBackUp.img.
Now we have successfully backed up the current Raspberry Pi system to this image file. To restore this system, we simply need to format the TF card and follow the operations outlined in “2. Burning Raspberry Pi System” to burn this image file onto the TF card.
I recommend using SD Card Formatter to format the TF card, which has versions for both Windows and MacOS. It can conveniently and cleanly format the TF card without risking formatting other hard drives.
No other settings are needed; just click “Format” to complete the formatting.
This backup method is easy to operate; however, its drawback is that it requires a complete backup of the TF card, resulting in an image file size equivalent to the capacity of the TF card. Therefore, this method is more suitable for small capacity TF cards (≤ 16 GB). For large capacity TF cards (e.g., ≥ 128 GB), each backup will generate a 128 GB image file, which is clearly impractical. This leads us to our second backup method.
Backing Up Using the rpi-backup Script
This method uses the rpi-backup script written by a developer to back up the Raspberry Pi system. The image file generated by this backup method is about 1.2 times the size of the used space of the system, which significantly reduces the image file size compared to the first method, saving disk space occupied by the image file.
This backup solution needs to be executed on the Raspberry Pi. We need to copy the rpi-backup script file to the Raspberry Pi. We log into the Raspberry Pi command line window and execute the following command to clone the script file from Github to the Raspberry Pi:
git clone https://github.com/nanhantianyi/rpi-backup.git
We can also download the script from Github on the PC and transfer it to the Raspberry Pi via FTP. Follow the community and reply “0708” in the background to obtain the download link.
Next, in the Raspberry Pi command line window, execute the cd command to navigate to the path where the script is located. For example, if I placed the script file in the path pi/Downloads/rpi-backup-master:
cd Downloads/rpi-backup-master
▲ Entering the path where the script file is located using the cd command
Now, execute the following command in this path to run the “back.sh” script to back up the Raspberry Pi system as an image file:
sudo bash back.sh xxx.img
Where “xxx” is the name of the image file. The generated image file will be stored in the same path as “back.sh.” We can modify the “xxx” content to specify the storage path and name of the image file, such as Documents/systemBackUp.img, etc. To restore the system, we also need to format the TF card and burn the backup image file onto the TF card.
I used this method to back up my Raspberry Pi system, and the results are as follows:
As you can see, the image file size is about 1.24 times the used space of the system, much smaller than the capacity of the TF card.
This backup method is not without its drawbacks. The generated image file is stored on the TF card, and if the TF card does not have a large capacity and little remaining space, we need to mount a hard drive to a suitable directory on the Raspberry Pi and save the image file there. These operations may not be very user-friendly for beginners. Therefore, everyone should choose the backup method that suits them based on their actual situation.
▍Conclusion
The 2021 Raspberry Pi beginner’s guide is nearing its end. Let’s summarize the operations involved in this article through the following table:
I hope this article can be helpful to everyone. If you have any useful Raspberry Pi tips, feel free to share and discuss them in the comments!
Cover image sourced from Unsplash:@harrisonbroadbent
/ More Popular Articles /



