Log inSign up

Reinstalling an instance with a fresh image

Open the instance, go to the Settings tab, pick one of the 18 images under Reinstall and confirm. The disk is erased, the chosen image is installed and a new root password appears on Overview, while the server itself and its prepaid term stay in place.

When does a reinstall make sense?

Use it when a clean start is faster than repair, or when you want a different system on the same paid instance. Typical reasons:

  • Switching OS, for example from Ubuntu 22.04 to Debian 13, or to an app image such as WireGuard or Nextcloud.
  • Recovering after a lockout: no working SSH key, password or sudo user, and no browser console to get in another way.
  • Cleaning up after a suspected compromise, where trusting the old system is not an option.
  • Resetting a test box between experiments.

A reinstall is not a plan change. The vCPU, memory, disk size, city and term all stay the same. For more resources, see moving to a larger plan.

What should you save before you start?

Everything you want to keep, because nothing on the disk survives. If you can still log in, gather the data and the config first.

sudo tar czf /root/pre-reinstall.tgz /etc /home /var/www /srv 2>/dev/null
sudo -u postgres pg_dumpall | gzip > /root/pg-all.sql.gz        # if you use PostgreSQL
sudo mysqldump --all-databases --single-transaction | gzip > /root/my-all.sql.gz
ls -lh /root/*.gz /root/*.tgz

Then pull those files to a machine you control, from your own computer:

scp root@198.51.100.24:/root/pre-reinstall.tgz root@198.51.100.24:/root/pg-all.sql.gz ./

Also note the things you would otherwise rebuild from memory: your nftables file, crontabs, the list of installed packages from dpkg --get-selections, and the versions of key software.

Which image should you pick?

Pick the one your tools and habits fit best. The 18 images are 12 operating systems and 6 apps:

  • Ubuntu 24.04 and 22.04: the widest package and guide coverage, and the base of every app image.
  • Debian 12 and 13: lean, slow-moving, a common choice for servers left alone for years.
  • AlmaLinux 9, Rocky Linux 9, CentOS Stream 9: the RHEL family with dnf and firewalld.
  • Fedora 41, openSUSE Leap 15.6, Arch Linux: newer packages or a distribution you already know.
  • Alpine Linux and FreeBSD 14: very small footprints; FreeBSD brings pf and jails.
  • Apps: Docker, WordPress, WireGuard, OpenVPN, Nextcloud and GitLab CE, each on Ubuntu 24.04.

The images page lists what each one includes.

How do you run the reinstall?

From the console, in four clicks:

  1. Open Instances and click the server. The reinstall icon in the instance list leads to the same place.
  2. Go to the Settings tab and scroll to Reinstall.
  3. Choose the image from the list.
  4. Press Reinstall and confirm in the dialog, which names the server so you can check you picked the right one.

While it runs, the server is offline. The Settings tab is also where the label lives, so if the role of the server changes, rename it there too, for example from web-old to vpn-sto-1. The label is only for you; it does not affect the hostname inside the OS.

How do you log in afterwards?

With the new root password shown on the Overview tab. Every reinstall generates a fresh one, and the password you set before is gone with the old disk.

If the address is the same as before, your SSH client will warn that the host key changed. That is expected, since the new system made new host keys. Clear the old entry and connect:

ssh-keygen -R 198.51.100.24
ssh-keygen -R 2001:db8:4f2a::24
ssh root@198.51.100.24

Then put your key back in place from your computer, so the next steps do not need the password:

ssh-copy-id -i ~/.ssh/bvps_ed25519.pub root@198.51.100.24

What should you redo on the fresh system?

Repeat the short setup you did on day one, in the same order:

  1. Update packages: apt-get update && apt-get -y full-upgrade, or the dnf, apk or pkg equivalent.
  2. Set your own root password with passwd and create the daily sudo user.
  3. Apply SSH hardening from the hardening tutorial.
  4. Load your firewall ruleset with the rollback timer from the firewall tutorial.
  5. Install vnstat again; its counters start from zero on a new system.

If you keep this list as a shell script in your backup, the whole routine takes a couple of minutes.

How do you bring your data back?

Upload the archive and dumps, restore only what belongs on the new system, and start the services.

scp pre-reinstall.tgz pg-all.sql.gz root@198.51.100.24:/root/
ssh root@198.51.100.24
mkdir /root/old && tar xzf /root/pre-reinstall.tgz -C /root/old
rsync -a /root/old/var/www/ /var/www/
rsync -a /root/old/srv/ /srv/
zcat /root/pg-all.sql.gz | sudo -u postgres psql

Do not copy the whole old /etc over a new release; take files one by one, such as /root/old/etc/caddy/Caddyfile or /root/old/etc/nftables.conf, and compare them with diff first. With a restic repository, restic restore latest --target /root/old replaces the tar step.

How do you confirm everything is back?

Check services, ports and the public view in that order.

systemctl --failed
sudo ss -tulpn
curl -sI https://example.net | head -n 3
cat /etc/os-release | head -n 2

No failed units, only the ports you expect, a 200 from your site and the release you picked. Finish by running a fresh backup, because your last copy was taken from the old system.

Questions about this tutorial

Does reinstalling change my plan or term?

No. The instance keeps its plan, city and prepaid term. Only the disk content and root password are new.

Are my SSH keys from the console added again?

Plan to add your key yourself after a reinstall with ssh-copy-id, using the new root password from Overview to get in.

Can I install my own ISO instead?

Custom ISOs are not offered. Pick from the 18 images, then install your own software on top.

Can I undo a reinstall?

No. The old disk is erased. If you had the daily backups add-on, ask support about restoring a copy from the Backups tab; otherwise use your own backups.

Is Windows one of the images?

No. The images are Linux distributions, FreeBSD 14 and six app images built on Ubuntu 24.04.

How quickly is a reinstalled instance back online?

Usually a few minutes. Wait until the server shows as running and give SSH another minute before connecting.