---
title: 'Change Your Server''s IPv4 Address'
description: 'Buy a floating IPv4, make it primary and cancel the old address when you no longer need it.'
icon: 'network-wired'
---

## Overview

You can change a virtual server's primary IPv4 yourself. Buy a floating IPv4 in the same city, attach it to the server, then choose `Set as Primary`. You do not need to reinstall the server or open a ticket for a normal IP change.

The addresses swap roles: the new address becomes the server's primary, and the old primary becomes your rented floating IP.

<Warning>
  Plan for a connection interruption. Keep `VNC` open and save your work before changing the primary address. Applications, DNS records and access rules that name the old IP may need updating.
</Warning>

## Change the address

<Steps>
  <Step title="Buy a floating IPv4">
    Select the team that owns the server. Open "Cloud" > "Floating IPs" and click `Buy Floating IP`. Choose the server's city and `IPv4`, review the price and click `Buy address`. Wait until the address is active.

    Prepaid teams pay from account credit. Postpaid teams add the rental to their monthly invoice. Use the price shown in the dialog.
  </Step>
  <Step title="Attach it to the server">
    Open the new address's row menu, choose `Attach`, select the server and confirm. Wait until it is attached. You can also buy and attach an address from the server's "Networking" tab.
  </Step>
  <Step title="Make it primary">
    Open the server's "Networking" tab. Find the new IPv4, open its row menu and choose `Set as Primary`.

    ![New floating IPv4 with Set as Primary in its row menu](/images/ipchange/set-primary.png)
  </Step>
  <Step title="Confirm the swap">
    Check the address in the dialog, then click `Confirm`. Wait for the network settings to update. The panel tries to apply the change inside a running server; if it does not take effect, restart the server and check again. Custom operating system configurations may need manual changes through VNC.

    ![Set Primary Address confirmation explaining the address swap](/images/ipchange/confirm-primary.png)
  </Step>
  <Step title="Test the new address">
    Connect to the new primary IP. Update DNS, VPN endpoints, application bindings, monitoring and any allowlists that used the old IP. Check both incoming and outgoing connections before removing the old address.
  </Step>
</Steps>

You can also start the swap from "Floating IPs": open the attached IPv4's menu and choose `Swap with Primary`.

## Stop paying for the old address

After the swap, the floating IP rental holds your **old** primary address. It stays attached and billed until you cancel it.

| Before the swap | After the swap |
| --- | --- |
| Server primary: `203.0.113.122` | Server primary: `192.0.2.77` |
| Rented floating IP: `192.0.2.77` | Rented floating IP: `203.0.113.122` |

If you no longer need the old address, find it in "Floating IPs", open `Manage billing` and use the cancellation option. Choose immediate cancellation if you want to release it now. Postpaid cancellations are immediate; usage already incurred still has to be paid.

**Detaching an address does not stop its rental charges.** Cancel it after you have tested the new address and moved everything that uses the old one.

<Danger>
  A cancelled address returns to the pool and may be assigned to someone else. You cannot count on getting it back. Check the address carefully before confirming.
</Danger>

## If an option is missing

- Only IPv4 can be primary. An IPv6 address cannot be selected.
- The floating IP must be active, attached and finished with any other operation. Withdraw a pending cancellation before trying to swap it.
- Wait for an upgrade, reinstall or other server operation to finish.
- Team members need the relevant networking permissions. Buying and cancelling an address also needs purchase permission.

If your quota is full, check [Resource Quotas](/guides/resource-quotas). If the change fails, send the exact error in a [support ticket](/guides/support-tickets).

A replacement address is not guaranteed to come from a different range or work with a particular website, ISP or geolocation database. See [IP location and blocking](/information/geoblocking).
