Apply a Vultr Firewall group to secure a VX1™ Cloud Compute instance via Portal or API.
Vultr Firewall groups let you create rules that control and filter incoming network traffic to your instance. These rules define which ports, protocols, and services you allow or block, improving the security of your Vultr VX1™ Cloud Compute instance.
Follow this guide to enable a Vultr Firewall group on a Vultr VX1™ Cloud Compute instance using the Vultr Customer Portal, or API.
Send a GET request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET request to the List Firewall Groups endpoint and note the ID of the firewall group you want to apply.
$ curl "https://api.vultr.com/v2/firewalls" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH request to the Update Instance endpoint to attach a firewall group to the instance.
$ 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>"
}'
If successful, you receive a 200 HTTP response.