DietPi lean server distribution
Going Lean
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).
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.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.