How to fix “Port 8080 already in use” error on a Mac (2024)

If you’re a developer working on a Mac, you may encounter the “Port 8080 already in use” error when trying to start a Java web server or some other application that listens on that port. This error typically means that another application or service is already using port 8080, which prevents your application from starting.

In this article, we’ll show you how to use the sudo kill -9 command to terminate the process using port 8080, freeing up the port for your application to use.

The first step in resolving the “Port 8080 already in use” error is to identify the process that’s currently using the port. To do this, open a terminal window and run the following command:

lsof -i :8080

This command will list all the processes using port 8080. You should see something like this:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 12345 user 42u IPv6 0xa1b2c3d4e5f67890 0t0 TCP *:http-alt (LISTEN)

In this example, the process using port 8080 is a Java process with the PID (process ID) of 12345.

Now that you’ve identified the process using port 8080, you can terminate it using the sudo kill -9 command. This command sends a SIGKILL signal to the specified process, forcing it to terminate immediately.

To terminate the process, run the following command in your terminal:

sudo kill -9 12345

Replace 12345 with the PID of the process you identified in step 1.

After running this command, the process using port 8080 should be terminated, freeing up the port for your application to use.

Now that you’ve freed up port 8080, you can try starting your Java web server or application again. It should now start successfully without encountering the “Port 8080 already in use” error.

How to fix “Port 8080 already in use” error on a Mac (2024)

FAQs

How to fix “Port 8080 already in use” error on a Mac? ›

To fix a port already in use, you can either kill the process running on that port or change your app to use a different port. Using the lsof command to find the process id and then the kill command is a common method to resolve such conflicts.

How do I remove port 8080 already in use? ›

  1. On MS Windows, select Start > All Programs > Accessories > System Tools >Resource Monitor.
  2. Expand the Network Tab.
  3. Move to the section for Listening Ports.
  4. Look in the Port column and scroll to find entry for port 8080.
  5. Select the given process and delete/kill the process.
Dec 13, 2015

How do I allow port 8080 on my Mac? ›

Here's how to do this:
  1. Mac->Sys Preferences->Sharing->Enable “Web Sharing” checkbox.
  2. Mac->Sys Preferences->Security-> Turn off firewall, or allow your application to accept incoming connection.
  3. Open a port on the router (via 192.168.1.1) to forward traffic from your_web_ip:port to a local_gateway:port.
Nov 15, 2011

How to solve port already in use? ›

To fix a port already in use, you can either kill the process running on that port or change your app to use a different port. Using the lsof command to find the process id and then the kill command is a common method to resolve such conflicts.

How do I check if port 8080 is open on my Mac? ›

macOS: Open Terminal: Navigate to the Applications/Utilities folder or use Spotlight Search to find it. In the Terminal, enter the following command: lsof -i :8080 .

How do I stop port 8080 already in use on a Mac? ›

  1. Step 1: Identify the process using port 8080. The first step in resolving the “Port 8080 already in use” error is to identify the process that's currently using the port. ...
  2. Step 2: Terminate the process using sudo kill -9. ...
  3. Step 3: Restart your application.
Apr 14, 2023

How do I unblock port 8080? ›

How to open a port on the firewall
  1. Click on Start then on Control Panel.
  2. Click on Windows Firewall and then click on Advanced Settings.
  3. Right click on Inbound Rules then on New Rule:
  4. Select Port and click on Next:
  5. Enter a specific local port (e.g. 8080) and click on Next:
  6. Click on Next:
  7. Name the rule and click on Finish:
Jun 16, 2023

Why port 8080 is not responding? ›

You need to access your app with http in the URL not https when developing locally. You may have your web browser set to automatically try to upgrade the connection from http to https. If you, disable this setting.

How do I unblock ports on Mac? ›

How to Make a Port Open on a Mac
  1. Open the Terminal app.
  2. Enter the following at the prompt to stop the pf (packet filter) firewall if it's active: sudo pfctl -d.
  3. Next, use the nano text editor to open the configuration file for pf: sudo nano /etc/pf.conf.
Feb 16, 2021

How do I know if a port is blocked on my Mac? ›

You can find what ports are open on an OS X version of Mac fairly easily by doing the following: STEP 1: Open “Network Utility,” located in the “Utilities” folder in the “Applications” folder, and click “Port Scan.” STEP 2: Type your IP address, and then click the “Scan” button.

How do I know if port 8080 is already in use? ›

Use the Windows netstat command to identify which applications are using port 8080:
  1. Hold down the Windows key and press the R key to open the Run dialog.
  2. Type “cmd” and click OK in the Run dialog.
  3. Verify the Command Prompt opens.
  4. Type “netstat -a -n -o | find "8080"". A list of processes using port 8080 are displayed.
Jun 2, 2023

How to resolve address already in use error? ›

The Error “address already in use” occurred because some process was already running on the same port. So we can resolve the issue just by killing the process. To stop the process, we need the process ID (PID), which we can fetch using the lsof command.

How do I reset my port? ›

HOW TO RESET COM PORTS?
  1. Click Start – write regedit then click Enter.
  2. Navigate through folders: HKEY_LOCAL_MACHINE\SYSTEM\CurrentConstrolSet\Control\COM Name Arbiter.
  3. Double-click right click ComDB on right panel.
  4. This will open a window with addresses ports. To reset, enter all zeros, as shown below:
Jan 9, 2023

What runs on port 8080 Mac? ›

Port 8080 is commonly used as a proxy and caching port. It is also above the service port range. Port 8080 also can run a Web server as a non-root user. Other assignments for port 8080 include Apache Tomcat, an M2MLogger, and a Web GUI.

How to enable port in Mac? ›

Click the "Firewall Options" button. Click the "+" button to add a new rule. Select "Allow incoming connections" for the new rule. Choose "Applications" to specify the application or "Port" to specify a port number.

How to release port in Mac? ›

Mac OS
  1. Step 1: Find the Process ID (PID) sudo lsof -i :portNumber. Replace portNumber with the actual port number. Copy the PID number.
  2. Step 2: Kill the Process. kill PID. Replace PID with the copied process ID. If necessary, try kill -9 PID or sudo kill -9 PID for forceful termination.
Feb 5, 2024

How do I stop something running on port 8080? ›

Expand the Network Tab. Move to the section for Listening Ports. Look in the Port column and scroll to find entry for port 8080. Select the given process and delete/kill the process.

How do I clear a port from being used? ›

How to kill the process currently using a port on localhost in...
  1. Run command-line as an Administrator. Then run the below mention command. netstat -ano | findstr : port number. ...
  2. Then you execute this command after identify the PID. taskkill /PID typeyourPIDhere /F.
Oct 16, 2019

What to do if the specified port is already in use? ›

Rebooting the computer clears the locked resource, and the network connection can be reestablished.

How do I stop the port which is already in use in Windows? ›

Here are the steps for Windows:
  1. Find the process ID (PID) of the port (replace the 'portNumber' with the number) netstat -ano | findstr :portNumber. Copy the PID number for the next step.
  2. Kill the process. First, try this (replace typeyourPIDhere with the number you copied above): taskkill /PID typeyourPIDhere /F.
Mar 30, 2020

Top Articles
22+ Letter of Credit - Format, Email Ideas, Templates, Writing Steps - Letters Easy
2023 Municipal Bond Market Insights: Mid-year Update
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Umn Biology
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5992

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.