Reinstalling the OS
How to reinstall a machine from scratch or change the OS: what to save in advance, how the process goes, and what to configure right after.
Updated August 23, 2026
Reinstallation returns the machine to a like-new state: a clean system, everything on the disk is erased. This is a normal working tool, not a last resort.
When it's the right move
- You need a different OS: for example, you picked AlmaLinux, but all your instructions are for
apt. - The configs are so tangled that fixing them takes longer than setting them up from scratch.
- The machine is compromised. After a breach, cleaning the system is pointless: you don't know what's left in it.
- The project is finished, and the machine is being repurposed for a new task.
What to do beforehand
Reinstallation wipes the disk completely. VPS has no snapshots or automatic backups of the machine — if you forget something, you won't be able to recover it.
Checklist:
- Database dump
mysqldump -u root -p mydb > /root/mydb.sql
pg_dump -U postgres mydb > /root/mydb.sql
- Archive of data and configs
tar czf /root/save-$(date +%F).tar.gz /var/www /etc/nginx /opt/app
- Download everything to your computer
rsync -avz root@203.0.113.10:/root/save-2026-08-23.tar.gz ./
Learn more — scp and rsync.
- Write down what was configured: package list, ports, domains, scheduler jobs
dpkg --get-selections > /root/packages.txt
crontab -l > /root/crontab.txt
- Check that the archive opens on your computer. An unchecked copy is not a copy.
How to reinstall
A machine suspended for non-payment can't be reinstalled, just like other actions: first renew, then anything with the disk. See Suspension for non-payment.
- Machine control panel
/hosting/vds/m/<id>, the “Access” tab, the “Reinstallation” subsection. - Choose an OS: Debian 12 or 13, Ubuntu 22.04 / 24.04 / 26.04, AlmaLinux 9 or 10, CentOS Stream 9, Windows Server 2022 or 2025.
- Confirm. The machine is reinstalled and boots up again.
- The control panel shows the new password immediately after reinstallation, and it can later be opened with the “Show password” button.
- SSH keys again: they aren't transferred to the new system. Open “SSH Keys” and save the list — the machine will reboot once more.
The public IPv4 address remains the same, and domains don't need to be redirected again.
Right after
The machine key has changed, so the SSH client will complain:
REMOTE HOST IDENTIFICATION HAS CHANGED
Remove the old entry and log in again:
ssh-keygen -R 203.0.113.10
ssh root@203.0.113.10
Next, go through the first-hour checklist: updates, SSH keys, user, firewall, guest agent.
Common mistakes
| Mistake | Consequence |
|---|---|
| Left the archive on the machine itself | It was erased along with the disk |
| Didn't check the database dump | There's nothing to restore, or the file is empty |
| Forgot the list of settings | A week spent restoring what took months to set up |
| Reinstalled instead of diagnosing | The problem recurred on a clean system |
If the goal is just to restore access, not start from scratch, reinstallation isn't needed: see changing the root password and the text console.