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
- Log in to the Hetzner Robot or Cloud Console.
- Enable Rescue System for your server.
- Reboot the server.
- 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
- The server will automatically reboot after install.
- 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