Notes from the Wired

My Homelab Part 2: DietPi

Published: January 19, 2024

Like mentioned in my last blog post in the “Homelab” series, I choose DietPi as operating system for my server. In this post I want to give a short overview on the installation process and other miscellaneous aspects related to it.

Installation

Installation Guide

The installation process for DietPi may vary slightly from one computer to another, but the steps outlined below should be applicable to most setups. This guide is specifically tailored for Raspberry Pi, but it can be adapted for other systems.

Warning

Ensure that your server computer is connected to the internet via Ethernet before proceeding.

  1. Download DietPi:
    Visit the official website and download the DietPi image for your hardware.

  2. Create Bootable Media:
    Use popsicle on Linux or rufus for windows to flash the image onto a USB stick or on a SD card when installing on a Raspberry Pi.

  3. Insert Bootable Media:
    Insert the flashed SD card or USB stick into your server computer.

  4. Boot Your Server Computer:
    For Raspberry Pi, simply wait for it to fully start. For other computers, access the BIOS by pressing keys like “F1, F2, F10, F12, DEL, ESC” during startup. In the BIOS, locate the “Boot” option and select your USB stick as the first boot option.

"Example of an MSI BIOS/UEFI, with the boot loader option marked.
  1. Configure DietPi via Network:
    Since DietPi is a headless operating system, configure it via the network using SSH. Open a terminal and type ssh root@DietPi (replace “root” with your username and “DietPi” with the Hostname of your server if it differs). If SSH doesn’t work, use the IP address of your server computer instead (you can find it on your router’s website).
"Example of my Rasperry device appearing on my rotuers website with the IP-Address 192.168.12.100

Enter the password when prompted (default is dietpi).

Info

SSH(Secure Shell Protocol) is a network protocol for accessing services and computer over an unsecured network.

  1. Installation Process:
    After connecting successfully, a series of installation processes will run in the terminal.

You may be asked about enabling the “DietPi Survey,” password change, and “serial/UART” settings. Follow the recommended options.

  1. Post-Installation Configuration:
    After installation, you’ll be in the configuration window.

If you do not see this window you can type dietpi-software to enter it. Interesting settings are: If you want to use scp to transfer files to your server, you need to change the SSH Server to OpenSSH. Install Docker and Docker Compose if not already installed.

  1. Exit:
    After configuring, exit the interface to see a screen similar to the one below in your terminal.
Source:https://github.com/adityatelange/hugo-PaperMod

Congratulations! You have successfully installed DietPi headlessly on your server computer. If you want to exit your ssh session you can press strg + d.

Useful Linux Commands

In general If you are not sure on how a Linux command works exactly, I would recommend looking into the man pages.

Here are some essential Linux commands that can help you perform various task’s on your system, these are especially important when maintaining your server via ssh:

To save you written content you can press ctrl + o and then enter, to exit nano you can press ctrl + x.

Other useful commands are:


References: