Node.js is widely used for running dynamic applications on cPanel-based hosting environments. Usually, deleting a Node.js app in cPanel is straightforward — you simply click the trash can icon next to the application in the Setup Node.js App section.
However, sometimes this process does not work smoothly. You might see an error or the app may remain even after attempting to remove it. This usually happens when the Node.js application hangs in the background, preventing cPanel from removing it.
Unfortunately, cPanel itself does not provide a force close feature for stuck Node.js apps. But don’t worry — you can solve this issue easily using cPanel Terminal.
Step-by-Step Guide: Forcing Node.js App Deletion via Terminal
1. Access Terminal from cPanel
- Log in to your cPanel.
- Search for “Terminal” in the search bar and open it.
- You will now be in a command-line interface.
2. List Running Processes
- Type the following command and press Enter:
top
- This will show you a list of running processes on your account.
3. Find the Node.js Process
- Look for processes labeled node.
- Each process will have a PID (Process ID) next to it.
- Example: you may see something like
node 9296
. Here, 9296 is the PID.How to Delete Node.js Applications in cPanel
4. Exit the Process Viewer
- To exit the
top
command, press the q key on your keyboard.
5. Kill the Node.js Process
- Now type the following command, replacing
PID
with the actual number you found earlier:kill 9296
- This will forcefully stop the Node.js process that was hanging.
How to Delete Node.js Applications in cPanel
6. Delete the Application in cPanel
- Go back to Setup Node.js App in cPanel.
- Click the trash can icon next to the application.
- This time, the deletion should work without errors. ✅
How to Delete Node.js Applications in cPanel
Why This Works
When a Node.js application hangs, its process keeps running in the background. cPanel cannot delete the app because the process is still active. By manually killing the process through the Terminal, you free up the resources and allow cPanel to successfully remove the application.
Final Thoughts
If you ever encounter issues deleting a Node.js application in cPanel, don’t panic. A quick check in Terminal and killing the Node.js process usually solves the problem.
Just remember:
- Always check the correct PID before running the
kill
command. - If you are unsure, ask your hosting provider’s support team to assist.
With these steps, you can easily manage and delete any stuck Node.js applications in cPanel. 🚀