Skip to content

Setting up new pi

Setting up a new Raspberry Pi

[1] Install Raspberry Pi OS on SD card

Download and install the Raspberry Pi Imager tool and install the Raspberry Pi OS onto the SD card.

[2] Enable SSH

  • Plug the SD card into your computer (Mac/Linux) and create a file called "ssh" in the root directory.
  • On Mac, run cd /Volumes/boot and then run touch ssh
  • You can now plug the SD card into the Raspberry Pi and turn it on.

[3] SSH into the Raspberry Pi

  • Once the Raspberry Pi is connected to the network and it is turned on, log into your router to find it's IP address.
  • Then log into the Raspberry Pi from your computer by running ssh pi@<local_IP>
  • Once logged in:
    • install vim, run sudo apt install -y vim
    • change the password by running passwd

[4] Disable Wifi and Bluetooth

  • run sudo vim /boot/firmware/config.txt
  • find the section at the bottom with [all] and add the following below it: shell dtoverlay=disable-wifi dtoverlay=disable-bt
  • confirm that wifi and BT are disabled, run ifconfig, there should not be a wlan0 listed.

[5] Assign a static IP

Set the static IP address in your router's settings.

Alternatively, you can make the device have a fixed IP address:

  • edit the dhcpcd.conf file by running vim /etc/dhcpcd.conf
  • at the bottom, paste the following code: shell interface eth0 static ip_address=192.168.0.205/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1
  • Run sudo reboot to restart the Raspberry Pi

[6] Assign a device name

  • Go into the setting by running sudo raspi-config
  • Navigate to System Options > Hostname
  • Choose a new device name
  • Reboot the Raspberry Pi
  • After rebooting, run cat /etc/hostname to confirm the new hostname

References:

  • https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up
  • https://www.raspberrypi.org/software/
  • https://www.raspberrypi.org/documentation/remote-access/ssh/
  • https://www.raspberrypi.org/documentation/remote-access/ssh/unix.md
  • https://www.smarthomebeginner.com/pi-hole-setup-guide/