How to install a Debian 9 (Stretch) Minimal Server

This tutorial exists for these OS versions

On this page

  1. 1 Requirements
  2. 2 Preliminary Note
  3. 3 The Debian Base System

This tutorial shows how to install a Debian 9 (Stretch) minimal server. The purpose of this guide is to provide a minimal Debian setup that can be used as the basis for our other Debian 9 tutorials and the perfect server guides here at howtoforge.com.

1 Requirements

To install a Debian 9 server system you will need the following:

 I will use the 64Bit installation media here.

2 Preliminary Note

In this tutorial, I will use the hostname server1.example.com with the IP address 192.168.1.100 and the gateway 192.168.1.1. These settings might differ for you, so you have to replace them where appropriate.

 

3 The Debian Base System

Insert your Debian 9 (Stretch) network installation CD into your system and boot from it. When you use a virtualization software like VMware or Virtualbox, then select the Debian 9 minimal iso file as source file for the DVD drive of the VM, you don't have to burn it to a CD or DVD for that first.

Select Install (this will start the text installer - if you prefer a graphical installer, select Graphical install):

Debian 9 Boot Screen

Select your language:

Select Debian installation language

Then choose your location:

Select server location / country

Choose a keyboard layout:

Select Keyboard Layout

The installer checks the installation CD, your hardware and configures the network with DHCP if there is a DHCP server in the network:

Loading additional components

Configure network with DHCP

Enter the hostname. In this example, my system is called server1.example.com, so I enter server1:

Enter the server hostname

Enter your domain name. In this example, this is example.com:

Enter the domain name of the Debian server

Afterward, give the root user a password:

Enter the root password

Confirm that password to avoid typos:

Confirm the root password

Create a Linux user account, e.g. your name or nickname. For this example installation, I will choose the name "administrator" with the user name administrator (don't use the user name admin as it is a reserved name on Debian Linux):

Enter realname of the user

Enter username

Set a password

Repeat the user password

Now select the timezone for the server

Select the time zone

Now you have to partition your hard disk. For simplicity's sake I select Guided - use entire disk - this will create a large partition for the / file system and another one for swap (of course, the partitioning is totally up to you - if you know what you're doing, you can also set up your partitions manually). For hosting systems like the ISPConfig 3 perfect server tutorials you might want to choose e.g. 30GB for / and a large /var partition as all website and email data is stored in subdirectories of /var.

Partition method

Select the disk that you want to partition:

Select Disk partition

Then select the partitioning scheme. As mentioned before, I select All files in one partition (recommended for new users) for simplicity's sake - it's up to your likings what you choose here:

Partition scheme

When you're finished, select Finish partitioning and write changes to disk:

Finish partitioning

Select Yes when you're asked: "Write changes to disk?":

Write partitions to disk

Afterward, your new partitions are created and formatted. Now the base system is installed:

Installing the base system

Share this page:

Suggested articles

7 Comment(s)

Add comment

Comments

From: calbasi at: 2017-07-11 15:08:59

In a fresh debian install I get:

/etc/hosts

---------------------------------

127.0.0.1       localhost127.0.1.1       debian# The following lines are desirable for IPv6 capable hosts::1     localhost ip6-localhost ip6-loopbackff02::1 ip6-allnodesff02::2 ip6-allrouters-----------------------------------

And /etc/hosname with just my machine/domain name:

myserver.mydomain.net

----------------------------------------------------

I wonder if these settings are OK, and, thus, your manual has an (old) alternative.

 

From: Someone at: 2017-07-24 11:32:11

Update links from 9.0.0 to 9.1.0

From: thctlo at: 2017-07-26 07:30:41

Hai, Just tried your vm for a samba 4 install, but that errors at some point due to the existance of Administrator as linux users. deleting your default administrator user fixes the problem.

 

but great howto again.

Thanks!

 

From: AnHa at: 2017-07-27 10:04:55

When I try to install debian9.1.0 amd64 on my VMWare-System 8.0.2, the base system installation failes with error:"Debootstrap waring: Failure trying to run: chroot /target dpkg --force-depends --install /var/cache/apt/archives/base-passwd_3.5.43_amd64.deb". Trying to ignore does not help, I can't go on with installation.

Having a look @ /var/log/syslog, I see something like "dpkg: error processing package base-passwd (--install): subprocess installed post-installation script was killed by signal (Segmentation fault)"

Any suggestions?

From: AnHa at: 2017-07-27 12:36:31

After updating the VMWare-Version everything works fine

From: Adam at: 2017-09-10 02:45:30

would it be possible to create one of these perfect server setups that has been tested and oriented towards Google Cloud Compute Instances?

There is some of this that is simply not going to be doable...beginning with the very first part of this. Trying to start with a blank canvas is a little difficult when Google Cloud instances have disks with O/S's already on them when the instance is first setup.

From: till at: 2017-09-10 09:21:13

An OS instance at Google is a minimal setup, so the perfect server setups work perfectly on cloud servers as well.