Public IPs
A public IP is a dedicated IPv4 address reserved in one region. Attach it to any VM there, move it to another VM, and keep it until you release it. Every VM also gets free public IPv6, so you only need IPv4 for clients that can't reach you over IPv6.
How it works
- Reserved, not tied to a VM — the address belongs to your project until you release it.
- Mapped to a private address — attaching maps the public IPv4 one-to-one to a private IPv4 on the VM. The guest keeps using its private address; nothing changes inside the OS for the primary address.
- Regional — addresses move between VMs in the same region, not across regions.
- Several per VM — a VM can have more than one public IPv4. One of them is the VM's outbound address.
Pricing
$2.00/mo per address, billed per second while it's reserved — attached or not. Releasing the address stops the charge.
Get an address
When creating a VM
In the VM create form, under Public IPv4, choose:
- new address — reserve a new address and attach it to the VM.
- existing address — attach a detached reservation in the same region.
- no public IPv4 — the VM keeps its private IPv4 and its public IPv6. You can attach an address later.
Reserve one ahead of time
Networking → public IPs → Reserve public IP. Pick the region and an optional name. The address is yours immediately; attach it when you're ready.
Attach to a VM
Open the address on Networking → public IPs, choose the VM and the private IPv4 it should map to, and attach. You can also start from the VM: VM → networking → attach public ip. Attaching takes a short time to apply; the page shows when the address is active.
To give a VM a second public address for a different service, add a private IPv4 on the VM (VM → networking → add private ipv4), configure it in the guest OS, then map another public IP to it.
Outbound address
The first public IPv4 attached to a VM becomes its preferred outbound address — the source for new connections the VM makes to the internet. Replies to inbound connections always use the address the client connected to. With several addresses attached, open another attached address under Networking → public IPs and choose Use for outbound IPv4.
A VM without a public IPv4 still reaches the internet through shared NAT. Shared NAT addresses change and are shared with other customers, so don't put them in allowlists — attach a public IP if a remote service needs to recognise your VM.
Move or detach
Detach removes the address from its VM; it stays reserved (and billed) so you can attach it elsewhere in the region. If the address is the VM's preferred outbound address and the VM has other public IPv4s, you pick which one takes over before detaching.
Release
Release reservation gives a detached address back. Release can't be undone: the address may be assigned to another customer right away. Detach first, and wait for the detach to finish.
Inbound traffic
Inbound connections are denied until you add
firewall rules — including
SSH. Firewall rules can also forward a port on an attached address to a
different port on the VM, for example public 2222 to VM
22.
What's next
- Firewall rules — allow inbound traffic and set up port forwarding.
- Load balancers — one address in front of several VMs.
- Public IPv6 — the free routed /64 every VM gets.