Cloud Servers

Rebuilding Your Cloud Server

Rebuilding reinstalls the operating system from scratch on your existing server, which erases the disk completely and gives you a clean machine on the same IP addresses.

It is the right tool for a small number of jobs and a very bad tool for everything else. This guide covers when a rebuild is genuinely the answer, what it destroys, one specific consequence that catches people out, and how to prepare properly before you click.

When a Rebuild Is the Right Move

Rebuild when:

  • You want to switch operating system, for example from Ubuntu to Debian, or from one Ubuntu release to another.
  • The operating system is unbootable or so broken that repairing it would take longer than starting again.
  • You are repurposing the server for something completely different and want nothing of the old setup left.
  • You genuinely want everything on the disk gone.

Do not rebuild to undo a change you just made. That is what snapshots are for, and a rollback is faster and keeps your data. Do not rebuild to free disk space, to fix a slow application, or because something is misconfigured: none of those need the operating system replaced.

Read This Before You Rebuild

A rebuild permanently destroys everything on the server: every site, mailbox, database, uploaded file, installed package, certificate, cron job and configuration file. It cannot be undone, and there is no confirmation step after the final one. The confirmation dialog says so plainly: "This reinstalls the operating system and permanently destroys everything on the server. This cannot be undone. Make sure you have your own backups before rebuilding."

The rebuild also erases the Kapsule tooling that is installed on the disk when a server is first provisioned. That tooling is what the panel uses to reach into the machine. After a rebuild, the server-side half of the backup system is gone, so although your existing backup data is still held safely in encrypted offsite storage, the Restore button in KPanel cannot use it on the rebuilt server. The same applies to Back up now, the live firewall and patch apply, and the browser console: they all depend on that on-disk tooling. Get anything you need off the server, or out of a backup, before you rebuild. If you think you may want data from a pre-rebuild backup afterwards, contact us first rather than after.

Your IPv4 and IPv6 addresses do not change. Only the contents of the disk do.

Preparing for a Rebuild

Work through this list before you start. None of it is optional if the server holds anything you care about.

  1. Take a snapshot. A snapshot is a full copy of the disk. It is the only thing that lets you get the current machine back if you change your mind. See Cloud Server Snapshots.
  2. Export your data yourself. Copy databases, uploads and configuration to somewhere off the server: your own machine, another server, or object storage. Do not rely on the panel being able to restore a backup afterwards.
  3. Write down what is installed. After a rebuild you are rebuilding your stack by hand. A list of packages, services, virtual hosts and cron jobs saves hours.
  4. Check your DNS. If anything points at this server, it will point at an empty machine for as long as the rebuild and rebuild-out take.
  5. Confirm you can get back in. Decide now how you will connect to the freshly installed operating system, and see Connecting to Your Cloud Server With SSH.

The browser console is not a reliable fallback after a rebuild, for the reason described above. Do not plan on it as your way back in.

How to Rebuild

  1. Sign in to KPanel.
  2. Click Cloud Servers in the left sidebar, then click the server.
  3. Click Rebuild OS in the action buttons at the top of the page.
  4. The Rebuild OS dialog opens with the line "All data on this server will be lost. Choose the OS to install:" and a dropdown.
  5. Choose the operating system you want:
    • Ubuntu 24.04 LTS, the current long-term support release.
    • Ubuntu 22.04 LTS, the previous long-term support release.
    • Debian 12 (Bookworm), a stable Debian with a small footprint.
  6. Click Rebuild Server.
  7. A final confirmation appears, headed "Rebuild" and your server's name. Read it, then click Rebuild server.

The Rebuild OS dialog on a cloud server in KPanel

Rebuild OS is only available when the server is Running or Powered Off. A server that is still provisioning, or already rebuilding, cannot be rebuilt.

What Happens Next

  • The server's status changes to Rebuilding and a banner appears: "Rebuilding in progress: page will update automatically."
  • Everything on the disk is erased and the chosen operating system image is written in its place.
  • The server reboots into the new installation.
  • The page refreshes itself, and the status returns to Running.

The server is offline for the duration. A rebuild is usually quick, but treat it as an outage rather than a background task, and do it at a time when your users will not notice.

After the Rebuild

You now have a bare operating system. Nothing you installed before exists.

  1. Connect to the server and confirm you can get a shell. See Connecting to Your Cloud Server With SSH.
  2. Re-apply your firewall rules. The rebuild removed the old ones. See Cloud Server Firewall and Security Management.
  3. Install your stack again: web server, runtime, database, and any application dependencies.
  4. Restore your own exported data.
  5. Re-issue SSL certificates. The previous ones were on the disk that was erased.

Do not assume the daily backup will pick the server back up on its own. If the server-side backup tooling was removed by the rebuild, backups will not resume by themselves. Check the Backups card after the rebuild, and contact us if it reports that backups are not configured. See Cloud Server Backups.

Alternatives Worth Considering First

What you wantBetter tool than a rebuild
Undo a change you just madeRoll back a snapshot
Recover deleted files or a broken databaseRestore from a backup
More CPU, memory or diskResize the server
A different processor family or regionOrder a new server; see Choosing Between ARM, Standard and Dedicated vCPU
A clean environment to test inProvision a second, small server and keep this one intact

Troubleshooting

The Rebuild OS button is greyed out. The server is not in a state that allows it. Wait for provisioning or an existing rebuild to finish.

The status is stuck on Rebuilding. The page polls every few seconds and updates itself. If it has not changed after fifteen minutes, contact support with the server name.

I cannot connect after the rebuild. You are connecting to a brand new operating system installation with new host keys, so your SSH client will refuse the old fingerprint. Remove the stale host key entry for that IP address and reconnect. If authentication itself fails, contact us.

I rebuilt by mistake. If you took a snapshot beforehand, roll it back. If you did not, the data is gone. This is why the confirmation is worded the way it is.

If you are not certain a rebuild is what you need, email support@kapsulehost.com with what you are trying to achieve, before you start. A rebuild is one of the few actions on the platform with no way back.

Still need help?

Email us at support@kapsulehost.com or open a chat in KPanel.

Open KPanel