Debian/Installation

Aus Foxwiki
Version vom 12. November 2024, 18:40 Uhr von Dirkwagner (Diskussion | Beiträge) (Textersetzung - „== Syntax ==“ durch „== Aufruf ==“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

topic - Beschreibung

Beschreibung

Installation

Aufruf

Optionen

Parameter

Umgebung

Rückgabewert

Anwendungen

Problembehebung

Konfiguration

Dateien

Sicherheit

Siehe auch

Dokumentation

RFC

Man-Page

Info-Pages

Links

Projekt

Weblinks

TMP

Vorbereitung

Systemanforderungen

Installationsmedium

https://www.debian.org/download

Festlegungen

Aufgabe Befehl
Hostname server01.example.com
IPv4 Adresse 192.168.1.100
IPv4 Gateway 192.168.1.1

TMP

Grundsystem

  • Insert your Debian network installation CD into your system (or a USB drive where you installed the iso file on) and boot from it.
  • When you use virtualization software like VMware or Virtualbox, then select the Debian 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.

Boot Screen

Text-Installer auswählen

[1]

Spracheinstellungen

Installationssprache

[2]

  • Then choose your location and select the keyboard layout.
  • the next screens will differ depending on your choices.
  • Just select which country and keyboard layout are the right ones for you as they define the language that your Debian system will use on the shell and which keyboard layout is used.
  • In my case, I'll have a german keyboard layout but prefer English as the language on the shell.

Select Country, territory or area

Select server location / country

debian-10-server-8.png

Select your location, territory again and locale and keyboard

Continent or region

debian-10-server-9.png

select location

debian-10-server-10.png

configure locale

debian-10-server-11.png

select keymap

debian-10-server-12.png

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

debian-10-server-13.png

Configure network with DHCP

debian-10-server-14.png

Hostname

Here the system is called /server01.example.com/

debian-10-server-2.png

Enter your domain name

In this example, this is example.com

debian-10-server-3.png

root password

debian-10-server-4.png

  • Confirm that password to avoid typos:

debian-10-server-5.png

Benutzer

  • 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)

debian-10-server-6.png

Benutzername

debian-10-server-15.png

Benutzer-Passwort

debian-10-server-16.png

  • Repeat the user password

debian-10-server-17.png

Partitionierung

  • 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.
    • 60GB for /
    • a large /var partition as all website and email data is stored in subdirectories of /var.

debian-10-server-18.png

Partition method

debian-10-server-19.png

Select Disk partition

Select the disk that you want to partition

debian-10-server-20.png

Partition scheme

  • 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

debian-10-server-21.png

Finish partitioning

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

debian-10-server-22.png

Write partitions to disk

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

debian-10-server-23.png

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

Creating Partitions

debian-10-server-24.png

Installing the base system

debian-10-server-25.png

  • It might be that the following screens pop's up, depending on your install media.
  • I will do a network-based installation (all additional installation packages get downloaded from the internet), so I choose here to not scan any additional install disks.

Paketverwaltung konfigurieren

debian-10-server-26.png

  • Next, you must configure apt.
  • Because we are using the Debian Netinstall CD, which contains only a minimal set of packages, we must use a network mirror.
  • Select the country where the network mirror that you want to use is located
    • usually this is the country where your Server system is located

Configure apt country

debian-10-server-27.png

Then select the mirror you wish to use (e.g. deb.debian.org):

Select Debian mirror

debian-10-server-28.png

Unless you use an HTTP proxy, leave the following field empty and hit Continue

Configure apt proxy

https://www.howtoforge.com/images/debian_buster_minimal_server/big/debian-10-server-29.pngAdvertisement

apt downloads packages

debian-10-server-30.png

Usage Survey

debian-10-server-32.png

Software-Auswahl

We just select Standard system utilities and SSH server

  • so that I can immediately connect to the system
  • Some might argue that one should not install the Standard System Utilities on a minimal server but in my opinion, you will need most of the standard utilities later anyway so I will install them on this

