Close Menu
    Facebook X (Twitter) Instagram
    • About
    • Privacy Policy
    • Write For Us
    • Newsletter
    • Contact
    Instagram
    About ChromebooksAbout Chromebooks
    • News
      • Stats
    • AI
    • How to
      • DevOps
      • IP Address
    • Apps
    • Business
    • Q&A
      • Opinion
    • Gaming
      • Google Games
    • Blog
    • Podcast
    • Contact
    About ChromebooksAbout Chromebooks
    Linux

    How to Kill Process On Port in Linux

    Dominic ReignsBy Dominic ReignsJanuary 15, 2026No Comments3 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest

    The “Address already in use” error appears when you try to start a server application. This happens because another program already occupies the network port you need. Learning to kill process on port resolves this issue quickly and gets your services running again.

    Port conflicts disrupt web servers, databases, and development environments. You need to identify which program holds the port, then terminate it properly. This guide shows you the exact commands and steps to free blocked ports on Linux systems.

    How To Kill Process On Port?

    Find the Process Using the Port

    You need to identify the process ID before you can terminate it. Run this command to see what’s using your port:

    lsof -i :8080

    Replace 8080 with your actual port number. The output shows the process name and its PID in the second column.

    If lsof isn’t available, use the ss command instead:

    ss -tulnp | grep 8080

    This displays active connections with process identifiers. Look for the number after “pid=” in the output.

    Terminate the Process Gracefully

    Once you have the PID, send a termination signal to shut down the program properly:

    kill 12345

    Replace 12345 with your actual process ID. This method allows the application to save data and close connections before exiting.

    Wait a few seconds for the process to stop. Then verify the port is free by running your identification command again.

    Force Kill Stubborn Processes

    Some programs don’t respond to standard termination signals. Use the force kill option when graceful shutdown fails:

    kill -9 12345

    This immediately stops the process without allowing cleanup operations. Only use this when regular kill doesn’t work.

    You can combine commands to kill process on port in one step:

    fuser -k -n tcp 8080

    This finds and terminates the program automatically without manual PID lookup.

    Handle Permission Issues

    System processes require administrator privileges to terminate. Add sudo before your kill command:

    sudo kill -9 12345

    Enter your password when prompted. This grants the necessary permissions to stop protected processes.

    For services managed by systemd, stop them through the service manager:

    sudo systemctl stop nginx

    This ensures clean shutdown and prevents automatic restarts.

    Verify Port Availability

    Confirm the port is free before starting your application. Run the identification command again:

    lsof -i :8080

    Empty output means success. Your port now accepts new connections and your application can start without conflicts.

    FAQs

    What command kills process on port 8080 instantly?

    Use fuser -k -n tcp 8080 to terminate the process immediately. Alternatively, run kill -9 $(lsof -t -i :8080) for forced termination with automatic PID detection.

    How do I check if a port is free after killing the process?

    Run lsof -i :PORT or ss -tulnp | grep PORT to verify. No results confirm the port is available for new connections.

    Why does my kill command return permission denied?

    System processes need root access. Prefix your command with sudo like sudo kill -9 PID to gain necessary privileges for termination.

    What’s the difference between kill and kill -9?

    Standard kill sends SIGTERM allowing graceful shutdown with data saving. The kill -9 command forces immediate termination without cleanup, risking data loss.

    Can I kill multiple processes on different ports simultaneously?

    Yes, run separate commands for each port or use fuser -k -n tcp 8080 8081 8082 to terminate multiple ports at once efficiently.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr
    Dominic Reigns
    • Website
    • Instagram

    As a senior analyst, I benchmark and review gadgets and PC components, including desktop processors, GPUs, monitors, and storage solutions on Aboutchromebooks.com. Outside of work, I enjoy skating and putting my culinary training to use by cooking for friends.

    Related Posts

    How to Restart NGINX on Your Linux Server

    January 30, 2026

    How To Install NPM Linux

    January 26, 2026

    How To Check Linux List Processes

    January 24, 2026

    Comments are closed.

    Best of AI

    Make-A-Video Statistics 2026

    January 30, 2026

    Stable Video Diffusion User Trends And Statistics 2026

    January 29, 2026

    VALL-E Statistics 2026

    January 28, 2026

    StarCoder Statistics And User Trends 2026

    January 27, 2026

    BLIP-2 Statistics 2026

    January 23, 2026
    Trending Stats

    Google Penalty Recovery Statistics 2026

    January 30, 2026

    Search engine operators Statistics 2026

    January 29, 2026

    Most searched keywords on Google

    January 27, 2026

    Ahrefs Search Engine Statistics 2026

    January 19, 2026

    Pay Per Click Advertising Statistics 2026

    January 16, 2026
    • About
    • Write For Us
    • Contact
    • Privacy Policy
    • Sitemap
    © 2026 About Chrome Books. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.