Logo

dev-resources.site

for different kinds of informations.

Can I start and stop Docker Desktop using CLI?

Published at
1/13/2025
Categories
docker
container
developer
cli
Author
ajeetraina
Categories
4 categories in total
docker
open
container
open
developer
open
cli
open
Author
10 person written this
ajeetraina
open
Can I start and stop Docker Desktop using CLI?

Docker Desktop version 4.37 and later introduces the Docker Desktop CLI, a powerful tool that allows developers to manage key Docker Desktop operations directly from the command line. This addition significantly enhances automation capabilities and streamlines the developer experience, particularly for those working with CI/CD pipelines.

In this blog, we'll explore the Docker Desktop CLI, covering its key features and demonstrating how to use its commands effectively.

Getting Started

Ensure you have Docker Desktop version 4.37 or later installed to access the Docker Desktop CLI.

Checking the CLI version

PS C:\Users\ajeet>docker desktop version
Docker Desktop CLI version: v0.1.1
Enter fullscreen mode Exit fullscreen mode

Listing the key Commands

Usage:  docker desktop COMMAND

Docker Desktop commands (Beta)

Management Commands:
  engine      Manage Docker Desktop engine
  module      Manage Docker Desktop modules (Alpha)

Commands:
  restart     Restart Docker Desktop
  start       Start Docker Desktop
  status      Show the status of the Docker Desktop engines
  stop        Stop Docker Desktop
  version     Show the Docker Desktop version information
Enter fullscreen mode Exit fullscreen mode

Management Commands

docker desktop engine --help

Usage:  docker desktop engine COMMAND

Manage Docker Desktop engine

Commands:
  ls          List all supported engine modes
  use         Set the current Docker Desktop engine mode

Run 'docker desktop engine COMMAND --help' for more information on a command.
Enter fullscreen mode Exit fullscreen mode

Below are the primary commands provided by the Docker Desktop CLI and their use cases.

Start Docker Desktop

Start Docker Desktop from the command line:

docker desktop start
Enter fullscreen mode Exit fullscreen mode

This command initializes Docker Desktop, bringing the platform online for containerized application development.

Check the status

PS C:\Users\ajeet> docker desktop status
Name                Value
Status              running
SessionID           219544ec-00fe-4f47-9032-f48d7c520747
PS C:\Users\ajeet>
Enter fullscreen mode Exit fullscreen mode

List all supported engine modes

PS C:\Users\ajeet> docker desktop engine ls
Name                Description
linux *             Linux engine
windows             Windows engine
PS C:\Users\ajeet>
Enter fullscreen mode Exit fullscreen mode

Switching the Engine

PS C:\Users\ajeet> docker desktop engine use windows
Current engine is now "windows"
Enter fullscreen mode Exit fullscreen mode

Switch back to Linux

PS C:\Users\ajeet> docker desktop engine use linux
Current engine is now "linux"
Enter fullscreen mode Exit fullscreen mode

Restart Docker Desktop

Restart Docker Desktop to refresh the environment or apply configuration changes:

docker desktop restart
Enter fullscreen mode Exit fullscreen mode

This command is useful for troubleshooting or reloading Docker Desktop after updates.

Check Docker Desktop Status

Monitor the current status of Docker Desktop:

docker desktop status
Enter fullscreen mode Exit fullscreen mode

This command outputs the operational state of Docker Desktop, such as whether it is running or stopped.

CLI to Manage Docker Desktop modules

docker desktop module

Usage:  docker desktop module COMMAND

Manage Docker Desktop modules (Alpha)

Commands:
  ls          List modules
  reset       Reset all updated modules
  update      Update all modules

Run 'docker desktop module COMMAND --help' for more information on a command.
PS C:\Users\ajeet>
Enter fullscreen mode Exit fullscreen mode
PS C:\Users\ajeet>

docker desktop module ls
ID                  TYPE                LATEST VERSION      CURRENT VERSION
ai                  cli-plugin          v0.3.6              v0.5.13
compose             cli-plugin          v2.31.0-desktop.2   v2.32.2-desktop.1
desktop             cli-plugin          v0.1.1              v0.1.1
scout               cli-plugin          v1.16.1             v1.16.1
PS C:\Users\ajeet>
Enter fullscreen mode Exit fullscreen mode

Update all the Docker Desktop Modules

docker desktop module update
โœ“ Checking module updates
โœ“ Everything is up to date
PS C:\Users\ajeet>
Enter fullscreen mode Exit fullscreen mode

Stop Docker Desktop

Shut down Docker Desktop when not in use:

docker desktop stop
Enter fullscreen mode Exit fullscreen mode

Conclusion

The Docker Desktop CLI empowers developers with more control and automation, making it an essential tool for modern containerized application workflows. Whether you're optimizing CI/CD pipelines or enhancing your local development environment, these commands provide the flexibility and efficiency you need.

Upgrade to Docker Desktop 4.37 or later and start leveraging the Docker Desktop CLI today!

cli Article's
30 articles in total
Favicon
RAG - Creating the SQLite database and config file
Favicon
Simplifying API Routes in Next.js with next-api-gen
Favicon
Modernizing HyperGraph's CLI: A Journey Towards Better Architecture
Favicon
Making Python CLIs More Maintainable: A Journey with Dynamic Command Loading
Favicon
Making Your CLI Applications Pop with Styled Outputs
Favicon
Makefile
Favicon
Can I start and stop Docker Desktop using CLI?
Favicon
How to Install and Run Redis Directly on macOS (Without Homebrew)
Favicon
From iTerm To WezTerm
Favicon
RAG - Designing the CLI interface
Favicon
Configuring Cisco firewall in Linux machine with Minicom
Favicon
KillPy: The Tool to Clean Up Your Python Virtual Environments ๐Ÿงน๐Ÿ
Favicon
Ubuntu Linux Commands Categorized
Favicon
Rust-Powered Password Decrypter: Find the String Behind the Hash! ๐Ÿฆ€๐Ÿ”’
Favicon
Mastering Vim and NvChad for Coding and Development: A Comprehensive Guide
Favicon
The Ultimate Cheat Sheet: CLI Man Pages, tldr, and cheat.sh
Favicon
Git Command Line Mastery: 10 Essential Commands for Version Control Using Git
Favicon
Building My First NPM Package: A CLI for Scaffolding Express Servers
Favicon
.NET Development Essentials on macOS with VS Code
Favicon
How to Configure AWS CLI on Linux
Favicon
Building a GitHub Activity CLI - A Ruby Journey
Favicon
Enhanced CIDR Block Calculator with Expanded Input Formats in Go
Favicon
using cat printer on linux
Favicon
Task Tracker CLI
Favicon
Context Dump: Simplifying AI File Preparation
Favicon
MyTask ToDo CLI Tool...
Favicon
I made wut โ€“ a CLI that explains your last command with an LLM
Favicon
Magento 2 commands for maintenance and deployment
Favicon
Rusty Journal: A Minimal and Efficient CLI Journal & ToDo App
Favicon
[Boost]

Featured ones: