Being a tinkerer comes with a cost: we routinely modify, break, and redo our installations, and that takes time and effort. Some of us even go through several installation and re-installation cycles every day! This effect is even more pronounced on the Raspberry Pi – this pocket computer practically begs you to tinker with it, much more than other gadgets do.
Setting up the Raspbian OS on a Raspberry Pi is one taxing job. Preparing the SD card, flashing a Raspbian OS image on it, and doing post-install configuration such as changing the password, setting up Wi-Fi, and installing software is a time-consuming and monotonous cycle. To avoid it, we can use the excellent PiBakery tool, available for Windows and macOS.
Note: If you are looking to set up Raspberry Pi’s hardware, you should check out our detailed article on getting started with Raspberry Pi.
Simplify Setting Up Raspberry Pi with PiBakery
PiBakery features an easy-to-use, block-based interface, that you can use to drag and drop different tasks that you want your Raspberry Pi to perform, which will be turned into scripts and written to your SD card. Unlike the manual method to install and configure Raspbian OS, PiBakery offers a much simpler method for installing Raspbian OS.
So, let’s see how to set up and configure a Raspbian installation on your SD card with PiBakery. Starting with the basics:
Create an SD Card
First, download and install PiBakery. It is a big download (nearly 1.3GB), as it packs in the entire Raspbian OS along with it, so it might take a while, depending on your network connection. After installation, insert your SD card in your computer, and run PiBakery. You will see a screen like the following:
This is our workspace. You will notice some items on the left hand side such as Startup, Programs, and Network. Here, we can choose which scripts to run, and when. Feel free to click on each tab, and check out what scripts it contains.
To start creating your first installation, click on Startup, and click and drag the “On First Boot” block to your workspace. As the name suggests, whichever scripts we put below this block will specify what happens when we boot up our Raspberry Pi for the first time.
We will first set up what is probably the most common option for most people – setting up WiFi. Click on the Network tab, and drag the “Setup WiFi” block to below the On First Boot block that we previously placed. After that, fill in the hotspot name, passcode, and the type of connection as per your requirements.
Another common modification most people make is to change the password for the default user
pi. Many also like to change the hostname of the system. Both these options can be found in the Settings tab. So drag the appropriate blocks to the workspace, and modify them accordingly:
That is it for the first boot. If there are scripts that you want to run every time you boot up your Pi, click on the Startup tab again, and this time, drag the “On Every Boot” block to your workspace. You can then drag and drop any other blocks below this one, just like with the On First Boot block.
You will notice that I added several blocks here. Here is what they do, from top to bottom:
- Set up WiFi
- Change the ‘pi’ user’s password to
- Set the hostname to
- Update the
aptrepositories (as root).
- Install the programs
- Download a script to my Home folder, and name it
- Make the script executable using
- Reboot the Raspberry Pi (required for changing hostname).
After these are executed, on the next boot, and every boot thereafter, it will execute the
mybootscript.sh script, as specified in the On Every Boot block on the right.
If you make a mistake, or think that you do not need certain blocks anymore, you can simply drag and move them to the trash can, present in the lower right corner:
Once you are satisfied with your configuration, click on the blue SD card icon subtitled “Write” on the top right corner. It will ask you to select your SD card drive (be careful here, as selecting the wrong drive can cause permanent data loss), and also to choose the operating system. Choose Raspbian Full here if you want a GUI, or Raspbian Lite if you don’t. After this, click on “Start Write“, and PiBakery will wipe your card, install Raspbian, and add the scripts that you selected.
You will soon receive an “Installation Successful” notification. You can now remove the SD card from your system, insert it into your Raspberry Pi, and boot it up. After the familiar Raspbian bootup sequence, you will see PiBakery running the scripts you chose:
Be patient, as it will take a while to complete, depending on the scripts you selected. However, this is a one-time delay, since most of the configuration scripts will only run on the first boot.
Editing an SD Card
You can add, remove, or modify the “On Every Boot” blocks that you added to an SD card using PiBakery. It is also possible to add more one-time blocks to it. For instance, you may decide that on the next boot you want your password changed, and that Raspbian should boot in text mode from now onwards. To do this, insert the SD card that you want to modify in your system, and open PiBakery. It will detect the card, and show you a message like the following:
Select Yes here. You will now see the “On Every Boot” block in your workspace (if you had added any). Now, click on the Startup tab on the left. Astute readers will notice that instead of On First Boot, an “On Next Boot” block is present here. Drag it to your workspace, and add any blocks that you like. In the following example, I’ve added blocks to change my password, and set my Pi to boot in Console (text-only) mode. I’ve also added a Reboot block since changing the Boot Option requires it.
All you need to do now is click on the Update button on the top right. After that, remove the SD card and boot your Raspberry Pi with it.
Importing and Exporting Configurations
You might find yourself using the same (or similar) configuration for every installation. For instance, you probably want to connect to the same WiFi network, install the same set of programs, and set the same password for every installation. To do this, add and modify blocks to your preference. Once you are satisfied, click on the Export button on the top right, and choose a file name and location for it. You can create and save as many different configurations as you like.
To restore your configuration the next time you run PiBakery, simply click on the Import button, and select the configuration you saved earlier. You can then easily modify it further, or write it to a SD card.
SEE ALSO: How To Run Commands on Raspberry Pi by Email
Set up and Configure Raspbian OS Installation with ease using PiBakery
So that is how we use PiBakery to simplify the installation and configuration of Raspbian on a Raspberry Pi. Never again will you have to reconfigure your Pi after you break an installation by tinkering too much. Just import a previous, working configuration in PiBakery, and write it to your card. So feel free to tinker and experiment on your Pi to your heart’s content.
That’s it on the installation side of things. If you want to change the look of your Pi, check out 15 great Raspberry Pi cases. If you have questions, doubts, or suggestions for Raspberry Pi projects to cover, let us know by dropping us a line in the comments section below.