Hetzner is a globally recognized hosting provider, and its servers stand out for their performance and flexibility. In addition to standard operating system installations, it is also possible to install operating systems on Hetzner servers via custom ISO files. This gives users more control and customization options. In this article, we will examine all the details of installing an operating system on a Hetzner server with a custom ISO.
1. Introduction
Hetzner is a hosting provider that is particularly popular in Europe. The servers it provides are highly competitive in terms of both performance and price/performance ratio. Standard operating systems (e.g., Ubuntu, Debian, CentOS) can be easily installed on Hetzner servers. However, in some cases, users may want to install an operating system using their own custom ISO files. This can be especially useful in the following situations:
- Using a custom operating system distribution
- Installing a pre-configured operating system
- Using a custom operating system due to security requirements
- Installing a different hypervisor (e.g., Proxmox)
In this article, we will cover all the steps, points to consider, and potential problems of installing an operating system on a Hetzner server with a custom ISO.
2. Preliminary Preparation
2.1. Server Selection and Ordering
The first step is to select and order a suitable server from Hetzner. In this process, you should determine the server's hardware specifications (CPU, RAM, disk space) and network connection according to your needs. Hetzner Cloud Germany Location Servers can be a good option, especially for beginners.
2.2. Preparing the ISO File
You need to prepare the ISO file of the operating system you want to install. This ISO file contains all the installation files of the operating system. You can download the ISO file from the official website of the operating system or create it yourself. To create your own ISO file, you can use tools such as mkisofs
or xorriso
.
2.3. Accessing the Hetzner Robot Interface
After ordering your Hetzner server, you will be provided with access to a Robot interface. This interface is used to manage your server, restart it, install operating systems, and perform other operations. You can log in to the Robot interface with the username and password you received from Hetzner.
2.4. Rescue System
Before installing an operating system with a custom ISO, you need to put the server into the rescue system. The rescue system is a system that you can use when your server's operating system crashes or becomes inaccessible. The rescue system is usually a Linux-based environment and allows you to access your server via SSH.
3. Entering the Rescue System
3.1. Activating the Rescue System in the Robot Interface
In the Hetzner Robot interface, select your server and go to the "Rescue System" section. Here, you can activate the rescue system. When you activate the rescue system, you will be given an SSH username and password. Make a note of this information.
3.2. Connecting to the Rescue System via SSH
After activating the rescue system, you can connect to your server using an SSH client (e.g., PuTTY, Terminal). In your SSH client, enter the username and password you received from the rescue system. If the connection is successful, you will have access to the rescue system.
ssh root@server_ip_address
4. Uploading the ISO File to the Server
4.1. Downloading the ISO File
After connecting to the rescue system, you need to download the ISO file to the server. To download the ISO file, you can use tools like wget
or curl
. You need to know the URL where the ISO file is located.
wget https://example.com/custom.iso
4.2. Uploading the ISO File to the /tmp Directory
It is usually best to upload the ISO file to the /tmp
directory. The /tmp
directory is a directory used for temporary files, and its contents are deleted when the server is restarted.
4.3. Checking the MD5 Checksum of the ISO File
After downloading the ISO file, it is important to check the MD5 checksum to ensure that the file has not been corrupted. You can find the checksum of the ISO file on the website where you downloaded the ISO file or from the ISO file's manufacturer. To check the checksum, you can use the md5sum
command.
md5sum custom.iso
This command will calculate the MD5 checksum of the ISO file. The calculated checksum should be the same as the expected checksum. If it is not the same, the ISO file is corrupted and you need to download it again.
5. Mounting the ISO File
5.1. Creating a Loopback Device
To mount the ISO file, you need to create a loopback device. A loopback device is a device that allows you to use a file as if it were a block device. To create a loopback device, you can use the losetup
command.
losetup /dev/loop0 custom.iso
This command will associate the custom.iso
file with the /dev/loop0
loopback device.
5.2. Mounting the ISO File
After creating the loopback device, you can mount the ISO file. To mount it, you can use the mount
command.
mount -o loop /dev/loop0 /mnt
This command will mount the /dev/loop0
loopback device to the /mnt
directory. You can now access the contents of the ISO file by accessing the /mnt
directory.
6. Starting the Operating System Installation
6.1. VNC or NoVNC Installation
Before starting the operating system installation, you need to install a VNC (Virtual Network Computing) or NoVNC (Web-based VNC) server on the server. This will allow you to remotely view the server's screen during installation and follow the installation steps. To install VNC or NoVNC, you need to follow the operating system-specific installation instructions.
6.2. Running the Operating System Installation Command
After completing the VNC or NoVNC installation, you can run the operating system installation command. This command will run the installation script in the ISO file and start the operating system installation. The installation command may vary depending on the operating system and ISO file. Usually, the installation script is named with a name like install.sh
or setup.sh
.
/mnt/install.sh
6.3. Following the Installation Steps
After running the installation command, you can view the server's screen via VNC or NoVNC and follow the installation steps. The installation steps may vary depending on the operating system. Usually, you will need to enter information such as language selection, keyboard layout, disk partitioning, username, and password.
7. Post-Installation Configuration
7.1. Configuring Network Settings
After the operating system installation is complete, you need to configure the network settings. This is necessary for the server to connect to the internet. To configure network settings, you can use the operating system's network configuration tools. Usually, you will need to enter information such as IP address, network mask, gateway, and DNS server.
7.2. Enabling SSH Access
To access the server via SSH, you need to enable the SSH server. The SSH server is usually automatically enabled during operating system installation. However, in some cases, you may need to enable it manually. To enable the SSH server, you will need to edit the operating system's SSH configuration files.
7.3. Firewall Installation and Configuration
To ensure the security of your server, it is important to install and configure a firewall. The firewall controls incoming and outgoing network traffic to your server and prevents unauthorized access. To install and configure a firewall, you can use tools such as iptables
or ufw
.
8. Troubleshooting
8.1. Errors Encountered During Installation
You may encounter various errors during installation. The causes of these errors may be a corrupted ISO file, hardware incompatibility, network problems, or software errors. By carefully reading the error messages, try to understand the cause of the error and try to find a solution. If necessary, you can solve the problem by researching on the internet or getting help from experts.
8.2. Network Connection Problems
You may experience network connection problems after installation. The reasons for these problems may be incorrect network settings, DNS issues, or firewall blocks. Check your network settings, configure DNS servers correctly, and make sure the firewall is not blocking the necessary ports.
8.3. SSH Access Problems
You may not be able to access the server via SSH after installation. The reasons for these problems may be that the SSH server is not running, incorrect SSH configuration, or firewall blocks. Make sure the SSH server is running, check the SSH configuration files, and make sure the firewall is not blocking the SSH port (usually 22).
9. Real-Life Examples and Case Studies
9.1. Custom Security Distribution Installation
A security company wants to install a custom security distribution on its customers' servers. This distribution includes pre-configured security tools and settings. By installing this distribution on Hetzner servers with a custom ISO, the company provides its customers with a more secure environment.
9.2. Custom Hypervisor Installation
A hosting company wants to offer its customers a custom hypervisor (e.g., Proxmox). By installing this hypervisor on Hetzner servers with a custom ISO, the company provides its customers with virtualization solutions.
10. Frequently Asked Questions
- 10.1. Is it safe to install with a custom ISO?
- Yes, it is safe to install with a custom ISO. However, you need to make sure that the ISO file comes from a trusted source. Otherwise, you may endanger your server by installing an ISO file containing malware.
- 10.2. Which operating systems can I install with a custom ISO?
- You can install almost all operating systems with a custom ISO. However, some operating systems offer tools and documentation that make installation with a custom ISO easier.
- 10.3. How long does it take to install with a custom ISO?
- The installation time with a custom ISO may vary depending on the size of the ISO file, the server's hardware specifications, and the network connection. It can usually take between 30 minutes and several hours.
11. HTML Tables
Table 1: Comparison of Operating System Installation Methods
Installation Method | Advantages | Disadvantages |
---|---|---|
Operating System Provided by Hetzner | Easy and fast installation, automatic configuration | Limited operating system options, limited customization options |
Operating System with Custom ISO | Wide range of operating system options, high customization options | More complex installation process, requires more technical knowledge |
Table 2: Rescue System Commands
Command | Description |
---|---|
wget |
Used to download files from a URL. |
md5sum |
Used to calculate the MD5 checksum of a file. |
losetup |
Used to create or manage loopback devices. |
mount |
Used to mount a file system. |
12. Conclusion and Summary
Installing an operating system on a Hetzner server with a custom ISO provides users with more control and customization options. In this article, we covered all the steps of the installation, points to consider, and potential problems. Before installing with a custom ISO, it is important to ensure that the ISO file comes from a trusted source and that you carefully follow the installation steps. After a successful installation, you can start using your server by configuring it securely.