CloudYourself Introduction: Setup Raspberry Pi
Tags: tutorial, raspberrypi, docker, cloud
Published: 2023-03-15 16:21:32

There are numerous services that may be run within your homelab, however the important question remains: is it truly worthwhile? Throughout this series, we are going to setup some of those services, while simultaneously discussing the pros and cons, so you can decide ahead of time if you wanna do it.

### Preface

We will focus on utilizing a Raspberry Pi, although any outdated pc or the Raspberry Pi alternatives [here](https://www.youtube.com/watch?v=uJvCVw1yONQ) with ubuntu would also do the trick. It is important to note that a Pi possesses sufficient capabilities to support all services discussed in this series, but not for tasks like media encoding for Plex.

### Chosing an OS
My suggestion is to use an Debian-based headless distribution - we won't need a desktop environment. For those who utilize Pi, Pi OS Lite is an excellent choice, as it offers stability, uses the apt packet manager, remains headless, and excludes extraneous packages.

#### Requirements 
- 🍓 Raspberry Pi
- 💾 MicroSD Card (+16 GB recommended)
- 📡 WiFi or 🔌 Ethernet
- 🖥️ Dekstop or 💻 Laptop

## Step 1: Download Raspberry Pi Imager
The [Raspberry Pi Imager](https://www.raspberrypi.com/software/) is  a utility application which helps installing an OS on a *microSD* card. After installing it, you should be seeing the following:

![Raspberry Pi Imager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8xhgh39byobyzaymeijp.png)

## Step 2: Setup Pi OS 🛠️
Click on *CHOOSE OS* -> *Raspberry Pi OS (other)* and then scroll down to select *Raspberry Pi OS Lite (64-Bit)*.

![Raspberry Pi Imager selecting the OS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vtcu5p79xqbr0l626tn.png)

Next click on the settings icon in the right bottom cornern. Select the first box and set a hostname for your pi. Select *Enable SSH* with *Use password authentication* and set a username and password below. (We will need it later, when we connect per ssh)

![Raspberry Pi Imager advanced options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rf642utsk6d2kdn7dgun.png)


If you are not going to use ethernet, we have to setup WiFi. Failing to do so will result in an inability to access the Pi, as it remains headless - without a desktop interface.

![Raspberry Pi Imager advanced options setting up WiFi](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/661tnfyqned20tvfiblg.png)

Disable the telemetry setting at the bottom and click on *save*.

## Step 3: Plug your microSD 💾 card and flash ⚡ it

Click on *CHOOSE STORAGE* and select your microSD card. Confirm the name and the size before you select it, since everything will be deleted on the storage device you select.

Click on *Write* to start flashing and wait until it is done and you see a message.

## Step 4: Start your PI 🍓 and find it

With your microSD card inserted, plug in the pi to power. It will start automatically. It takes about 15 - 30 seconds for the pi to boot.

To find the local ip address, go to your routers dashboard. After logging in you should see an overview of connected devices. Find your Pi with the hostname you selected in the list and note the ip address of it.

## Step 5: Connect ☎️ via SSH

Open a terminal on your computer and type

```
ssh USERNAME@YOUR_IP_ADDRESS
```

If you entered the correct ip address, it should ask for a password

```
USERNAME@YOUR_IP_ADDRESS's password:
```

After typing in your password you should see something like

```
USERNAME@HOSTNAME:~ $ |
```

Congratulations 🎉

## What's next?

Next time we are going to install **Portainer**, a web interface that helps us manage our docker containers. It's like Docker Desktop, but better. It will be usefull to setup new docker containers and maintain them.