Skip to content

Instantly share code, notes, and snippets.

@jasonniebauer
Created September 11, 2020 22:56
Show Gist options
  • Save jasonniebauer/671abb69155df92122c79a4ea2b4f24e to your computer and use it in GitHub Desktop.
Save jasonniebauer/671abb69155df92122c79a4ea2b4f24e to your computer and use it in GitHub Desktop.

DietPi Give your Single-board computer some Lightweight justice. What you'll need:

4GB or greater Micro SD card.
Internet Access (Ethernet or Wifi, required to complete the DietPi setup).
Dedicated USB Drive is highly recommended (Allows DietPi-Software installations to utilize USB over SD).

Step 1 (Download DietPi Image): Download - dietpi.com For experienced users who want to skip this guide and dig straight in. Here are the login details:

username = root
password = dietpi

Step 2: Write to SD card using Etcher:

Unzip/extract the DietPi.7z image (ideally your desktop)
Download and install Etcher
Run Etcher
Select the DietPi.img image file
Select the drive of your SD card
Click Flash!

Write to SD card using Linux:

Find the device (eg: /dev/sdb1) you need to write to by using blkid or mount.
Double check that you have the correct dev path for your SD card (eg: /dev/sdb1).
Unmount the SD card and all its partitions by using umount /dev/sdb?.
Write the image using dd if=/path/to/DietPi.img of=/dev/sdb.

Optional (Wifi): Pre-configure WiFi Details for DietPi

Goto my computer, select the SD card and open it.
Locate the file called dietpi.txt and open it with wordpad.
Set AUTO_SETUP_NET_WIFI_ENABLED=1
DietPi_v6.15 and lower images:
    Enter your SSID AUTO_SETUP_NET_WIFI_SSID=MySSID and AUTO_SETUP_NET_WIFI_KEY=MyWifiKey (both are case sensitive).
DietPi_v6.16 and higher images:
    Open dietpi-wifi.txt and open it with wordpad
    Change aWIFI_SSID[0]='MySSID' and aWIFI_KEY[0]='MyWifiKey'
Save changes to edited files
Plug the WiFi adapter into your device, before turning it on.

Step 3: Turn on your device

Plug the SDcard into your device and turn it on.
Wait for DietPi to complete some initial setup steps.
Once completed, the login screen will appear.

Step 4: Login to DietPi

username = root
password = dietpi
DietPi also comes pre-installed with Dropbear SSH Server.

On first login, DietPi will automatically update. Due to current reports: If "Checking DNS resolver" fails, this is most likely due to your system or local network setup does not support IPv6 and you did not disable it via dietpi.txt. Please try the following steps:

Hit Exit, in case of a second prompt, hit Cancel.
Run the following command: /DietPi/dietpi/func/dietpi-set_hardware enableipv6 0
Run the following command: /DietPi/dietpi/dietpi-login

The DNS resolving should now succeed. Once completed, press enter to reboot the system. You can log back in again to resume setup.

Optional (DietPi-Config): DietPi-Config is a feature rich configuration tool for your device:

Set Overclocking Profiles.
Setup advanced networking options (static IP / wifi).
Mount network filesystem shares (Samba / FTP).

Click here for a complete list of DietPi-Config options.

Optional (Obtain IP Address): Obtaining your IP address

In all the DietPi guides, we use 192.168.0.100 as the IP address. When reading through the online documentation, and you see a URL link or IP address, you will need to use the IP address on your DietPi system.

Click here for details on how to obtain your IP address.

Step 5: Select Software to Install: Now you can install the software you require, or follow one of the setup guides for popular/combo programs:

DietPi-Software Details for ALL installation options: viewtopic.php?p=5#p5

Minimal image If you want a minimal image, simply select Go >> Start install from the menu. This will complete the 1st run setup of DietPi. Additional software can always be installed at a later date.

@ankur0101
Copy link

In step3, where does the login screen will appear if this is a headless installation?

@Mufaddal007
Copy link

This was supposed to be headless setup, but you are saying login screen will come, if that is the case, you must have plugged in some monitor to your Raspberry Pi. Not helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment