Перейти к содержимому

Дебиан 11 как локальный сервер

  • автор:

How to Install Debian 11 (Bullseye) Server Using Net Install

In this guide, we will walk you through the installation of a Debian 11 (Bullseye) Minimal Server, using the netinstall CD ISO image. This installation you will carry out is appropriate for building a future customizable server platform, without a GUI (Graphical User Interface).

You can use it to install only the necessary software packages that you need to work with, which we will show you in future guides. However, before you move further, read the system requirements, download the netinstall CD ISO image and then proceed to the Debian 11 installation instructions.

Requirements
  • Minimum RAM: 512MB.
  • Recommended RAM: 2GB.
  • Hard Drive Space: 10 GB.
  • Minimum 1GHz Pentium processor.

Important: These are only values for a test scenario, in a production environment, you probably want to use suitable RAM and Hard disk size to meet your local environment needs.

Download Debian 11

Debian 11 server system network installation minimal CD image:

  • For 32-bit: Debian-11.1.0-i386-netinst.iso
  • For 64-bit: Debian-11.1.0-amd64-netinst.iso

Installation of Debian 11 Minimal Server

1. After downloading the Debian 11 minimal CD image from the above links, burn it to a CD or create a bootable USB stick using LiveUSB Creator called Unetbootin or Rufus.

2. Once you have created the installer bootable media, place your CD/USB into your system appropriate drive.

Then start the computer, select your bootable device, and the first Debian 9 installer boot menu should appear as shown below. Choose Install and press the [Enter] key.

Debian 11 Install Menu

Debian 11 Install Menu

3. The system will start loading the media installer and a page to select the installation language should appear as shown below. Select your installation process language and click on Continue.

Debian 11 Install Language

Debian 11 Install Language

Configuring Location and Keyboard Settings

4. Now select your location used for setting the system timezone and locales, if not on the list go to Other and click on Continue. Find the region and the country. Once you are done click Continue as shown below.

Select Country Location

Select Country Location

5. Next, choose your Keyboard Layout to use and click Continue.

Select Keyboard Layout

Select Keyboard Layout

6. The installer will now load components from the CD shown below.

Debian 11 Components

Debian 11 Components

Configure Hostname and Domain Name

7. The next step is to set your system hostname and domain name and click Continue.

Set Hostname Set Hostname Set Domain Name Set Domain Name

Configure Users and Password

8. Here, you will configure system users and their passwords. Start by setting the root user password as shown below and click Continue when you are done.

Set Root Password

Set Root Password

9. Then create a user account for the system administrator. First set the user’s full name as shown below and click Continue when you are done.

Set Account Name

Set Account Name

10. In this step, set the user’s system name and click Continue.

Set User Name

Set User Name

11. Now set the above user’s password and click Continue.

Set User Password

Set User Password

12. Configure your system clock.

Set System Clock

Set System Clock

Partitioning Disk

13. On the next screen, choose Manuel to perform disk partitioning.

Note: You can select Guided – use the entire disk and set up LVM (Logical Volume Manager) as partition layout for efficient disk space management and follow the instructions.

Choose Manual Partitioning

Choose Manual Partitioning

14. You will see an overview of your current system disks and mount points. Select the disk to be partitioned and click Continue.

After that, select Yes to create a new empty partition table on the disk.

Choose Disk for Partitioning Choose Disk for Partitioning Create New Empty Partition Table Create New Empty Partition Table

15. Next, select the free space on the disk to partition it and click Continue.

Choose Free Space

Choose Free Space

Creating Swap Partition

16. Now create the Swap area by selecting Create a new partition and set appropriate size as shown in the screenshots below. Then click Continue.

Create Swap Partition Create Swap Partition Set Swap Size Set Swap Size

17. Set swap partition as Primary and choose the Beginning of the free space on disk and click Continue.

Set Swap Partition to Primary Set Swap Partition to Primary Set Swap Partition to Beginning Set Swap Partition to Beginning

18. Now set partition as Swap area as shown in the following screenshot.

Set Swap Area

Set Swap Area

19. Now select Done setting up the partition and click Continue.

Done Setting Swap Partition

Done Setting Swap Partition

Create Root Partition

20. In this step, you can now create the root partition by selecting the free space, then select Create a new partition. Afterward set the root partition size, make it Primary and set it at the beginning of the free space.

Then use the Ext4 file system on it and finally select Done setting up partition and click Continue as shown in the following screenshots.

Create Root Partition Create Root Partition Set Root Partition Size Set Root Partition Size Set Root Type Set Root Type Done Root Settings Done Root Settings

Create Home Partition

21. Similarly to create a /home partition follow the same instruction as explained above using the remaining free space if you have.

22. Once you have created all the necessary partitions, click on Finish partitioning and write changes to disk.

Finish Partitioning Finish Partitioning Finish Partitioning Changes Finish Partitioning Changes

Finalizing Debian 11 Installation Process

23. At this point, installation of the base system should begin as shown below.

Installing Debian Base System

Installing Debian Base System

24. Now configure the package manager as shown in the screenshot below. Select No and click Continue.

Configure Package Manager

Configure Package Manager

25. Afterwards, configure a network mirror by selecting the nearest country and then click Continue.

Choose Debian Archive Mirror

Choose Debian Archive Mirror

26. Next, choose whether to participate in the package usage survey or not. Then click Continue.

Configure Popularity Contest

Configure Popularity Contest

27. Now install standard system utilities and click Continue.

Installing Debian Software

Installing Debian Software

28. In this step, you will install the Grub boot loader by choosing Yes. After which you should choose the disk to install it.

Install Grub Boot Loader Install Grub Boot Loader Install Grub on Disk Install Grub on Disk

29. Finally, the installation is done, click Continue to reboot the machine and remove the bootable media, then boot in your system and login.

Finish Debian 11 Install Finish Debian 11 Install Debian 11 Login Debian 11 Login

That’s all. You now have a working Debian 11 (Bullseye) Minimal Server for developing a future customizable server platform. If you are looking to deploy a web server such as Apache or Nginx, go through the following articles.

Как установить сервер Debian 11 (Bullseye) с помощью сетевой установки

В этом руководстве мы покажем вам, как установить минимальный сервер Debian 11 (Bullseye) с помощью ISO-образа netinstall CD. Эта установка, которую вы будете выполнять, подходит для создания будущей настраиваемой серверной платформы без GUI (графического пользовательского интерфейса).

[Вам также может понравиться: Новая установка Debian 11 Bullseye Desktop]

Вы можете использовать его для установки только необходимых пакетов программного обеспечения, с которыми вам нужно работать, что мы покажем вам в будущих руководствах. Однако, прежде чем двигаться дальше, ознакомьтесь с системными требованиями, загрузите ISO-образ netinstall CD и следуйте инструкциям по установке Debian 11.

Требования
  • Минимальный объем ОЗУ: 512 МБ.
  • Рекомендуемый объем оперативной памяти: 2 ГБ.
  • Место на жестком диске: 10 ГБ.
  • Процессор Pentium с тактовой частотой не менее 1 ГГц.

Важно: это только значения для тестового сценария, в производственной среде вы, вероятно, захотите использовать подходящий размер ОЗУ и жесткого диска для удовлетворения потребностей вашей локальной среды. .

Скачать Дебиан 11

Минимальный образ компакт-диска сетевой установки серверной системы Debian 11:

  • Для 32-разрядной версии: Debian-11.1.0-i386-netinst.iso
  • Для 64-разрядной версии: Debian-11.1.0-amd64-netinst.iso

Установка минимального сервера Debian 11

1. После загрузки минимального образа компакт-диска Debian 11 по приведенным выше ссылкам запишите его на компакт-диск или создайте загрузочный USB-накопитель с помощью LiveUSB Creator под названием Rufus.

2. Создав загрузочный носитель с программой установки, вставьте компакт-диск/USB в соответствующий системный дисковод.

Затем запустите компьютер, выберите загрузочное устройство, и первое загрузочное меню установщика Debian 9 должно появиться, как показано ниже. Выберите Установить и нажмите клавишу [Enter].

3. Система начнет загрузку установщика носителя, и должна появиться страница для выбора языка установки, как показано ниже. Выберите язык процесса установки и нажмите Продолжить.

Настройка местоположения и параметров клавиатуры

4. Теперь выберите свое местоположение, используемое для установки системного часового пояса и локалей. Если его нет в списке, перейдите в раздел Другое и нажмите Продолжить. Найдите регион и страну. Когда вы закончите, нажмите Продолжить, как показано ниже.

5. Затем выберите используемую раскладку клавиатуры и нажмите Продолжить.

6. Теперь программа установки загрузит компоненты с показанного ниже компакт-диска.

Настройте имя хоста и доменное имя

7. Следующим шагом будет установка имени хоста и доменного имени вашей системы, а затем нажмите Продолжить.

Настроить пользователей и пароль

8. Здесь вы настроите пользователей системы и их пароли. Начните с установки пароля пользователя root, как показано ниже, и нажмите Продолжить, когда закончите.

9. Затем создайте учетную запись пользователя для системного администратора. Сначала задайте полное имя пользователя, как показано ниже, и нажмите Продолжить, когда закончите.

10. На этом шаге задайте системное имя пользователя и нажмите Продолжить.

11. Теперь установите указанный выше пароль пользователя и нажмите Продолжить.

12. Настройте системные часы.

Разделение диска

13. На следующем экране выберите Manuel, чтобы выполнить разбиение диска на разделы.

Примечание. Вы можете выбрать Guided — использовать весь диск и настроить LVM (диспетчер логических томов) в качестве схемы разделов для эффективного использования диска. управление пространством и следуйте инструкциям.

14. Вы увидите обзор ваших текущих системных дисков и точек подключения. Выберите диск, который нужно разбить, и нажмите Продолжить.

После этого выберите Да, чтобы создать новую пустую таблицу разделов на диске.

15. Затем выберите свободное место на диске, чтобы разбить его, и нажмите Продолжить.

Создание раздела подкачки

16. Теперь создайте область Swap, выбрав «Создать новый раздел» и задав соответствующий размер, как показано на снимках экрана ниже. Затем нажмите Продолжить.

17. Установите раздел подкачки как Основной, выберите Начало свободного места на диске и нажмите Продолжить.

18. Теперь установите раздел как область Swap, как показано на следующем снимке экрана.

19. Теперь выберите Готово с настройкой раздела и нажмите Продолжить.

Создать корневой раздел

20. На этом шаге теперь вы можете создать корневой раздел, выбрав свободное место, а затем выбрав Создать новый раздел. Затем установите размер корневого раздела, сделайте его основным и установите в начале свободного места.

Затем используйте на нем файловую систему Ext4 и, наконец, выберите Готово для настройки раздела и нажмите Продолжить, как показано на следующих снимках экрана.

Создать домашний раздел

21. Аналогичным образом, чтобы создать раздел /home , следуйте той же инструкции, что описана выше, используя оставшееся свободное пространство, если оно у вас есть.

22. Создав все необходимые разделы, нажмите Завершить создание разделов и запишите изменения на диск.

Завершение процесса установки Debian 11

23. На этом этапе должна начаться установка базовой системы, как показано ниже.

24. Теперь настройте менеджер пакетов, как показано на снимке экрана ниже. Выберите Нет и нажмите Продолжить.

25. После этого настройте сетевое зеркало, выбрав ближайшую страну, а затем нажмите Продолжить.

26. Затем выберите, участвовать в опросе об использовании пакетов или нет. Затем нажмите Продолжить.

27. Теперь установите стандартные системные утилиты и нажмите Продолжить.

28. На этом шаге вы установите загрузчик Grub, выбрав Да. После чего следует выбрать диск для его установки.

29. Наконец, установка завершена, нажмите Продолжить, чтобы перезагрузить компьютер и удалить загрузочный носитель, затем загрузитесь в своей системе и войдите в систему.

Вот и все. Теперь у вас есть работающий Debian 11 (Bullseye) Minimal Server для разработки будущей настраиваемой серверной платформы. Если вы хотите развернуть веб-сервер, такой как Apache или Nginx, ознакомьтесь со следующими статьями.

  • Установите стек LAMP (Linux, Apache, MariaDB или MySQL и PHP) в Debian
  • Как установить LEMP (Linux, Nginx, MariaDB, PHP-FPM) в Debian
  • Полное руководство по обеспечению безопасности, укреплению и повышению производительности веб-сервера Nginx

Чтобы отправить нам любые вопросы или мысли, используйте раздел комментариев ниже.

How to Install a Debian 11 (Bullseye) Minimal Server

This tutorial shows how to install a Debian 11 – Bullseye – minimal server in detail with many screenshots. The purpose of this guide is to provide a minimal setup that can be used as the basis for our other Debian 11 tutorials here at howtoforge.com.

1 Requirements

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

  • The Debian Buster network installation CD is available here:
    64Bit: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.3.0-amd64-netinst.iso (x86_64 / amd64)
  • A fast Internet connection.

I will use the Debian 11.3 64Bit (amd64) installation media.

The Debian Download links change regularly. If the above links do not work anymore, then go here to fetch the latest Debian netinst image: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/.

2 Preliminary Note

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

3 The Debian Base System

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

Select your language:

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 your location, territory again, and locale and keyboard:

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

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

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

Afterward, give the root user a password:

Confirm that password to avoid typos:

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

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

Select the disk that you want to 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:

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

Select Yes when you’re asked: “ Write changes to disk?” :

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

It might be that the following screen 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.

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

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

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

Apt is now updating its packages database:

You can skip the package usage survey by selecting No :

We just select Standard system utilities and SSH server (so that I can immediately connect to the system with an SSH client such as PuTTY after the installation has finished) and hit Continue.

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.

The required packages are downloaded and installed on the system:

When you’re asked to Install the GRUB boot loader to the master boot record? , select Yes :

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

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

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

The first boot of the newly installed Debian 10 server: 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.

A few seconds later the login prompt should show up.

Log in with the 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 -“:

To become the root user. It is important that you use the command su with ‘-‘ or use ‘su –login’ as this is required to initialize the PATH variable correctly for the root user.

On to the next step…

4 Install The SSH Server (Optional)

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

From now on you can use an SSH client such as PuTTY and connect from your workstation to your Debian Jessie server and follow the remaining steps from this tutorial.

5 Install a shell editor (Optional)

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

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

6 Configure The Network

You can get your current IP address with the command:

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

Because the Debian 11 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 (in this example setup I will use the IP address 192.168.0.100 ) (please note that I replace allow-hotplug ens33 with auto ens33 ; otherwise restarting the network doesn’t work, and we’d have to reboot the whole system):

The interfaces file with DHCP enabled as created by the apt installer:

Or as a screenshot:

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

The edited file should look like this:

Then restart your network:

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

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

The /etc/hostname file contains the hostname without the domain part, so in our case just “server1”.

Then reboot the server to apply the hostname change:

After you logged in again, run:

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

7 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.

to update the apt package database and

to install the latest updates (if there are any).

8 Debian 11 VMWare Server Image

This tutorial is available as ready to use virtual machine image in ovf/ova format that is compatible with VMWare and Virtualbox. The virtual machine image uses the following login details:

SSH / Shell Login

Username: administrator
Password: howtoforge

Username: root
Password: howtoforge

The IP of the VM is 192.168.0.100, it can be changed in the file /etc/network/interfaces. Please change all the above passwords to secure the virtual machine.

Initial Server Setup with Debian 11

Debian is called a “universal Operating System” and rightly so. It is a free source OS that is developed by thousands of volunteers from all around the world. They mostly work online. When we dig a little deeper, we come to know that this is the base or the foundation for many Linux distributions out there. One such example is the popular Ubuntu.

Debian 1.1 was first released in 1996 and its name was Buzz. The latest release was launched on 14 Aug 2021. It is Debian 11 and its name is Bullseye. It is also worth mentioning that it is supported for the next five years and is a stable Debian version. Debian 11 offers stability, securability. For this reason, it is a very popular Os system and is an ideal candidate for server setup.

When you first install Debian 11 or when you upgrade your Debian from any version to Debian 11, you have to perform configuration first. This makes the server secure. So, in this article, we are going to teach you how to set up a server initially with Debian 11.

Step1: Opening Terminal

First, we have to open the terminal to start typing commands.

When you are logged in to Debian 11, you’ll see the Activities keyword at the top left corner of the screen. Click on that.

After clicking on the activities, type terminal in the search bar and then select Terminal:

Terminal Screen will appear.

Step2: Debian Update and Upgrade

In this step, we are going to first update our Debian packages and then upgrade them if necessary. To update the packages type the following in your terminal:

If you see “All packages are up to date” then you don’t need to upgrade.

However, if there are some packages that need upgrading type the following command in your terminal:

Step3: Create Sudo User

For our server management, it is preferred that we create a new sudo/administrator user. For this purpose let’s create a sudo user with the following command:

When you run this command you will be asked a bunch of questions including Full name, room number, etc. You can either set these values or leave them blank and press enter. When you will leave it blank, it will take the default values. In the end, y and no option will be given. Type y to continue.

We have successfully created a new user with the name of linuxmaster. The next step is to give this user the sudo privileges. For this purpose type the following command:

Now it’s time to switch the account. Type the following to switch accounts and go to linuxmaster user. For this type the following command:

We can see in the above screenshot that we have successfully changed the user from itslinux to linuxmaster.

Step4: System Hostname Configuration

The identity of our system is the hostname over some network. It is a common practice to change the hostname and put a proper name. To see your current hostname type the following command in your terminal:

To change the hostname, run the below command:

Replace the itslinux with whatever you want your hostname to be.

To see the new hostname close the terminal and start the terminal again. You will see the new hostname now. To check the hostname with a command type the following:

Step5: Secure SSH

SSH is also called Secure Shell. It is a protocol which is used for connecting with remote servers. Let’s configure the server by changing the default port first and disabling root SSH login.

Type the following command in your terminal which will open the following file in nano editor:

Once opened type the following in your editor:

When you are done typing the above lines, press CTRL+S to save the file and CTRL+X to exit.

Once done, type the following command in your terminal:

If somehow the file didn’t open then it means you are missing ssh server in the system. Install SSH server in your system by typing the following commands:

Step6: Configuring Firewall(UFW) on Debian 11

By default, Debian doesn’t have a firewall installed. In order to install firewall type the following command in your terminal:

I had ufw already installed that’s why it showed that “ufw is already the newest version”.

Once installed let’s enable our firewall. For this purpose type the following:

The next step is to allow the port set in step 5. For this type the following command in your terminal:

However, it is on anyone’s preference whether he/she wants to deny or allow the incoming or outgoing traffic. To deny the incoming traffic type the following command:

To allow outgoing traffic type the following command:

The next step is to reload the firewall UFW. For this purpose, type the following command:

If you want to see whether UFW is active or not, check the status by the following command:

If it is active that means it is enabled.

Step7: System Reboot

The final step involves rebooting your system. For this purpose type the following command:

This command will reboot your system.

Conclusion

When you first install Debian 11 you need to set up a server. One must follow these steps to set up the server. These steps include updating and upgrading, adding a new sudo user, set up a firewall, and securing SSH.

In this article, we have learned today how to set up a server on Debian 11 Bullseye initially. These are some necessary steps when you start working in Debian 11.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *