This Debian 9 Installation Guide will help you to install one of the most stable distros of Linux.
Users showed great ardor for Debian because of its stability. As a result, Debian is popular both for desktop users and server administrators. Most noteworthy, it’s key values include stability and freedom through the use of open source software lead to Debian more attractive for developers.
Debian 9 Stable edition with codename ‘Stretch’ comes with the following advancements:
- Kernel 4.9
- Default MySQL is now MariaDB 10.1
- LibreOffice 5.26
- GNOME Desktop Environment 3.2
- KDE Plasma 5.8
- Xfce 4.12
- PHP 7
- A new version of GIMP 2.8.18
- Firefox 45.9
- Python 3
If you aim to install and use Debian stable, this Debian 9 Installation Guide will help you to perform and understand the installation. You can watch the video tutorial or continue reading below.
So let’s have a look at Debian 9 Installation Guide
For the experienced user, the installation process for Debian is straightforward. To the novice, there are things confusing and frightening. For example, there is a variety of installation images and finding a right download link may not be easy. The installer is also little more advanced than some the installer popular Ubuntu or Linux Mint. But don’t worry, I will show and explain you everything.
Download an installation image
First, go to the official Debian downloads page and click on “Getting Debian”.
Next, you have options to download Debian.
For example, the “Live” flavor of the Debian installation image is good for testing hardware, but it is not meant for installation.
You need to download the actual Debian installation images.
As shown above, the installation images provide you with two choices:
- a small network installation image
- a complete installation image.
If you have a good wired internet connection, I advise you to proceed with the network installation image. Alternatively, you can download the complete image.
On this page, you are provided only i386 and amd64 architectures. However, these are the most commonly used installation images. Most likely should use 64-bit ISO to install Debian 9.
Install Firmware in Debian to Enable Wireless, Video, or Sound:
If you have only the Wi-Fi connection and your wireless isn’t working, you need a proprietary driver for your Wi-Fi card to work. For that, you need to use Debian non-free images. However, Debian has a strict policy against non-free software and the standard ISO doesn’t include non-free software. With this in mind, It is not easy to find links to these images on the Debian website.
You need to google “Debian non-free images” and the first link will be what you need:
Furthermore, the images with non-free software can also be helpful if your graphics card doesn’t work well with free drivers.
Booting from the CD/DVD or the USB device
Once the image file is downloaded then burn it either into USB Drive or DVD and make it bootable. Moreover, I recommend making a backup of all the necessary files and directories before starting the installation.
In addition, you have to configure the system to boot from USB or DVD. In case, if your computer does not boot automatically, You need to access the “Boot menu” or modify the “Boot order” in the BIOS during the start-up.
Usually, some of the FXX (e.g. F12), DEL, ESC keys give you access to the boot options. The key to access BIOS or boot menu should be shown during the start-up.
After booting DVD, Choose “Graphic Install” to begin the Debian Installation in graphical mode.
Choose Language, Location, and keymap
Choose the language you want to use during the installation process. Select your location. In addition, this will be used to set your time, currency and other locale-related stuff.
At this instant, configure the system locales (language and country combination) and click Continue.
Next, the installer will now load components from the CD as shown below.
Configure the network:
The hostname is basically the name you want to give to your computer. Further, you can assign a Domain Name as per your needs and requirement. Then Click on Continue.
Next, you can set a root password. However, you can also leave it empty and the user account will have administrative privileges with the command
So, you can keep it empty here and set your password in the next step.
Create a new user:
At this instant, type your full name and your username. When you set the user’s password here, it subsequently enables administrative privileges.
Partition your Disk
By all means, this is the most crucial part of the installation process.
I will show you 3 scenarios here:
- Automatic partitioning of a whole drive
- Install without formatting your home partition. This is in case you had Linux installed on your computer before.
- Manually partition your hard drive with re-formatting the whole drive.
Scenario #1: Automatic partitioning
To the novice, it is recommended to proceed with Guided partition. More importantly, backup all data, Guided partition method automate operations including formatting.
Scenario #2: Install without formatting your home partition
For the expert user, Manual partitioning method is appropriate, especially when you have a hard drive with important data on the home partition.
At this stage, select Manual and click Continue.
Select the partition one. This partition will be formatted and used for the system install.
Set the file system you want to use. Notably, ext4 is a good choice.
Next, select to format it.
For mounting point select root.
Optionally, you can label it as the system partition.
Add a bootable flag, because it is your system partition and you will boot from it.
Check if everything is as you want and select Done.
Next, select your home partition. This is the partition you do not want to format.
Select the file system of this partition. You need to know the file system of this partition. Most likely is it ext4.
At this point, do NOT select format, the point is that you want to keep the data on this partition. But I still recommend you to have a backup of this partition before you do all the steps above.
Next, Go to the mount point and assign it to home.
Here, you can see the summary of your settings. The root partition will be formatted and bootable, whereas the data on the home partition will be kept intact.
If you want also to have a swap partition, assign its mounting point to swap. I prefer to use a swap file instead of a swap partition. See my video on how to enable a swap file on your system. Then verify everything and select done. Press write changes to the disk.
Scenario #3: Manual partitioning
In this scenario, I assume you have a brand new hard drive or you want to erase the whole hard drive and create a new partition table manually.
Select the hard drive you want to re-partition. Confirm that you want to create a new partition. Then start creating new partitions.
The first partition is usually used for the system (/ – root). Give it a minimum of 20 Gb.
Select beginning. Make it bootable. Assign ext4 file system to it.
After that proceed with Done your system partition settings.
Then create a home partition. If you don’t want to have more than 4 partitions on your system, keep it primarily. If you need more partitions, select “logical”.
For the mount point select /home. Optionally, you can name it with a label, Then select done.
You should see your root and home partitions, and they both will be formatted as below. Check everything and apply the changes.
Confirm that you want to apply this new partition table. Now, the base system is installing. It takes a while.
Configure Package Manager with a Network Mirror
You have only one installation image when you are asked about inserting another CD, select No.
Next, select your country and any mirror from your country. Usually, the top one works fine.
If you use the proxy, set it here. I skip it.
Enable Popularity Contest
In a like manner, I suggest you participate in the usage survey. It will help the Debian project improving future versions of Debian.
Debian predefined software selection
Now, select the desktop you want to install. By default, it will install GNOME.
I prefer Debian XFCE because it offers users a lightweight, yet still visually appealing desktop experience.
Install GRUB Bootloader
Once the desktop is installed, you also need to install a boot-loader.
The only scenario when you don’t need a boot-loader is if you already have another system installed with a boot-loader on your system. But this is not the case for most of you. So, select Yes.
And install it to the same hard drive where you installed the system.
Finish the System Installation
At this point, the installation is complete. So, remove your installation media and press continue.
At last, we have the default look of Debian Xfce desktop. Whereas, it is not very attractive. Though, You can makeover your Debian. For this purpose, follow the steps I showed in the post Make Xfce look modern and beautiful.
Things to do after the installation
For most intents and purposes, Debian 9 Stretch default repositories are enough. But you can extend the list of packages you can install by adding contrib and non-free repositories.
Adding contrib and non-free to Debian 9
The package repository information is stored on the
/etc/apt/sources.list file. Further, you may edit this file to add a new package repository.
/etc/apt/sources.list using Nano text editor.
sudo nano /etc/apt/sources.list
When you open it, you will see the content with default repositories configured:
To have the contrib and non-free components, add
contrib non-free after
main as shown below:
Once you are done, Press Ctrl+O to save and Ctrl+X to exit.
Now, you have made changes to the
sources.list file. In order for apt to understand the new changes, we must update it.
sudo apt update
Now you can install some non-free packages. For example, MS fonts such as Arial and Times New Roman.
sudo apt install ttf-mscorefonts-installer
Enable the latest security updates
Debian 9 is secure and stable already, but you can improve it even further to get the latest security updates as soon as they are released without waiting for the next point release (e.g. Debian 9.1).
For this purpose, you can add this security repository to your
# latest security updates deb http://security.debian.org/ stretch/updates main contrib non-free
Receive the bug fixes as quickly as possible.
Similarly, you can also extend your repository list to receive bug fixes as quickly as possible, i.e. without waiting for the point release. Add this line to your
# proposed additions deb http://ftp.us.debian.org/debian stretch-proposed-updates main contrib non-free
After all the repositories have been added update and upgrade your system.
At the time of creating this tutorial, I don’t have a dedicated graphics card or a WiFi card that require proprietary drivers. So, I cannot demonstrate how to install them. However, for your convenience I want to provide you links to Debian wiki pages on how to install nVidia, AMD Graphic card, and WiFi drivers.
Following Debian 9 install guide, you should now have a fully functional Debian 9 Stretch.
If you installed Debian with XFCE desktop, you can configure it to look more modern and beautiful.
If you find Debian Stable too outdated, you can also consider installing Debian Testing and receive more up-to-date software.
Please share your feedback in the comments section below.