DietPi lean server distribution

Going Lean

© Lead Photo by Patricia Serna on Unsplash

© Lead Photo by Patricia Serna on Unsplash

Article from Issue 275/2023
Author(s):

The DietPi minimalist distribution improves the performance of the Raspberry Pi and other single-board computers as servers and desktops and comes with more than 200 specially chosen applications and services.

Since the first appearance of the Raspberry Pi more than 10 years ago, many hardware vendors have followed the idea of an inexpensive computing powerhouse on a small board. Companies such as Asus, Odroid, and Pine64 all jumped on the single-board computer (SBC) bandwagon, naturally increasing the number of operating systems (OSs) for these boards. Most of the OSs are based on the ARM architecture and can now be found in various sectors of home computing and industrial applications.

The Debian-based Raspberry Pi OS is a very useful desktop replacement, and many Linux distributions offer their own offshoots for the Raspberry Pi. For example, LibreELEC is a media center, and gamers will enjoy RetroPie and Batocera. The lean, minimalistic DietPi is a great choice for small servers, older Raspberry Pis, and virtual machines. Thanks to carefully considered scripts, the set up is a convenient process.

From Debian

DietPi first entered the digital world in 2014. The purist operating system was initially built on Raspbian (today's Raspberry Pi OS). It now builds directly on Debian and supports numerous SBCs and architectures. In addition to x86_64, ARMv6, ARMv7, AArch64, and RISC-V, the project supports virtual machines such as VMware/ESXi, VirtualBox, Hyper-V, Parallels, UTM, and Proxmox. Besides images for virtual machines, you will find images for the Raspberry Pi, Odroid, Pine64, Radxa, Allo, Asus, NanoPi, Orange Pi, and the VisionFive RISC-V board [1].

The distribution mainly targets headless server applications (i.e., applications that do not require a display). However, if required, you can set up an X11 graphical user interface (GUI). In total, DietPi comes with more than 200 thoughtfully chosen applications for installation in its package repository.

I tested DietPi on a Raspberry Pi and on a virtual machine running on Proxmox, which is recommended if the compute power of an SBC is not up to the task at hand. The images for both tests were sourced from the project's download page [2]: Just unzip the 7-Zip archives on Linux with the 7z tool. On Windows, the package name is 7-Zip for Windows, and The Unarchiver does the same job on macOS.

From an SD Card

The procedure for the Raspberry Pi and other SBCs that boot the operating system from an SD card is probably familiar to most readers. To begin, you unpack the image from the archive and transfer it to the SD card. On Linux, for example, you can use BalenaEtcher, whereas a good choice on Windows is Rufus [3]. If you are on Proxmox, you can install DietPi manually or run a script.

To download the installer script from GitHub, make it executable, and run it, use:

$ wget https://raw.githubusercontent.com/dazeb/proxmox-dietpi-installer/main/dietpi-install.sh
$ chmod +x dietpi-install.sh
$ ./dietpi-install.sh

The script prompts with some default settings you can adopt. The only input required is the name of the instance, which will normally be local. When done, you just need to start the virtual machine created by the script.

For the Raspberry Pi, insert the SD card and connect the device to a power source. The first boot process takes longer than later boots because of basic set-up steps and the automatic resizing of the root filesystem. Depending on the hardware, this process could take a few minutes (Figure 1).

Figure 1: After the install, DietPi tells you which IP address it is using, and you can then open a connection with SSH.

Display or SSH

For a first start, I recommend connecting a display. After that, you can access the system with the Dropbear SSH server, which is enabled by default. If no display is available, you can discover the Raspberry Pi's IP address from your router or run the command

$ sudo nmap -sP 192.168.0.0/24 | grep raspberry

on another computer on the network, taking care to adapt the IP address to match your network.

With the IP address, root as the username, and dietpi as the password, you can then use ssh to log in. Your next step is to open the dietpi.txt configuration file and modify the hostname and passwords. After the initial login, DietPi searches for updated software packages and installs them; again, this step can take some time to complete.

If you want to help the developers by sharing important information, you can agree to DietPi submitting anonymized information about your usage behavior. In the final step, change the general password and the passwords for the user and root accounts, if you have not already done so (Figure 2). Changes can be made at any later time with the DietPi-Config script (Figure 3) or the passwd command.

Figure 2: DietPi prompts you to change the default passwords.
Figure 3: DietPi-Config provides options for regional settings, audio, security, autostart, and network.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Raspberry Pi Distros

    The Raspberry Pi is a Linux machine, and its default distribution is Raspberry Pi OS. But Linux is all about choices….

  • Tipi

    Tipi gives you complete control of more than 100 applications and services. A mouse click is all it takes to install the apps.

  • PiMiga 1.5

    Convert a Raspberry Pi 400 into a retro computer that behaves like the popular Amiga 500.

  • Charly's Column

    Many tools keep growing with each new version, but Nmap 4.00 has lost weight thanks to the Diet-Nmap project. The latest incarnation of Nmap is not only quicker, it is also more frugal with memory.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News