# Port not freed on stopping the appium server 2.0.1

**URL:** <https://discuss.appium.io/t/port-not-freed-on-stopping-the-appium-server-2-0-1/39790>\
**Category:** Issues/Bugs\
**Created:** [July 27, 2023, 11:39am UTC](https://discuss.appium.io/t/port-not-freed-on-stopping-the-appium-server-2-0-1/39790 "2023-07-27T11:39:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![wreed](https://discuss.appium.io/letter_avatar_proxy/v4/letter/w/919ad9/32.png) [@wreed](https://discuss.appium.io/u/wreed)\
**Post date:** [July 28, 2023, 3:49pm UTC](https://discuss.appium.io/t/port-not-freed-on-stopping-the-appium-server-2-0-1/39790/4 "2023-07-28T15:49:57Z")

</div>

> [@Aditya\_Anand2](#):
>
> is there any simplified way to shut down the server and restart the server without killing a process using port number?

Sure, here are a number of ways to do so:

control + c  
pkill -9 -f appium  
killall -KILL node

You may eventually find it easier to stop the Appium server from your code. This is a good place to find such info:

> [@Launching and stopping appium server programmtically](https://discuss.appium.io/t/launching-and-stopping-appium-server-programmtically/700/2):
>
> [Update] For a complete updated guide with code example, please refer to [this](https://www.linkedin.com/pulse/startstop-appium-server-programmatically-using-java-hassan-radi). @karthik_holla I am gonna use Java and Windows to help explain that to you, you can use the equivalent of that in your preferred language/OS: To start Appium server programmatically, you need the following: Command executor tool (I prefer the second approach as it will handle most of the OS specific problems on your behalf): Java’s built-in [Process](http://docs.oracle.com/javase/7/docs/api/java/lang/Process.html) class. [Apache Commons Exec](http://commons.apache.org/proper/commons-exec/). Tell the tool what program you n…

---

_[View the full topic](https://discuss.appium.io/t/port-not-freed-on-stopping-the-appium-server-2-0-1/39790)._
