Debian 10 Installation (Server)
This post demonstrates how to install Debian 10 as a server, meaning with no desktop environment. It includes a video and a step-by-step written procedure. I often use Debian as a server in the field and I work with it in my webinars and video courses.
Minimum & Recommended Requirements
- CPU: 1 GHz
- For virtual machines, two logical CPUs is recommended.
- RAM: 512 MB
- Recommended 2 GB
- Drive space: 2 GB
- 10 GB recommended
This video demonstrates how to:
- Locate and download the Debian .iso image.
- Setup a virtual machine in VirtualBox.
- Create a NAT network in VirtualBox.
- Install Debian 10 as a server (command line only and no GUI).
- Update the operating system and install programs.
- Configure the hostname, static IP address, and DNS server address.
- Configure port forwarding in VirtualBox.
- SSH into the new virtual machine.
Duration: 54 minutes.
In the video I am using a Windows 10 computer with VirtualBox version 6.1 installed.
See below for links and step-by-steps. Enjoy!
- Debian can be downloaded from this link
- VirtualBox can be downloaded from this link
- VirtualBox virtual networking documentation: link
I chose VirtualBox for this tutorial because it is free and it runs on most operating systems. But you are free to use another virtualization platform if you wish (VMware Workstation, ESXi, KVM, Xen, Proxmox, and so on). If you are using another platform, then I assume you know what you are doing. On this webpage I focus mostly on VirtualBox. (However, during my webinars, KVM is my go to tool. Check it out here if you haven't already!)
If you use VMware workstation, put your initial virtual machine in "My Computer" and not "Shared". Reason being, you can't clone VMs in the Shared section, which you will need to do later.
Step-by-step Debian installation instructions
- To get used to working with the keyboard only, select the second option "Install" instead of "Graphic install".
- Name the server debserver, the domain is example.com
- Write down or memorize your root password
- Create a user account named user
- For the partitioning method select "Guided – use entire disk"
- For the partitioning scheme select "All files in one partition"
- Finish, and write the changes to disk
- Select "No" for scanning another disc
- If you are unsure, use the deb.debian.org mirror
- Most of you will not use an HTTP proxy
Important! Software selection:
- Deselect "Debian desktop environment" and "print server"
- Select "SSH server"
Install the GRUB boot loader to the main device.
- Reboot, login as root and check for Internet connectivity.
configure Debian as shown in the video following the additional steps below.
First check for any updates to the OS and apps:
Then, if any are available, and you are comfortable installing them, issue this comand:
In the following command we are installing vim as our default text editor, curl to be able to transfer data via HTTP and other protocols, and git so that we can access and download Github repositories.
apt install vim curl git
Modify the hostname
We want our hostname to be:
Modify this in
/etc/hostname. I use vim during the video, but if you wish, you can use nano which is built in to Debian. Examples:
Which editor you use doesn't matter to me, as long as you get the job done. However, if you want to follow along with what I am doing, I suggest using vim. You could also type the following command to change the hostname:
hostnamectl set-hostname debserver.example.com
Set a static IP address
Not all servers use a static IP, but many do. You will have to configure the IP address manually. Do this in
staticand add the following information:
Your actual IP address can be different. The one I am using above is 10.0.2.4 and will be the address I use during the webinar. The one I used in the video is 10.0.2.16/24. It doesn't make much of a difference what you use, as long as you know and remember what it is.
It is okay to use the current IP address that was assigned by the DHCP server. To find out what this is type
ip a. To find out the current gateway address, type
ip route show. (I may use other IP addresses during live webinars.)
This portion of your interfaces configuration file should now look something like this:
# The primary network interface allow-hotplug enp1s0 iface enp1s0 inet static address 10.0.2.4/24 gateway 10.0.2.1
Modify the DNS server IP address
Do this in
Remove any content that is there and add the following:
Using the nameserver 10.0.2.1 makes use of VirtualBox's built in DNS forwarding capability, which is often slower than just using your LAN's DNS address. Be ready for slower pings and other responses from Internet hosts. If it is too slow, or simply doesn't work, use the DNS server IP on your LAN (the one used by your SOHO router, or other device).
Reboot the system
Check your work
ip ato verify your IP address. Use
ip route showto verify your default gateway. Verify the DNS configuration here:
/etc/resolv.conf. Finally, ping a website domain to verify Internet connectivity. For example,
ping example.com. You should get successful results similar to the following:
PING example.com (126.96.36.199) 56(84) bytes of data. 64 bytes from 188.8.131.52 (184.108.40.206): icmp_seq=1 ttl=58 time=12.7 ms 64 bytes from 220.127.116.11 (18.104.22.168): icmp_seq=2 ttl=58 time=15.9 ms
Setup SSH capability
This is shown in the previous video and the step-by-step procedure here.
Your Debian server should now be set up. Enjoy! Or, if you have any questions, feel free to post them here.