Skip to main content
A sitectl context points to a site running either on your local machine or on a remote server over SSH. You can have many contexts and switch between them with use-context. See the context concept page for a full explanation.

config

A sitectl config can have multiple contexts. A sitectl context is a docker compose site running somewhere. “Somewhere” meaning:
  • on your laptop (--type local)
  • on a remote server (--type remote).
Remote contexts require SSH access to the remote server from where sitectl is being ran from. When creating a context the remote server DNS name, SSH port, SSH username, and the path to your SSH private key will need to be set in the context configuration. You can have a default context which will be used when running sitectl commands, unless the context is overridden with the --context flag.
sitectl config <command>

current-context

Display the current site context
sitectl config current-context

get-contexts

List all site contexts
sitectl config get-contexts

get-environments

List environments grouped by site
sitectl config get-environments [site]

get-sites

List configured sites and their environments
sitectl config get-sites

set-context

Set or update properties of a context. Creates a new context if it does not exist.
sitectl config set-context [context-name]
FlagDefaultDescription
-f, --compose-file[]docker compose file paths to use (equivalent to docker compose -f flag). Multiple files can be specified.
--compose-networkPrimary Docker Compose network name for this environment
--compose-project-nameDocker Compose project name, matching COMPOSE_PROJECT_NAME or compose name:
--database-namedrupal_defaultName of the database to connect to (e.g. drupal_default)
--database-password-secretDB_ROOT_PASSWORDName of the docker compose secret containing the database password
--database-servicemariadbName of the database service in Docker Compose
--database-userrootDatabase user to connect as (e.g. root, admin)
--defaultfalseset to default context
--docker-socket/var/run/docker.sockPath to Docker socket
--env-file[]when running remote docker commands, the --env-file paths to pass to docker compose
--environmentEnvironment name for this context, such as local, dev, staging, or prod
--plugincoreOwning plugin identifier for this context, such as core, isle, or drupal
--project-dirPath to docker compose project directory
--project-namedocker-composeLogical project name for this context
--siteLogical site name this context belongs to
--ssh-hostnameRemote contexts DNS name for the host.
--ssh-keyPath to SSH private key for remote context. e.g. /home/node/.ssh/id_rsa
--ssh-port2222Port number
--ssh-userSSH user for remote context
--sudofalsefor remote contexts, run docker commands as sudo
--typelocalType of context: local or remote

use-context

Switch to the specified context
sitectl config use-context [context-name]

delete-context

Delete a site context
sitectl config delete-context [context-name]

validate

Validate sitectl context configuration and access
sitectl config validate [context-name]
FlagDefaultDescription
--allfalseValidate all configured contexts
--formatsectionReport output format: section, table, json, or yaml
--siteValidate all contexts for a specific site

view

Print your sitectl config
sitectl config view