---
title: VPC
url: https://docs.vultr.com/products/compute/instances/cloud-compute/networking/vpc
description: A private network solution that allows secure communication between Vultr resources without using public internet connections.
publish_date: 2024-09-23T20:19:59.111969Z
last_updated: 2026-05-26T18:43:14.073711Z
---

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

A Virtual Private Cloud (VPC) 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 Cloud Compute instance and other instances attached to the same VPC network.

Follow this guide to attach a VPC network to a Vultr 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 Cloud Compute instance to open its management page.
    1. Navigate to the **Settings** tab.
    1. Click **IPv4** on the left navigation menu.
    1. Click **Enable VPC**.
    1. Click **Enable VPC** in the confirmation prompt to apply the changes.
    1. Click **Attach VPC** in the confirmation prompt to apply changes to 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 VPCs** endpoint](https://www.vultr.com/api/#tag/VPCs/operation/list-vpcs) to list all available VPCs and note the target VPC network ID.

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

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

        ```console
        $ curl "https://api.vultr.com/v2/instances/{instance-id}/vpcs/attach" \
          -X POST \
          -H "Authorization: Bearer ${VULTR_API_KEY}" \
          -H "Content-Type: application/json" \
          --data '{
            "vpc_id": "<vpc-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 networks and note the target VPC network ID.

        ```console
        $ vultr-cli vpc list
        ```

    1. Attach the VPC network to the instance.

        ```console
        $ vultr-cli instance vpc attach <instance-id> <vpc-id>
        ```

=== "Terraform"

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

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

        ```terraform
        # Create a new VPC network
        resource "vultr_vpc" "private_net" {
            region      = "del"
            description = "Private network for CC workloads"
        }

        # Attach the VPC network to the Cloud Compute instance
        resource "vultr_instance" "cc" {
            # ...existing fields (region, plan, os_id, label, etc.)
            label     = "cc-instance-1"
            region    = "del"
            plan      = "vc2-2c-4gb"
            os_id     = 2284
            vpc_ids  = [vultr_vpc.private_net.id]
        }
        ```

    1. Apply the configuration and observe the following output:

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