---
title: "ezgh compute firewalls create"
description: "Create a firewall."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh compute firewalls create

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh compute firewalls create <name> [--description d] [-f rules.json|--no-rules] [--tag k=v…] [flags]
```

Create a firewall. Without -f it gets two rules allowing all outbound traffic (IPv4 and IPv6); -f gives its rules instead (a file, or - for stdin: a JSON array of rules, or an object with "rules"), and `--no-rules` none. Inbound traffic is denied unless a rule allows it.

A rule is &#123;"direction": "inbound"\|"outbound", "protocol": "tcp"\|"udp"\|"icmp"\|"icmpv6"\|"all"\|&lt;number&gt;, "ports": &#123;"from": 22, "to": 22&#125;, "icmp": &#123;"type": 8, "code": null&#125;, "peer": &#123;"cidr": "0.0.0.0/0"&#125; or &#123;"firewallId": "fwl\_…"&#125;, "description": "…"&#125;; ports and icmp are optional (every one).

Part of [`ezgh compute firewalls`](/cli/reference/compute-firewalls).

## Examples

```sh
ezgh compute firewalls create web
ezgh compute firewalls create db --no-rules
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--description` | string |  | what it's for |
| `-f`, `--file` | string |  | its rules: a JSON file, or - for stdin |
| `--no-rules` | boolean |  | no rules at all (not even outbound) |
| `--tag` | string, repeatable |  | a tag, key=value (repeat) |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/compute-firewalls-create/index.mdx
