How to install DietPi¶
What do you need ?¶
To follow this tutorial, you will need the next hardware list:
- A Raspberry Pi, Odroid or other SBC - open the list of all supported SBC
- An SD card of at least 4 GiB, and a way to read it on your computer (integrated slot or external SD card reader)
- Optional: Ethernet (network) cable
Note: Following this guide you could run the installation directly or via network. If you choose an installation via network you will not need a monitor or keyboard connected to your SBC or virtualized environment.
1. Download and extract the DietPi disk image¶
Open dietpi.com and select “Download”. Various supported devices will be displayed. Choose the preferred SBC or virtualized environment and click on the Download. The disk image will be downloaded locally.
Unzip the downloaded file to a local folder.
Linux users will need to download and install
p7zip (the terminal version of
How do I extract DietPi image on Linux
On Debian and Ubuntu-based systems, open a terminal and type:
sudo apt install p7zip
Once p7zip is installed, type the following at the terminal to extract the file:
7zr e DietPi-Image.7z
Replace DietPi-Image.7z with the correct name of your compressed DietPi file, example: DietPi_RPi-ARMv6-Buster.7z. This will extract the DietPi image file for you to use.
2. Run balenaEtcher and flash the image¶
Download and install balenaEtcher - it flashes OS images to SD cards & USB drives, safely and easily on Windows, macOS, Linux.
Start the program and make sure you have your SD card inserted into your computer. Locate and select the DietPi image.
Next, ensure that the SD card selected is the correct one. It will wipe the drive clean, so if you choose the wrong one, you may risk losing data.
Once you have confirmed all the details are correct, proceed to flash the SD card. This process may take a while.
Click here if you want to pre-configure WiFi network
To setup Wifi, open the SD card folder, and update next two files using a text editor of your choice:
- Open the file named
AUTO_SETUP_NET_WIFI_ENABLEDand set to value 1.
- Open the file
aWIFI_SSIDto the name of your WiFi network.
- In the same file
aWIFI_KEYto the password of your WiFi network.
- Save and close the files
Remove the SD card from the PC and insert it into your device, preparing to boot for the first time.
3. First boot on DietPi¶
Insert the SD card into your device (e.g. Raspberry Pi) and start it. A few seconds later, you can continue following the instructions on the screen, or connect via network.
- login: root
- password: dietpi
Click here if you want to connect via network (running a headless install)
On first login DietPi will immediately upgrade system and packages. If your network connection is not stable it is recommended to perform this step locally instead.
IP Scanning tool
For the following steps we require an IP Scanning tool to determine the IP address of the Raspberry Pi.
For Windows, you could try
Advanced IP Scanner. Download the tool from here.
For Linux, you can use nmap command:
sudo apt-get install nmap #For installing Nmap sudo nmap -sn 192.168.1.0/24 #For scanning IP address
Connect to DietPi via SSH
A popular SSH Client for Windows is PUTTY. You can download putty from here. Enter in the
Host namefield the IP address found during the scanning, select
SSHand then click on Open button.
Most Linux distributions come packaged with an ssh client. Type in your Terminal next command (replace the sample IP address 192.168.1.20 with the one found via scanning the network).
To further proceed you’ll need to accept the DietPi GPL license. Hit the Enter key on your keyboard to do this.
DietPi will then immediately begin to search for and install updated software packages, which will take some time to complete.
Once the packages have been updated, DietPi will ask you to confirm whether you would like to enable user analytics.
DietPi Survey is optional, and not enabled by default. It is anonymous, secured and requires a minimal data transfer. ALL the shared details are published on the dietpi.com/survey page. Checkout and see how DietPi is used !
The default DietPi password is public, so you’ll be asked to change this at the next stage for both the
dietpi user accounts. Select OK and hit enter, then provide your password (twice) to confirm.
You can change the password again later by typing
passwd at the terminal.
4. Install software with the DietPi-Software tool¶
The base installation of DietPi is minimal by design, allowing you to choose what software you want to install and use. If you’re unsure what software to install, checkout DietPi Optimised Software page for more details.
How do I run DietPi-Software and install Optimised software ?
This tool will automatically launch when you first boot your Raspberry Pi using DietPi after the initial configuration process has completed. You can also launch it manually by typing
dietpi-software in the terminal.
- To begin, select Software Optimized in the main menu list and hit Enter.
- Scroll through the list of available software - for more details check DietPi Optimised Software
- To install software on your DietPi, select it in the list and press the space bar to add it to the installation list. If you change your mind, hit space again to remove it.
- Once you’ve selected the software you wish to install, press the tab key on your keyboard to switch to the confirmation options at the bottom. Select OK, then hit enter on your keyboard to confirm.
- To begin installing your software, select Install from the main menu list, then hit the Enter key. DietPi will ask you to confirm your choice(s). Select OK, then hit enter to begin the installation.
The software you selected will begin to install at this point. Once the process is completed, you may be asked to restart your device. Press OK to confirm.
You can return to the DietPi-Software tool to make further changes at any time by typing
dietpi-software at the terminal, or enter
dietpi-launcher and select DietPi-Software tool.
If you want to make further changes to your DietPi configuration, you can run
dietpi-launcher at the terminal to view all the available DietPi tools, including DietPi-Update to update your device and DietPi-Backup to back up your device.
For more details, check DietPi Tools section.
Install by community (YouTube)¶
A video tutorial on How to install and initially configure DietPi by Roberto Jorge.