stop
The blocklet server stop command performs a graceful shutdown of the Blocklet Server, along with all running blocklets and associated services. This ensures that application state is preserved and processes are terminated in a clean, orderly fashion.
This command is the standard counterpart to blocklet server start.
Usage#
To stop the Blocklet Server, run the following command in your terminal:
blocklet server stop [options]Options#
Option | Description |
|---|---|
| Forcefully stops all server-related processes. This bypasses the graceful shutdown sequence and should be used if the server becomes unresponsive. |
Shutdown Process#
When blocklet server stop is executed without the --force flag, it follows a specific sequence to ensure a safe and complete shutdown. This process prevents data loss and ensures that dependent services are terminated correctly.
The typical shutdown flow is as follows:
A key initial step is checking for any blocklets running in development mode. If a development blocklet is active, the server cannot be stopped, and the CLI will instruct you to first terminate the development session (usually with Ctrl + C in the relevant terminal).
Force Stop#
Using the --force flag initiates an immediate and forceful shutdown. This method should only be used if the standard stop command fails or hangs. It does not follow the graceful shutdown sequence and instead directly terminates all related processes.
The force stop process includes:
- Clearing all server-level caches.
- Removing all router configurations managed by Blocklet Server.
- Killing all PM2 processes associated with any blocklets.
- Terminating the core PM2 daemon.
- Stopping any Docker containers managed by Blocklet Server.
Examples#
Standard Shutdown#
This is the recommended way to stop the server.
Command
blocklet server stopExample Output
i Sending shutdown notification to web dashboard users...
✔ Routing engine is stopped successfully
✔ Blocklet My-Blog is stopped successfully
✔ Blocklet Payment-Kit is stopped successfully
✔ blocklet-daemon is stopped successfully
✔ blocklet-service is stopped successfully
✔ blocklet-event-hub is stopped successfully
✔ Docker containers managed by blocklet server are stopped
✔ Done!Force Shutdown#
Use this command if the server is unresponsive.
Command
blocklet server stop --forceExample Output
✔ Cleared cache successfully
✔ Nginx router is stopped successfully
✔ All blocklet processes stopped successfully
✔ Docker containers managed by blocklet server are stoppedOnce the server is stopped, you can manage its state using other commands. To restart the server, see blocklet server start, or to check its current state, use blocklet server status.