dfx stop

Use the dfx stop command to stop the Internet Computer processes that you currently have running on your local computer. In most cases, you run the Internet Computer locally so that you can deploy canisters and test your programs during development. To simulate an external Internet Computer connection, these processes run continuously either in a terminal shell where you started them or the in the background until you stop or kill them.

Note that you can only run this command from within the project directory structure. For example, if your project name is hello_world, your current working directory must be the hello_world top-level project directory or one of its subdirectories.

Basic usage

dfx stop [flag]


You can use the following optional flags with the dfx stop command.

Flag Description

-h, --help

Displays usage information.

-V, --version

Displays version information.


You can stop the Internet Computer network processes that are running in the background by changing to a project directory then running the following command:

dfx stop

If the local Internet Computer network is running in a current shell rather than in the background, open a new terminal shell, change to a project directory, then run the dfx stop command.

The current process identifier (pid) for the Internet Computer process started by dfx is recorded in the .dfx/pid file. You can view the process identifier before running the dfx stop command by running the following command:

more .dfx/pid

This command displays a process identifier similar to the following: