DEV Community

Cover image for Raspberry Pi Setup
Alemaño
Alemaño

Posted on • Edited on • Originally published at dotruby.com

Raspberry Pi Setup

1. Install Operating System on SD Card

The most straight forward way to install any Operating System on your Raspberry Pi is through the official Raspberry Pi Imager. It comes with all the tools needed to prepare and flash an SD card with the Operating System you want to install.

2. Enable SSH access

To enabled SSH we need to add an additional empty file called ssh to the SD card's root directory after is has been flashed with the image.

touch ssh
Enter fullscreen mode Exit fullscreen mode

3. Enable Wifi

To enable Wifi create a file in the root of boot called: wpa_supplicant.conf. Then paste the following into it:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK-NAME"
    psk="NETWORK-PASSWORD"
}
Enter fullscreen mode Exit fullscreen mode

4. Eject the micro SD card

5. Boot the Raspberry Pi

After booting up your device, you can connect to it via SSH by using its IP address.

ssh pi@[Raspberry Pi IP address]
Enter fullscreen mode Exit fullscreen mode

The default username is pi and the standard password is raspberry.

It's highly recommended to change the password on the first connection. You can do this and configure many other useful things in the handy Raspberry Pi Config tool:

sudo raspi-config
Enter fullscreen mode Exit fullscreen mode

6. Update and Upgrade

Start by updating and upgrading the system. This ensures you install the latest version of the software.
Open a terminal window and run the command:

sudo apt-get update && sudo apt-get upgrade
Enter fullscreen mode Exit fullscreen mode

7. Assign the .local Domain to Your Raspberry Pi

If you’re using your Raspberry Pi to host anything on your network, you might want to assign it a .local domain. With this, you’ll immediately be able to access your by a domain rather than remembering its IP address.

If you create a .local address for your Raspberry Pi you’ll be able to access your Pi using a simple web address.

To do this you need to install Avahi Daemon on your Raspberry Pi:

sudo apt-get install avahi-daemon
Enter fullscreen mode Exit fullscreen mode

Once the installation process is complete, you don’t even have to reboot the device. Your Raspberry Pi will begin immediately recognizing local network queries for its hostname (by default “raspberrypi“) at raspberrypi.local.

8. Install git

Sooner or later you will most likely end up needing git, so you can install it now.

sudo apt install git
Enter fullscreen mode Exit fullscreen mode

Disclaimer

This may not be the best way to do it, but it is the way I use and it works for me 😊

This article will be updated as soon as something changes in this process.

If you do something different and you think it is better, do not hesitate to let me know.

Top comments (0)