---
title: "POST /swarm/init"
method: POST
path: "/swarm/init"
---

# POST /swarm/init

`POST /swarm/init`

Initialize a new swarm

## Request body

- object
  - `ListenAddr` string
  - `AdvertiseAddr` string
  - `DataPathAddr` string
  - `DataPathPort` integer
  - `DefaultAddrPool` string[]
  - `ForceNewCluster` boolean
  - `SubnetSize` integer
  - `Spec` SwarmSpec — User modifiable swarm configuration.
    - `Name` string — Name of the swarm.
    - `Labels` object — User-defined key/value metadata.
    - `Orchestration` object, nullable — Orchestration configuration.
      - `TaskHistoryRetentionLimit` integer
    - `Raft` object — Raft configuration.
      - `SnapshotInterval` integer
      - `KeepOldSnapshots` integer
      - `LogEntriesForSlowFollowers` integer
      - `ElectionTick` integer
      - `HeartbeatTick` integer
    - `Dispatcher` object, nullable — Dispatcher configuration.
      - `HeartbeatPeriod` integer
    - `CAConfig` object, nullable — CA configuration.
      - `NodeCertExpiry` integer
      - `ExternalCAs` object[]
        - `Protocol` 'cfssl'
        - `URL` string
        - `Options` object
        - `CACert` string
      - `SigningCACert` string
      - `SigningCAKey` string
      - `ForceRotate` integer
    - `EncryptionConfig` object — Parameters related to encryption-at-rest.
      - `AutoLockManagers` boolean
    - `TaskDefaults` object — Defaults for creating tasks in this cluster.
      - `LogDriver` object
        - `Name` string
        - `Options` object

## Response `200`

The request has succeeded.

---

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