๐Ÿ”ง How to Use installimage on Hetzner

Here is a guide on how to use installimage on a Hetzner server:

installimage is Hetzner’s CLI-based automated OS installation tool. You can define disk layouts, filesystems, hostname, RAID setup, and more. Here’s how to use it:


๐Ÿ–ฅ๏ธ Step 1: Boot into Rescue Mode

  1. Log in to the Hetzner Robot or Cloud Console.
  2. Enable Rescue System for your server.
  3. Reboot the server.
  4. SSH into your server using the credentials provided by Hetzner:
ssh [email protected]

โš™๏ธ Step 2: Run installimage

Once in rescue mode, run:

installimage

This launches an interactive TUI (text user interface) where you can select:

  • OS (e.g., AlmaLinux, Ubuntu, Debian)
  • Target disk
  • Filesystem
  • RAID level
  • Network configuration

To customize installation, edit the config file before running the install.


๐Ÿ“„ Step 3: Example Custom Configuration

You can pre-configure the install using a config file:

# Example installimage config

SWRAID           1
SWRAIDLEVEL      1
BOOTLOADER       grub
HOSTNAME         server.yourdomain.com

PART swap swap 4G
PART /boot ext3 1024M
PART / ext4 all

IMAGE            /root/images/AlmaLinux-9.3-64-minimal.tar.gz

๐Ÿง  Step 4: Custom DNS (Optional)

To define your DNS resolvers (e.g. if install hangs), edit /etc/resolv.conf:

cat <<EOF > /etc/resolv.conf
# Dummy Nameserver Configuration
nameserver 1.1.1.1
nameserver 8.8.8.8
EOF

Or example (from Hetzner):
nameserver 185.12.64.2
nameserver 185.12.64.1

๐Ÿงช Step 5: Run the Installation

Run the installer with your config:

installimage -a -c /root/install.conf

-a: auto install
-c: specify config file


โœ… After Installation

  1. The server will automatically reboot after install.
  2. Log in via SSH using your new OS and hostname.

๐Ÿ—’๏ธ Example Output Snippet

[root@server ~]# cat /etc/resolv.conf
# Custom DNS
nameserver 185.12.64.2
nameserver 185.12.64.1
[root@server ~]#

Here are tailored installimage configuration guides for:

  • โœ… RAID 1 (original example)
  • โšก RAID 0
  • ๐Ÿšซ Non-RAID
  • ๐Ÿ“ฆ LVM setup

All use dummy values for safety.


โœ… RAID 1 โ€“ Mirrored Setup (High Availability)

SWRAID           1
SWRAIDLEVEL      1
BOOTLOADER       grub
HOSTNAME         raid1-server.example.com

PART swap swap 4G
PART /boot ext3 1024M
PART / ext4 all

IMAGE            /root/images/AlmaLinux-9.3-64-minimal.tar.gz

Mirrors data across 2+ disks for redundancy.


โšก RAID 0 โ€“ Striped Setup (Performance)

SWRAID           1
SWRAIDLEVEL      0
BOOTLOADER       grub
HOSTNAME         raid0-server.example.com

PART swap swap 4G
PART /boot ext3 1024M
PART / ext4 all

IMAGE            /root/images/AlmaLinux-9.3-64-minimal.tar.gz

Stripes data across disks โ€“ faster, but no redundancy.


๐Ÿšซ Non-RAID Setup (Single Disk)

SWRAID           0
BOOTLOADER       grub
HOSTNAME         noraid-server.example.com

DRIVE1           /dev/sda
PART swap swap 4G
PART /boot ext3 1024M
PART / ext4 all

IMAGE            /root/images/AlmaLinux-9.3-64-minimal.tar.gz

Uses just one disk (/dev/sda), suitable for small or test setups.


๐Ÿ“ฆ LVM Setup (Flexible Partitioning)

SWRAID           0
BOOTLOADER       grub
HOSTNAME         lvm-server.example.com

DRIVE1           /dev/sda
PART /boot ext3 1024M
PART lvm vg0 all
LV vg0 swap swap 4G
LV vg0 root ext4 all

IMAGE            /root/images/AlmaLinux-9.3-64-minimal.tar.gz

LVM allows dynamic volume resizing and easier future partition changes.


๐Ÿ”ง Common DNS Setup (Optional)

For all above configs, you can use:

cat <<EOF > /etc/resolv.conf
# Dummy DNS entries
nameserver 1.1.1.1
nameserver 8.8.8.8
EOF

Or Hetzner-specific:

nameserver 185.12.64.2
nameserver 185.12.64.1
Scroll to Top