---
title: VPC 2.0
url: https://docs.vultr.com/products/compute/instances/optimized-cloud-compute/networking/vpc-2
description: A private network solution that allows secure communication between Vultr resources in isolated environments.
publish_date: 2024-09-23T20:19:43.851235Z
last_updated: 2026-05-26T18:45:45.034891Z
---

# How to Attach a VPC 2.0 Network to a Vultr Optimized Cloud Compute Instance

A Virtual Private Cloud (VPC) 2.0 network creates a secure and isolated private networking interface to enable connections to other instances attached to the same network. You can attach multiple VPC 2.0 networks to enable secure connections between a Vultr Optimized Cloud Compute instance and other instances attached to the same VPC 2.0 network.

Follow this guide to attach a VPC 2.0 network to a Vultr Optimized Cloud Compute instance using the Vultr Console, API, CLI or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and click **Compute**.
    1. Click your target Vultr Optimized Cloud Compute instance to open its management page.
    1. Navigate to the **Settings** tab.
    1. Click **VPC 2.0** on the left navigation menu.    
    1. Click **Enable VPC 2.0** to activate a new VPC 2.0 network interface.
    1. Click **Enable VPC 2.0** in the confirmation prompt to apply the changes.
    1. Click the **VPC 2.0** drop-down to select a specific network and click **Attach** to apply the changes on your instance.

=== "Vultr API"

    1. Send a `GET` request to the [**List Instances** endpoint](https://www.vultr.com/api/#tag/instances/operation/list-instances) and note your target instance's ID.

        ```console
        $ curl "https://api.vultr.com/v2/instances" \
          -X GET \
          -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `GET` request to the [**List Instance VPC 2.0 Networks** endpoint](https://www.vultr.com/api/#tag/VPC2/operation/list-vpc2) to list all VPC 2.0 networks in your Vultr account and note the target VPC 2.0 network's ID.

        ```console
        $ curl "https://api.vultr.com/v2/vpc2" \
          -X GET \
          -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `POST` request to the [**Attach VPC 2.0 to Instance** endpoint](https://www.vultr.com/api/#tag/instances/operation/attach-instance-vpc2) to attach a VPC 2.0 network to the instance.

        ```console
        $ curl "https://api.vultr.com/v2/instances/{instance-id}/vpc2/attach" \
          -X POST \
          -H "Authorization: Bearer ${VULTR_API_KEY}" \
          -H "Content-Type: application/json" \
          --data '{
            "vpc_id": "<vpc2-id>"
          }'
        ```

=== "Vultr CLI"

    1. List all available instances and note your target instance's ID.

        ```console
        $ vultr-cli instance list
        ```

    1. List all available VPC 2.0 networks and note the target VPC 2.0 network ID.

        ```console
        $ vultr-cli vpc2 list
        ```

    1. Attach the VPC 2.0 network to the instance.

        ```console
        $ vultr-cli vpc2 nodes attach <vpc2-id> \
                --nodes="<instance-id>"
        ```

=== "Terraform"

    1. Open your Terraform configuration for the existing Optimized Cloud Compute instance.

    1. Create (or reference) a VPC 2.0 network and attach it to the instance.

        ```terraform
        # Create a VPC 2.0 network
        resource "vultr_vpc2" "app_net" {
            region      = "del"
            description = "Private network for OCC workloads"
        }

        # Attach the VPC 2.0 network to the Optimized Cloud Compute instance
        resource "vultr_instance" "occ" {
            label    = "occ-01"
            region   = "del"
            plan     = "vhp-2c-4gb"
            os_id    = 2284
            hostname = "occ-01"

            vpc2_ids = [vultr_vpc2.app_net.id]
        }
        ```

    1. Apply the configuration and observe the following output:

        ```
        Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
        ```
