Linux VPS

Reinstall the OS on a VPS: checklist before and after

A safe checklist for reinstalling your VPS operating system: what to back up, how to record configs and DNS, choosing the OS, what to do right after reinstall, and how to restore.

BeginnerLinux VPS2 min read

A reinstall wipes the VPS disk and installs a fresh operating system. It is the fastest fix for a compromised or badly broken server, or to switch distributions, but everything on the disk is lost. Use this checklist to reinstall a VPS OS safely.

Before you start

  • Your panel's reinstall feature: Virtualizor or VirtFusion.
  • Somewhere to store backups off the VPS: your computer, another server or object storage.

Back up everything you need

  • Website files: /var/www, app folders, uploads.
  • Databases: mysqldump --all-databases or pg_dumpall, compressed.
  • Configs: /etc/nginx, /etc/apache2 or /etc/httpd, PHP-FPM pools, /etc/letsencrypt, systemd units, crontabs (crontab -l for each user).
  • Docker: compose files and named volumes.
  • Home directories and SSH keys you want to keep.

Copy them off with rsync or rclone; see back up to S3 with rclone. Download and test-open at least one archive.

Record what you will need

  • Main and additional IPs, gateway, IPv6 range (usually restored automatically, but note them).
  • Installed packages: dpkg --get-selections or dnf list installed.
  • Open firewall ports and special kernel settings (/etc/sysctl.d).

Choose the OS

Pick a supported, current release. See choose a VPS OS template and Ubuntu vs Debian. If the old server was hacked, do not restore old system binaries or configs blindly; restore only data and reviewed configs.

Reinstall

  1. In the panel, choose the template, set a strong root password or SSH key, and confirm.
  2. Wait for completion, then connect. Your SSH client will warn about a changed host key: remove the old entry with ssh-keygen -R your-ip.

After the reinstall

  1. Run through first steps on a new VPS: updates, sudo user, SSH keys, firewall.
  2. Install your stack again.
  3. Restore data, then databases, then reviewed configs.
  4. Reissue SSL certificates and re-add cron jobs.
  5. Test sites and services, then monitor logs for a day.

Troubleshooting

  • "REMOTE HOST IDENTIFICATION HAS CHANGED": expected after reinstall; remove the old known_hosts entry.
  • No network after reinstall: the template did not apply IPs; check in the panel or console. See VPS with no network.
  • Database import errors: version differences; import into the same major version or upgrade dumps.

Frequently asked questions

Does a reinstall change my IP?

Normally no; IPs belong to the VPS, not the OS.

Can I undo a reinstall?

No, only by restoring a backup taken before.

Do provider backups survive a reinstall?

Usually yes if stored separately, but check your provider's policy first.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.