How to Enable a Vultr Firewall Group on a Vultr Cloud Compute Instance

Updated on November 27, 2024

Vultr Firewall groups enable the creation of firewall rules to filter incoming traffic on an instance's public network interface. Firewall rules consist of IPv4 or IPv6 port and service definitons to filter network traffic.

Follow this guide to enable a Vultr Firewall group on a Vultr Cloud Compute instance using the Vultr Customer Portal, API, or CLI.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  1. Navigate to Products and click Compute.

    Vultr Customer Portal

  2. Click your target instance to open its management page.

    View active instance subscriptions

  3. Navigate to the Settings tab.

    Navigate to the Settings Tab

  4. Click Firewall on the left navigation menu.

    Select Firewall from the menu options

  5. Click the Firewall drop-down to select a new firewall group.

  6. Click Update Firewall Group to apply changes on the instance.

    Update Firewall group

  1. Send a GET request to the List Instances endpoint and note the target instance's ID in your output.

    console
    $ curl "https://api.vultr.com/v2/instances" \
      -X GET \
      -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a GET request to the List Firewall Groups endpoint to list all firewall groups in your Vultr account.

    console
    $ curl "https://api.vultr.com/v2/firewalls" \
      -X GET \
      -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  3. Send a PATCH request to the Update Instance endpoint to attach a firewall group to the instance.

    console
    $ curl "https://api.vultr.com/v2/instances/{instance-id}" \
      -X PATCH \
      -H "Authorization: Bearer ${VULTR_API_KEY}" \
      -H "Content-Type: application/json" \
      --data '{
        "firewall_group_id" : "<firewall-id>",
      }'
    
  1. List all Firewall groups in your Vultr account and note the target firewall group's ID.

    console
    $ vultr-cli firewall group list
    
  2. List all instances in your Vultr account and note the target instance's ID.

    console
    $ vultr-cli instance list
    
  3. Attach the firewall group to the instance.

    console
    $ vultr-cli instance update-firewall-group --instance-id <instance-id> --firewall-group-id <firewall-id>