For this project, I am using a Ras Pi 4 with 4G ram.
-
Start with a fresh install of Raspberry OS
- Raspberry Pi Imager v1.6.2
- I installed the lite version (no desktop)
- Only 400 MB for download
- Using a 32 GB micro SD card
-
Create an SSH file within the Boot drive
- This will tell the Pi to turn on SSH
If you have the latest version of R-Pi Imager, they have now included “Advanced options” to auto configure many settings while it’s writing the image. Brilliant!! (saves a bit of time too)
- Before you click “Write”, press Ctrl + Shift + x, this will bring up the Advanced option menu
- Here, you can select the “Enable SSH” box, and even configure location services
- Click “Save” and you are ready to Write away!
For those who like it the “old skool” way, do the following:
On a Windows machine:
- Within the File Explorer, navigate to the Boot drive (your SD card)
- Right-click in the folder and go to New > Text Document
- Rename the file "ssh" and delete any file extension affiliated
- Eject the SD card
On a Mac via Terminal:
- Change directory to the boot drive
- Navigate to root > Volumes > boot
cd /
cd /Volumes/boot
- Create a file called "SSH" with no extension
touch ssh
ls
- You will need to navigate away from the boot drive in the Terminal before you can eject. The easiest way is to just type
cd
- This will bring you right back to your home directory
- Eject the SD card
-
Insert the SD into the Pi and power it up
-
Find the IP of the Pi
-
SSH into your Pi
- The password should be "raspberry"
ssh pi@[IP address of Pi]
-
Update your Pi
sudo apt update && sudo apt upgrade -y
- The “&&” allows you to run two commands at once
- The “-y” flag auto agrees to push the upgrade
-
Set a static IP
- Edit the “/etc/dhcpcd.conf” file to configure the ethernet interface “eth0” with the nano editor (or your other favorite text editor):
**sudo nano /etc/dhcpcd.conf**
- Scroll to the end of the file and add the following lines, making sure to replace the values for “interface”, “ip_address”, “routers” (gateway) and “domain_name_servers” based on your LAN settings:
**#Ethernet static IP configuration
interface eth0
static ip_address=192.168.xxx.xxx/24
static routers=192.168.xxx.xxx
static domain_name_servers=192.168.xxx.xxx**
- If you are planning on running Pi-Hole in Portainer, we will be revisiting this to set the DNS server to the IP of Pi-Hole
- Press the “Ctrl” + “x” key combination, then “y” and <Enter> to confirm writing changes to the file.
- Reboot the Pi using:
**sudo reboot**
- When the Pi boots again, login with “pi” user and verify “eth0” IP address with the command:
- Make sure to use the new IP for ssh
**ip a**
- Reset password for the Pi using: