How to Kill Port 8080 on Linux

Free port 8080 on Ubuntu, Debian, Fedora, Arch, and any Linux distribution using ss, fuser, lsof, or portrm.

Updated April 20264 min read

Quick fix: portrm

$ ptrm fix 8080
  Port 8080 in use
  java (PID 19432) - Spring Boot
  SAFE - development server
  Killed PID 19432. Port 8080 is free.

Install: npm install -g portrm or curl -fsSL https://portrm.dev/install.sh | sh

Method 1: ss (socket statistics)

ss is the modern replacement for netstat, pre-installed on all modern Linux distributions:

$ ss -tlnp | grep :8080
LISTEN  0  100  *:8080  *:*  users:(("java",pid=19432,fd=56))

$ kill -9 19432

Method 2: fuser (one-liner)

fuser is the simplest way. The -k flag kills the process automatically:

# Find and kill in one command
$ fuser -k 8080/tcp
8080/tcp:  19432

# Just find (without killing)
$ fuser 8080/tcp
8080/tcp:  19432

If fuser is not installed: sudo apt install psmisc (Ubuntu/Debian) or sudo dnf install psmisc (Fedora).

Method 3: lsof

$ lsof -i :8080
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java   19432 dev    56u  IPv6 0x...  0t0      TCP *:http-alt (LISTEN)

$ kill -9 19432

# One-liner
$ kill -9 $(lsof -ti :8080)

If lsof is not installed: sudo apt install lsof

Method 4: /proc filesystem

On Linux, you can inspect sockets directly without installing anything:

# Find the inode for port 8080 (hex 1F90)
$ grep '1F90' /proc/net/tcp
  0: 00000000:1F90 00000000:0000 0A 00000000:00000000 ...

# Or use the portrm approach for human-readable output
$ ptrm 8080

Systemd services on port 8080

If a systemd service is using port 8080, killing it might cause it to restart automatically:

# Stop the service instead of killing the process
$ sudo systemctl stop tomcat
$ sudo systemctl stop jenkins

# Prevent it from starting on boot
$ sudo systemctl disable tomcat

Docker containers on port 8080

# Find Docker container using port 8080
$ docker ps --filter "publish=8080"
CONTAINER ID  IMAGE       PORTS                   NAMES
a1b2c3d4      nginx:latest 0.0.0.0:8080->80/tcp   my-nginx

# Stop it
$ docker stop my-nginx

Works on every Linux distro

portrm is a single 1.2 MB binary with zero dependencies. No psmisc, no lsof, no netstat required.