---
title: "Create a network"
method: POST
path: "/networks/create"
tags: ["Network"]
---

# Create a network

`POST /networks/create`

## Request body

- object
  - `Name` string, required — The network's name.
  - `Driver` string — Name of the network driver plugin to use.
  - `Scope` string — The level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level).
  - `Internal` boolean — Restrict external access to the network.
  - `Attachable` boolean — Globally scoped network is manually attachable by regular containers from workers in swarm mode.
  - `Ingress` boolean — Ingress network is the network which provides the routing-mesh in swarm mode.
  - `ConfigOnly` boolean — Creates a config-only network. Config-only networks are placeholder networks for network configurations to be used by other networks. Config-only networks cannot be used directly to run containers or services.
  - `ConfigFrom` ConfigReference — The config-only network source to provide the configuration for this network.
    - `Network` string — The name of the config-only network that provides the network's configuration. The specified network must be an existing config-only network. Only network names are allowed, not network IDs.
  - `IPAM` IPAM
    - `Driver` string — Name of the IPAM driver to use.
    - `Config` IPAMConfig[] — List of IPAM configuration options, specified as a map: ``` {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} ```
      - `Subnet` string
      - `IPRange` string
      - `Gateway` string
      - `AuxiliaryAddresses` object
    - `Options` object — Driver-specific options, specified as a map.
  - `EnableIPv4` boolean — Enable IPv4 on the network.
  - `EnableIPv6` boolean — Enable IPv6 on the network.
  - `Options` object — Network specific options to be used by the drivers.
  - `Labels` object — User-defined key/value metadata.

## Response `201`

Network created successfully

- NetworkCreateResponse — OK response to NetworkCreate operation
  - `Id` string, required — The ID of the created network.
  - `Warning` string, required — Warnings encountered when creating the container

## Other responses

- `400` — bad parameter
- `403` — Forbidden operation. This happens when trying to create a network named after a pre-defined network, or when trying to create an overlay network on a daemon which is not part of a Swarm cluster.
- `404` — plugin not found
- `500` — Server error

---

[API](https://skmtc.net/nhost/apis/docker-engine-api.md) · [All operations](https://skmtc.net/nhost/apis/docker-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhost/docker-engine-api/versions/2b8dc7a7cc52/schema)
