Setting up SNIPE-IT with DietPi on a Raspberry Pi

Setting up SNIPE-IT with DietPi on a Raspberry Pi

How to setup Rasberry Pi

The first step in setting up SNIPE-IT is to setup the platform that it will run on. Luckily the best platform and most economical is a Rasberry Pi. We are using a Rasberry Pi 3 in this case. Before we get too far we need to pick the operating system that the Rasberry Pi will use.

The drive or the card that we will use in the Rasberry Pi is a 64GB card, now we could use any size card we like, the smaller the card the leaner the OS needs to be so in this case I am going to pick a lean OS, DietPI is a great choice for this. If you chose a higher size card then maybe Rasberian or Ubuntu would be a good choice. The OS isn’t a huge factor in following along with the steps.

The concepts are still the same. At the core, we need to install the OS, install Docker, and then install Snipe-IT.

Ok so let’s continue on and set up DietPI on the SD Card.

We are using a Mac and I have an SD Card Reader. Once the card is inserted, I used the software created by Rasberry Pi called the Raspberry Pi Imager. This tool allows you to image the SD card and it gives you the option to pick any number of great operating systems to flash the card with. Unfortunately, DIetPI is not one of them. Therefore we must go to the DietPi website and download the image and use the tool to upload the image and flash the card manually.

Ok so we have the Rasberry PI 3 so we need to go to the DietPi website and download the right image file. You can download it here. The website gives you the option to pick the Rasberry Pi model that you have and it gives you the right build that will work for your device.

Once you have downloaded the right Image go back to the Raspberry Pi Imager and under operating systems click use custom.

Blog Photo

Once done you can upload the .img file you downloaded from the previous step.

Blog Photo

Then you will select the SD card and it will image the card with the DietPi image. It will happen very fast because DietPi is very small and compact thus the name.

Blog Photo

Now that DietPi is flashed you need to eject the SD Card and insert it into your Rasberry Pi.

Setting up WiFi & Initial Configuration

Note that your Pi is not going to have WiFi enabled so if you have a USB Wireless adapter like I do, you will need to first plug it into a network ethernet jack for it to connect to the network OR you will need to connect it to a monitor, keyboard and mouse so that you can interact with it. What did I do at this stage? I connected it to a keyboard, mouse and monitor.

When you first boot up the DietPi image on the SD card you will see the boot sequence and a launch screen with the default username and password shown.

Blog Photo

Use this default password to login to the Raspberry Pi. After you login it runs through a lot of updates and setup steps steps like setting up the language and keyboard localization.

Blog Photo

Blog Photo

You will then be prompted to change the global password which we highly recommend doing for security.

Blog Photo

Also for added security it will prompt you to change the default root password again we highly recommend doing this.

Blog Photo

Now your taken to the software update prompt, at this stage your being prompted to confirm and continue with the updates that are needed for DietPi.

Blog Photo

You must confirm the updates if you don’t you will get this error message

Blog Photo

You confirm the updates by down arrowing to the bottom of the list and selecting “Install” and then selecting ok.

Blog Photo

Since we just downloaded this image there are very minimal updates so we get the message that there are not many updates and were asked if we want to stay with the minimal Image which we do.

Blog Photo

Once the updates are done the Pi should return you to a plain command prompt. Now that your at the command prompt you need to run the following command to get to the configuration screen

sudo dietpi-config

At this point I used the arrow keys to scroll through the various options. I selected “Network Options: Adapters” and hit the enter key and at this point, I was presented with a screen listing all the various network adapter options. These include:

Blog Photo

  • Ethernet
  • WIFI
  • On-board WIFI

Blog Photo

Of course I selected WIFI because I wanted to put the Rasberry Pi in a place where I did not have an ethernet port available on my modem. Now on the screen, you will see that WiFi is currently set to “OFF” and “disconnected”.

Blog Photo

Now when you hit enter you should see the prompt, “Would you like to enable WIFI now?” When you hit the arrow keys to select “OK” I hit enter to enable WiFi.

Blog Photo

You will see various configurations happening on your Terminal. If you don’t get any error message, WIFI was successfully enabled on your system.

Blog Photo

You will now see that WiFi is set to On.

Blog Photo

You will see a screen similar to the image below where you must choose the “Scan and Configure SSID” menu and hit Enter.

Blog Photo

Next, you will see various slots you can use to configure a WIFI network.

Blog Photo

On the next screen, you will see two options that you can use to connect to WiFi.

  • Scan: Scan and Configure SSID
  • Manual: Manually enter the SSID and other network details.

Blog Photo

I chose the “Scan” option as it automatically scans the networks around you and displays the networks in a nice list that you can easily pick from.

Blog Photo

On the next screen, you will be required to select the encryption method used on the target WIFI network. They are;

  • WPA-PSK: Default (recommended)
  • WEP: Legacy (insecure)
  • NONE: Open host that does not require a key (e.g., public WiFi)

Blog Photo

Click “OK” when done. Enter the password for the wireless network.

Blog Photo

When your done press Apply.

If your connected successfully, you will see a detailed screen with the following information.

  • SSID
  • IP Address
  • Gateway address

Blog Photo

Once your done you must press apply, you will get a warning that this will restart the Raspberry Pi.

Blog Photo

Warning: All WiFi connections will be dropped!

Blog Photo

Once the system reboots re-enter into the configuration and you will see that WiFi is now connected, however at this point we’re getting a DHCP non static IP which isn’t great.

Blog Photo

Static IP Address

Now we need to setup the Rasberry Pi with a static IP address because its going to be used as a server. Because of that we need to follow these steps.

We are still in the terminal so you run the command

sudo nano /etc/network/interfaces

And press Enter. This puts you in the text edit mode for the interfaces file.

Scroll down and edit the wlan0 section using the down arrow button on the keyboard.

auto wlan0
iface wlan0 inet static
address 192.168.1.59 #REPLACE THIS ADDRESS

Replace the IP address 192.168.1.59 with the desired static IP address

Blog Photo

Press Ctrl+X, Y, and Enter to save the changes and exit nano.

Finally run this command to restart the network and apply the settings.

sudo service networking restart

Update Strategies

Ok so we now have DietPi setup on Rasberry Pi with WiFi configured with a Static IP address. Thats the end of Step 1 now that we have this baseline we need to update DietPi we can do that by running some updates. Now before we go into that lets talk a little bit about DietPi updates. A good strategy here for DietPi updates could be summed up as follows.

monthly:

apt update && apt upgrade -y

quarterly:

dietpi-update

dietpi-update is for updating the components of diet-pi customizations, scripts, and a few system level and apt are for the operating system updates and upgrades (kernels, packages, security patches, etc..).

For now I am going to run

apt update && apt upgrade -y 

Blog Photo

and let that run here. As you can see I already installed Docker, Docker CLI and Docker Compose but we will cover how I installed them and the pitfalls on a few of the methods of how they were installed in the next post.

In the next document series were going to install Docker and Portainer the GUI interface for interfacing with Docker. We will also run through how to secure Portainer leveraging free SSL certificates using Lets Encrypt.

Buy Me A Coffee