Tutorials Reinstalling your server while keeping the IP addresses

Reinstalling your server while keeping the IP addresses

If you ever need to get a fresh install of your cloud server, but would also want to retain the IP addresses from your old host, then this guide is for you. The storage devices containing the operating system for your servers are easy to configure, move and remove using the features at your UpCloud control panel.

In essence, to reinstall the OS for your server, you will need to deploy a temporary new host with the OS of your choice, replace the old server storage with the freshly installed disk, and you are done. Follow up below with the exact steps on how this is done.

Test hosting on UpCloud!

Deploy new identical server

To start with, log into your UpCloud control panel and deploy a new cloud server.

On the deployment page, make the following configurations:

  • Select the same location and plan as your current server
  • Name the storage device such that you’ll recognise it later
    Name the storage device
  • Pick the operating system you want
  • Include any SSH keys
  • Add the following initialization script to automatically shut down the server after deployment
    shutdown -h 1

    Script to shutdown after deployment

  • At the last step, set the hostname and description the same as your current server
    Name the new server

Once you are done configuring the new host, click the Deploy button at the bottom of the page.

Moving the fresh install

While waiting for the new server to finish deploying, shut down the current host either at the server list or in your server settings.

Shuting down the current server

If you included the shutdown script at deployment, the new server should also be powered down. Otherwise, shut it down manually.

Next, open the settings of the newly deployed server and go to the Resize tab. Click the eject icon to detach the storage device.

Attaching existing storage

Then, open the server settings of your current server. With the server powered down, go to the Resize tab to continue.

Detach the first device as you did above if you wish to keep it as a backup, or optionally you can delete it right away by clicking the bin icon if it’s no longer needed.

Finally, add the new device by clicking the Attach existing storage button. Then find the new disk by its name on the list of available storage devices, your free storage devices are at the top of the list.

With the right device selected, click the Add a storage device button to confirm.

Attaching existing storage device

Once the storage is attached, you can go ahead and boot up the server again with the clean installed OS. Log into the host using the new root password or any SSH keys you may have assigned at deployment and confirm the server is working properly.

Cleaning up

Afterwards, you can delete the temporary server from the server settings.

Delete temporary server

The old storage device can also be deleted at your Storage list if you no longer need it.

Delete the old storage device

If the server is having connectivity problems after system device swap, you can use VNC or the web console to log in. For servers running CentOS 6.7 or older and Ubuntu 12.04 or older, you may need to remove the old MAC address reference file and restart the server.

sudo rm /etc/udev/rules.d/70-persistent-net.rules
sudo reboot

Then test the network connectivity again.

Summary

You should now have a clean installation of the OS of your choosing up and running with all the previously configured resources. To get started again you may wish to take a look at our guide for how to secure your Linux cloud server.

If you know you may need to reinstall the system again in the future, it may be more convenient to take a backup of the fresh install which can then be easily restored in moments. You can find out more about the feature in the guide for taking backups.

Editor-in-chief and Technical writer at UpCloud since 2015. Cloud enthusiast writing about server technology and software.

11 thoughts on “Reinstalling your server while keeping the IP addresses

    1. Hi there, thanks for the suggestion. While we haven’t seen that much demand for a one-click feature to reinstalling a cloud server, it is in the realm of possibility and we appreciate the feedback.

    1. Hi there, thanks for the comment. While the solution to reinstalling a cloud server currently requires some manual steps, it also allows additional freedom of changing the operating system, server plan and shrinking the storage.

      1. You deserve a cookie for that, nice feature on that side, but still, make it 2 cts per click 😉

  1. i don’t know why upcloud make reinstall so complicated. we are in 2020 with simple 1 click and automation, why i need reinstall and chose disk or whatever with same spec when i just want to change os from centos to ubuntu.

    if i need more resource, just upgrade or create new one rather than put them in very complicated reinstall process.

    1. Hi Yadi, thanks for the comment. It’s true the reinstallation process can be simplified with automation and there are a number of tools that could help you. For example, Terraform is an excellent infrastructure management tool that can accomplish exactly what you’re after with a single command. Have a look at our introductory tutorial on how to get started with Terraform.

  2. Honestly i never expected that much of steps to do a simple re-install.
    Would love to see reinitialize/re-install button like other providers..

  3. 95% love Upcloud platform. will be 100% when Upcloud release rebuild feature.

    Yep, there’s tools like terraform etc.
    but yeah, we need a simple way to rebuild the VPS WITHOUT adding any config like terraform. 🙂

    hopefully, rebuild feature will be release in 2021.

  4. I agree with Henry about that. Rebuild VPS just one click is easier for many users. I have been using UpCloud for a year. 97% Love Upcloud Platform.

Leave a Reply

Your email address will not be published. Required fields are marked *

Locations

Helsinki (HQ)

In the capital city of Finland, you will find our headquarters, and our first data centre. This is where we handle most of our development and innovation.

London

London was our second office to open, and a important step in introducing UpCloud to the world. Here our amazing staff can help you with both sales and support, in addition to host tons of interesting meetups.

Singapore

Singapore was our 3rd office to be opened, and enjoys one of most engaged and fastest growing user bases we have ever seen.

Seattle

Seattle is our 4th and latest office to be opened, and our way to reach out across the pond to our many users in the Americas.