Skip to main content
POST
Create Environment

Description

Creates a new Docker environment with the specified configuration. Supports four connection types: local Unix socket, direct TCP connection, Hawser Standard (HTTP proxy), and Hawser Edge (WebSocket reverse proxy).

Authentication

Requires environments:create permission when authentication is enabled.

Request Body

string
required
Unique display name for the environment
string
default:"socket"
Type of Docker connection:
  • socket - Local Unix socket
  • direct - Direct TCP connection to Docker API
  • hawser-standard - HTTP proxy via Hawser agent
  • hawser-edge - WebSocket reverse proxy via Hawser agent

Connection Parameters

string
Hostname or IP address (required for direct and hawser-standard types)
number
default:"2375"
Port number for Docker API connection
string
default:"http"
Connection protocol: http or https
string
default:"/var/run/docker.sock"
Unix socket path (used when connectionType is socket)

TLS Configuration

string
TLS Certificate Authority (CA) certificate in PEM format. Required for self-signed certificates.Format: Multi-line PEM string with BEGIN/END markers
string
TLS client certificate in PEM format for mutual TLS authentication.Format: Multi-line PEM string with BEGIN/END markers
string
TLS client private key in PEM format for mutual TLS authentication.Format: Multi-line PEM string with BEGIN/END markers
boolean
default:"false"
Skip TLS certificate verification. Warning: Insecure, not recommended for production use.

Hawser Configuration

string
Authentication token for hawser-standard connections. Must match the token configured on the Hawser agent.

Display Options

string
default:"globe"
Icon identifier for UI display
string[]
Array of label strings for categorization (maximum 10 labels)

Collection Settings

boolean
default:"true"
Enable collection of container activity events
boolean
default:"true"
Enable collection of host metrics (CPU, memory)
boolean
default:"true"
Highlight recent changes in the UI

Network Information

string
Public IP address of the environment host

Response

Returns the created environment object with all fields populated.
number
Unique identifier for the newly created environment
string
Name of the environment
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update

Example Requests

Local Socket Connection

Direct Connection with TLS

Direct Connection with Self-Signed Certificate

Hawser Standard Connection

Hawser Edge Connection

Example Response

Error Responses

object
Invalid request dataMissing name:
Missing host for direct/hawser-standard:
object
User lacks environments:create permission
object
Environment name already exists
object
Failed to create environment

Notes

  • Environment names must be unique
  • In Enterprise mode, the creator is automatically assigned the Admin role for the new environment
  • PEM certificates are automatically cleaned (whitespace trimmed) before storage
  • Labels are limited to a maximum of 10 per environment
  • After creation, subprocess collectors are notified to begin monitoring the new environment
  • For hawser-edge connections, the environment is created but remains inactive until an agent connects