<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jawad Khan</title>
    <description>The latest articles on DEV Community by Jawad Khan (@jawad_khan_9d0867c7ceb47e).</description>
    <link>https://dev.to/jawad_khan_9d0867c7ceb47e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3835841%2F6e4788b1-c5be-43cb-bcce-062723400bbb.jpg</url>
      <title>DEV Community: Jawad Khan</title>
      <link>https://dev.to/jawad_khan_9d0867c7ceb47e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jawad_khan_9d0867c7ceb47e"/>
    <language>en</language>
    <item>
      <title>I Built LocalhostKiller to Solve Port Conflicts</title>
      <dc:creator>Jawad Khan</dc:creator>
      <pubDate>Fri, 20 Mar 2026 17:08:49 +0000</pubDate>
      <link>https://dev.to/jawad_khan_9d0867c7ceb47e/i-built-localhostkiller-to-solve-port-conflicts-54cp</link>
      <guid>https://dev.to/jawad_khan_9d0867c7ceb47e/i-built-localhostkiller-to-solve-port-conflicts-54cp</guid>
      <description>&lt;p&gt;Every developer knows the frustration: you're ready to test your latest project, you run &lt;code&gt;npm start&lt;/code&gt;, and then—&lt;strong&gt;Error: Port 3000 is already in use&lt;/strong&gt;. You know you have something running on that port, but finding and killing it is a tedious dance of &lt;code&gt;lsof&lt;/code&gt;, &lt;code&gt;ps&lt;/code&gt;, and &lt;code&gt;kill&lt;/code&gt; commands.&lt;/p&gt;

&lt;p&gt;I got tired of this. So I built &lt;strong&gt;LocalhostKiller&lt;/strong&gt;—a dead-simple CLI tool to instantly identify and terminate processes hogging your local ports.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Port conflicts are deceptively annoying. They interrupt your flow, waste minutes on busywork, and force you to context-switch just to clean up a zombie process. Whether it's a crashed Node.js server, a lingering Docker container, or that Python script you forgot about, these orphaned processes accumulate and become friction in your development workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;LocalhostKiller is a zero-config CLI that does one thing well: &lt;strong&gt;find and kill processes by port number&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;localhostkiller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or install from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/codebyjawad/localhostkiller.git
&lt;span class="nb"&gt;cd &lt;/span&gt;localhostkiller
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Interactive Mode
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lhk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select processes from a menu and kill them interactively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kill by Port
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lhk 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instantly kill whatever is running on port 3000.&lt;/p&gt;

&lt;h3&gt;
  
  
  List All Ports
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lhk &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See everything running on localhost.&lt;/p&gt;

&lt;p&gt;That's it. No flags to remember, no multi-step process hunting.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Under the hood, LocalhostKiller:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scans the specified port across all network interfaces&lt;/li&gt;
&lt;li&gt;Identifies the process ID (PID) bound to that port&lt;/li&gt;
&lt;li&gt;Gracefully terminates the process (with force-kill fallback)&lt;/li&gt;
&lt;li&gt;Confirms the port is now free&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It handles the cross-platform quirks so you don't have to—whether you're on macOS, Linux, or Windows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built It
&lt;/h2&gt;

&lt;p&gt;I wanted something &lt;strong&gt;faster than Stack Overflow&lt;/strong&gt;. Sure, you can memorize the &lt;code&gt;lsof -ti:3000 | xargs kill -9&lt;/code&gt; incantation, but that's not the point. Developer tools should reduce cognitive load, not add to it. LocalhostKiller is my contribution to that philosophy: a tiny utility that removes one small friction point from the development experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get It
&lt;/h2&gt;

&lt;p&gt;LocalhostKiller is open source and available on npm:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/codebyjawad/localhostkiller" rel="noopener noreferrer"&gt;github.com/codebyjawad/localhostkiller&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; localhostkiller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If port conflicts slow you down, give it a try. Pull requests welcome.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>productivity</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