server as part of the base setup.

debian-10-server-33.png

The required packages are downloaded and installed on the system:

Select and install software

debian-10-server-34.png

When you're asked to Install the GRUB boot loader to the master boot record?

  • Select: Yes

Install GRUB in MBR

debian-10-server-35.png

  • The installer might ask you in which partition Grub shall be installed.
  • This server has just one hard disk, so I choose /dev/sda here.

Select device for boot loader installation

debian-10-server-36.png

Press enter and the Installer will install Grub and finishes the installation.

Installing GRUB boot loader and finishing the installation

debian-10-server-37.png

Installation abschließen

  • The base system installation is now finished.
  • Remove the Debian Netinstall CD from the CD drive and hit Continue to reboot the system

debian-10-server-38.png

The first boot of the newly installed Debian

First you will see the boot screen of the Grub Boot Loader, press enter or wait a few seconds, the boot process will continue automatically.

Booting Debian

debian-10-boot.png

A few seconds later the login prompt should show up.

First boot

debian-10-shell.png

  • Login with username "root" and the root password that you have chosen during installation.
  • When you log in by SSH, then use the username "administrator" as the root user is disabled for remote logins.
  • Then run the command "su"

su

To become root user.

SSH Server installieren

If you did not install the OpenSSH server during the system installation, you could do it now:

apt -y install ssh openssh-server

From now on you can use an SSH client such as PuTTY <http://www.chiark.greenend.org.uk/%7Esgtatham/putty/download.html> and connect from your workstation to your Debian Jessie server and follow the remaining steps from this tutorial.

Install a shell editor

I'll use /nano/ as my favorite shell text editor, others prefer vi that is not that easy to use for beginners. With the following command I will install both editors:

apt -y install vim-nox nano

(You don't have to do this if you use a different text editor such as joe or the built-in editor from mc).

Network

You can get your current IP address with the command:

ip a

By default, some network tools are not available. Install the package with:

apt install net-tools

Because the Debian installer has configured our system to get its network settings via DHCP, we have to change that now because a server should have a static IP address.

Edit /etc/network/interfaces and

  • adjust it to your needs
  • here is 192.168.0.100 used
  • note
    • allow-hotplug is replaed by auto
    • otherwise restarting the network doesn't work, and we'd have to reboot the whole system

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens33
iface ens33 inet dhcp
# This is an autoconfigured IPv6 interface
iface ens33 inet6 auto

And here the edited interfaces file with the static IP 192.168.0.100 configured.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens33
iface ens33 inet static
       address 192.168.0.100
       netmask 255.255.255.0
       network 192.168.0.0
       broadcast 192.168.0.255
       gateway 192.168.0.1
# This is an autoconfigured IPv6 interface
iface ens33 inet6 auto

Then restart your network:

systemctl restart networking

Then edit /etc/hosts. Make it look like this: /etc/hosts

127.0.0.1       localhost.localdomain   localhost
192.168.0.100   server01.example.com     server01
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Now edit the hostname in case you did not select the final hostname in the installer

/etc/hostname The /etc/hostname file contains the hostname without the domain part, so in our case just "server01".

Then reboot the server to apply the hostname change:

systemctl reboot

After you logged in again, run:

hostname
hostname -f

To verify that the new hostname is set correctly. The output should be:

root@server01:/home/administrator# hostname
server01
root@server01:/home/administrator# hostname -f
server01.example.com
root@server01:/home/administrator#

Update Your Debian Installation

First, make sure that your /etc/apt/sources.list contains the buster/updates repository (this makes sure you always get the newest updates), and that the contrib and non-free repositories are enabled.

/etc/apt/sources.list

deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

Update apt package database

apt update

install latest updates

apt upgrade

Links

  1. https://www.howtoforge.com/tutorial/debian-minimal-server/
  2. http://www.debian.org/
  3. https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/
  4. https://cdimage.debian.org/cdimage/unofficial/non-free/images-including-firmware/weekly-builds/amd64/