Skip to Content
CLI Referencenkapp restart

nkapp restart

Restart running services.

nkapp restart [services...] [options]

Arguments

ArgumentTypeDescription
servicesstring[]Optional list of service names to restart. If omitted, restarts all services.

Options

FlagTypeDefaultDescription
-e, --env <env>stringlocalTarget environment

Under the Hood

The restart command performs a safe restart depending on the target infrastructure provider:

  • Docker (Local/Remote SSH): Performs a native Docker restart (container.restart()), which is extremely fast and preserves container configurations.
  • AWS (ECS/EC2): Performs an EC2 instance reboot or triggers an ECS forceNewDeployment for zero-downtime microservice rolling updates.
  • Fallback: If the provider does not support native restarts, Nanokit falls back to performing a sequential stop followed by a start on the target containers.

Examples

# Restart all services in the local environment nkapp restart # Restart specific microservices nkapp restart api-auth api-gateway # Restart staging services nkapp restart -e stage

[!NOTE] Like nkapp start, the restart command only operates on existing containers. If you have modified service configurations (like environment variables or ports in nanokit.yml), use nkapp up instead to apply changes and recreate the containers.