Part 1 – Setup the Pi – Cost Effective Web Site Series
Last Updated on August 24, 2021 by Hammad Rauf
(This article is a work in progress – Please do re-visit later when it has been completed).
This is the first part of the article series about setting up a cost effective web site in your home or small business office.
To start with you need to have the following items:
- One of Raspberry Pi 2B, Raspberry Pi 3B or Raspberry Pi 4B
- Heat Sink (Optional for 2B)
- A Plastic or Aluminum Case for your Model of Raspberry Pi
- Wall Power Adapter
- SD Card (8 GB or higher)
- USB Thumb Drive (16 GB)
In this article we will look at how to prepare the SD-Card for initial boot. Then we will connect to raspberry pi using SSH protocol. Then we will assign fixed IP address to Wired and Wifi network settings. Then we will prepare the USB thumb drive for use with raspberry pi. After that we will mount the USB thumb Drive to a fixed location so even if we unplug and re-plug the USB drive or if the Pi is rebooted, it automatically re-mounts to the same location every time, as long as the USB drive is not re-formatted.
Download the Operating System (OS)
The Raspberry Pi can run different operating systems some of which may not be listed on the official Pi Operating Systems page. This series of articles will be giving instructions for the official OS for Raspberry Pi only, the “Raspberry Pi OS” also known as “Raspbian”. You can download the OS from the Official Page. You can download any of the following:
- Raspberry Pi OS with Desktop and software
- Raspberry Pi OS with Desktop
- Raspberry Pi OS Lite
The first 2 options use more SD Card space and include a Graphical User Interface (GUI). But since we plan to use our Pi as a “headless” server without a directly connected monitor – it may improve response time of your Pi, if you do not use one of the first two. The 3rd option (Raspberry Pi OS Lite), if you do not plan to use the GUI, will take less space on the SD Card, and may give better response times. I will try to provide all the commands that we will need in these articles. On my Raspberry Pi I have installed the 2nd option “Raspberry Pi OS with Desktop” as I do sometimes connect a monitor or use VNC Viewer for a remote GUI Desktop session.
Copy the OS to SD Card
Prepare SD Card for first boot
a. Enable SSH
b. Setup Wired (Ethernet) Connection IP Address
c. Setup Wifi Connection (if needed)
Initial Login
Prepare USB Thumb Drive
a. Format as ext4 format (recommended)
b. Format as FAT32 (if desired)
Setup USB Mount in Pi “fstab” file