Skip to main content

portkill

Find and kill whatever process is using a port. Works on Windows, macOS and Linux.

$ portkill 3000
┌──────┬───────┬──────────┬───────┬────────┬──────────────────────┐
│ Port │   PID │ Name     │ Proto │ State  │ Command              │
├──────┼───────┼──────────┼───────┼────────┼──────────────────────┤
│ 3000 │ 41872 │ node.exe │ TCP   │ LISTEN │ node server.js       │
└──────┴───────┴──────────┴───────┴────────┴──────────────────────┘
Kill 1 process? [y/N]: y
killed: node.exe (PID 41872, port 3000)

Install

pipx install portkill
# or
uv tool install portkill

Usage

portkill 3000                 # show what's on port 3000, ask, then kill it
portkill 3000,8080            # several ports
portkill 3000-3005 8080       # ranges, in any mix
portkill 3000 --yes           # don't ask
portkill 3000 --list          # only show, kill nothing
portkill 3000 --force         # kill immediately instead of asking it to exit first

By default portkill asks the process to exit and waits up to --timeout seconds (default 3) before killing it outright.

Safety

  • Asks before killing anything unless you pass --yes.
  • Never kills critical system processes (System, lsass.exe, launchd, systemd, ...) or itself, even with --force.
  • If a process belongs to another user, portkill tells you to rerun as administrator / with sudo.

Exit codes

Code Meaning
0 Ports are free (or nothing was running)
1 Some processes could not be killed
2 Bad input

License

MIT

Metadata

Release files for portkill 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for portkill 0.1.0
File Size Uploaded Provenance Actions
portkill-0.1.0.tar.gz 35.8 kB Without provenance Details for portkill-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for portkill 0.1.0
File Interpreter ABI Platform Actions
portkill-0.1.0-py3-none-any.whl Python 3 none any Details for portkill-0.1.0-py3-none-any.whl

Total release size: 43.8 kB

Release files / portkill-0.1.0.tar.gz

Download URL portkill-0.1.0.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
582eaf1db0a4a18654d93ac2db459be037ed6179c9fb93946cf5c33f4810bdb6
BLAKE2b-256 checksum
How to use checksums
dde5d1296581e2b956c86ad197b06700dc1aaa6ca824de9b34c0d5dd2aef6b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / portkill-0.1.0-py3-none-any.whl

Download URL portkill-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21423923b23843feb14ddc94f72298384f9473e0b446b5d539423093130052e3
BLAKE2b-256 checksum
How to use checksums
d0fdb31236120155744ba239bb59ae662cf79c8bce3d15d77b828a0131cf7ee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for portkill 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page