ESC

Start typing to search across invoices, services, domains, tickets, and more...

Search... Ctrl+K
Linux Server

How to Reinstall the OS on a Linux VPS with a One-Click DD Script (2026)

5 steps 16 min read 8 views 0
On this page

When the OS templates in your control panel don't meet your needs — for example, you want the latest Debian, a specific Ubuntu version or your own image — you can use an open-source one-click reinstall script to reinstall from within the running system. This guide uses the actively maintained bin456789/reinstall project on GitHub as an example to explain the approach, with a focus on backups and VNC rescue preparation before you reinstall, so you can keep risk to a minimum.

Key Takeaways

  • The open-source bin456789/reinstall script can reinstall Debian, Ubuntu, Rocky Linux, AlmaLinux and other systems on a Linux VPS from within the running system, or DD a custom image.
  • One-click reinstall (DD) scripts work only on KVM-based VPS and dedicated servers; container-based virtualization such as OpenVZ and LXC cannot use them.
  • Reinstalling with a one-click script wipes the entire system disk, so you must back up all data, record network details such as the IP and gateway, and confirm VNC works before you start.
  • A DD custom image doesn't get network configuration injected automatically, so the image must obtain an address via DHCP or already have a static IP, or the server will be unreachable and fixable only through VNC.
  • IMIDC's KVM cloud servers and dedicated servers all support VNC or IPMI management, and 24/7 technical support is available by ticket if network or boot issues occur during a reinstall.

Requirements / Before You Start

  • Works on KVM-based VPS and dedicated servers. Container-based virtualization such as OpenVZ and LXC cannot use this type of script.
  • You can currently log in to the system via SSH and have root privileges.
  • RAM and disk space meet the minimum requirements for the target OS listed in the script's README (requirements vary by OS, and Windows needs more).
  • Back up all your data: Reinstalling wipes the entire system disk, so export website files, databases and configs to another server or your local machine first.
  • Record your network details: Run the following commands and save screenshots so you can restore the network manually if the server becomes unreachable:
ip addr
ip route
cat /etc/resolv.conf
  • Make sure VNC works: Open VNC / the console in the client area first and confirm you can see the current system's screen. If the reinstall fails or the network isn't configured correctly, VNC is your only way to rescue the server.

Step-by-Step Instructions

Step 1: Download the Reinstall Script

On servers outside mainland China, download it from GitHub:

curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O reinstall.sh https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh

If your server has slow access to GitHub, you can use the mainland China mirror listed in the project README. After downloading, it's a good idea to skim the script and README to confirm the source is trustworthy.

Step 2: Choose the Target OS and Run the Script

The basic syntax is bash reinstall.sh <os-name> <version>. Common examples:

# Reinstall as Debian 13
bash reinstall.sh debian 13

# Reinstall as Ubuntu 24.04
bash reinstall.sh ubuntu 24.04

# Reinstall as Rocky Linux / AlmaLinux 9
bash reinstall.sh rocky 9
bash reinstall.sh almalinux 9

When it runs, the script prompts you to set the root password for the new system. You can also pass the password, SSH port or public key as parameters:

bash reinstall.sh debian 13 --password 'Your-Strong-Pass' --ssh-port 22022
bash reinstall.sh debian 13 --ssh-key "ssh-ed25519 AAAA... user@pc"

Parameter names and the list of supported systems change between versions. Always check the project README before running, or run bash reinstall.sh --help.

Step 3: DD a Custom Image (Optional)

If you have your own raw image (compressed formats such as gzip, xz and zstd are supported), you can DD it straight to the disk:

bash reinstall.sh dd --img "https://example.com/my-image.raw.xz"

DD images don't get network configuration injected automatically. The image itself must be able to obtain an address via DHCP or already have a static IP configured. Otherwise the server will be unreachable after the reinstall and can only be fixed through VNC.

Step 4: Reboot to Start the Installation

When the script has finished preparing, it prompts you to reboot:

reboot

After rebooting, the system enters the installation process, which usually takes 5–20 minutes depending on the target OS, network speed and machine performance. You can watch the progress in VNC. Do not force a reboot or power off midway.

Step 5: Log In to the New System and Verify

Once installation finishes, SSH in with your new password and port, then check the network and disks:

ip addr
ping -c 4 1.1.1.1
df -h
cat /etc/os-release

Then update the system and redo your security hardening (change the SSH port, disable password login, configure the firewall and so on).

FAQ

What if I still can't SSH in long after rebooting?

Open VNC first and check the screen. If it's still installing, be patient. If it's stuck on an error screen, or the new system has booted but has no network, configure the network manually in VNC using the IP and gateway you recorded earlier. If you can't fix it yourself, submit a ticket.

Can I recover if a failed reinstall breaks the system?

You can reinstall using an official OS template from the client area, or submit a ticket to have a technician mount a rescue system. This assumes you backed up your data beforehand — the reinstall itself doesn't keep any files.

Can the script install Windows?

The script does support installing Windows, but it has higher RAM and disk requirements, and you'll need to take care of Windows licensing. See the README for the specific parameters.

Will reinstalling with a one-click script affect my IP?

It won't change the IP assigned to your server. The script usually detects and reuses the existing network configuration automatically. On servers with multiple IPs, you'll need to bind the additional IPs again after reinstalling.

Summary

Open-source scripts like bin456789/reinstall give you flexibility to switch OS versions, but because they operate directly on the disk, they're riskier than reinstalling from the panel. Remember three steps: back up first, record your network details, and have VNC ready, and you'll be able to handle problems calmly. If you only need a common OS, the built-in reinstall feature in the IMIDC client area is the easier option. IMIDC's KVM cloud servers and dedicated servers all support VNC or IPMI management. If you run into network or boot issues during a reinstall, submit a ticket at any time and our 24/7 technical support will help you troubleshoot.

Related Articles

Was this answer helpful?

Related Tutorials