Skip to content
Fix Code Error

Find (and kill) process locking port 3000 on Mac

March 13, 2021 by Code Error
Posted By: Anonymous

How do I find (and kill) processes that listen to/use my tcp ports? I’m on mac os x.

Sometimes, after a crash or some bug, my rails app is locking port 3000. I can’t find it using ps -ef…

When doing

rails server

I get

Address already in use – bind(2) (Errno::EADDRINUSE)

2014 update:

To complete some of the answers below: After executing the kill commands, deleting the pid file might be necessary rm ~/mypath/myrailsapp/tmp/pids/server.pid

Solution

  1. You can try netstat

     netstat -vanp tcp | grep 3000
    
  2. For macOS El Capitan and newer (or if your netstat doesn’t support -p), use lsof

     lsof -i tcp:3000 
    
  3. For Centos 7 use:

     netstat -vanp --tcp | grep 3000
    
Answered By: Anonymous

Related Articles

  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • XAMPP Port 80 in use by "Unable to open process" with PID 4
  • Use SQL Server Management Studio to connect remotely…
  • Why cat does not work with parameter -0 in xargs?
  • Arrange date columns based on unique id column using R
  • Start redis-server with config file
  • Attempting to adapt existing code that opens Excel…
  • Rust: implementing an iterator from a vector of…
  • error LNK2005: ✘✘✘ already defined in…
  • You have not concluded your merge (MERGE_HEAD exists)
  • stop all instances of node.js server
  • CastError: Cast to ObjectId failed for value In…
  • Linux/Unix command to determine if process is running?
  • Windows could not start the Apache2 on Local…
  • Problems Installing CRA & NextJS from NPM…
  • Oracle listener not running and won't start
  • Memcached vs. Redis?
  • Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?
  • nginx - nginx: [emerg] bind() to [::]:80 failed (98:…
  • Creating a pandas DataFrame from columns of other…
  • Find and kill a process in one line using bash and regex
  • What portion of code is executed by child process…
  • Correctly configure webpack-dev-middleware with…
  • Simplest way to create Unix-like continuous pipeline…
  • What does "Fatal error: Unexpectedly found nil while…
  • Remix error The transaction has been reverted to the…
  • fork() child and parent processes
  • Node.js/Express.js App Only Works on Port 3000
  • PG::ConnectionBad - could not connect to server:…
  • Shell Script Syntax Error: Unexpected End of File
  • Can't stop rails server
  • Using IS NULL or IS NOT NULL on join conditions -…
  • What are the new features in C++17?
  • fork() and wait() with two child processes
  • How to import multiple csv files into querie…
  • Why does my Spring Boot App always shutdown…
  • C: socket connection timeout
  • What is your most productive shortcut with Vim?
  • Error: Address already in use while binding socket…
  • Who is listening on a given TCP port on Mac OS X?
  • Best TCP port number range for internal applications
  • How do you list volumes in docker containers?
  • How do I write a bash script to restart a process if…
  • summing two columns in a pandas dataframe
  • Fastest way to list all primes below N
  • WAMP server, localhost is not working
  • Apache shutdown unexpectedly
  • problem with client server unix domain stream…
  • PHP-FPM and Nginx: 502 Bad Gateway
  • How to simulate signals (Ctrl+ and Ctrl+C) like in…
  • Azure SQL SCOPE_IDENTITY to create identical ID…
  • Error installing PyPI xmlsec==1.3.3 Python2
  • Correct way to use StringBuilder in SQL
  • How to kill a running SELECT statement
  • What are the undocumented features and limitations…
  • How to make a SIMPLE C++ Makefile
  • How to change XAMPP apache server port?
  • "[notice] child pid ✘✘✘X exit signal Segmentation…
  • grep --ignore-case --only
  • How do I discover memory usage of my application in Android?
  • Spring Boot application.properties value not populating
  • ExpressJS How to structure an application?
  • javascript replace all next text
  • Error: listen EADDRINUSE 127.0.0.1:3000
  • Creating a daemon in Linux
  • Optimize calls to exteral Api from getServerSideProps
  • i am using nodejs and express to build a very simple…
  • Reading and writing to serial port in C on Linux
  • What is the difference between net.createServer()…
  • Current date and time as string
  • How to wait in bash for several subprocesses to…
  • webpack-dev-server npm run dev throwing TypeError:…
  • How do I get Flask to run on port 80?
  • How can I exclude all "permission denied" messages…
  • How to grep (search) committed code in the Git history
  • Getting infinite loop after entering 2 objects to…
  • Problem Process.GetProcesses Not work with 2 same processes
  • How can I start PostgreSQL server on Mac OS X?
  • MySQL: Invalid use of group function
  • apache server reached MaxClients setting, consider…
  • IOException: read failed, socket might closed -…
  • How to download Xcode DMG or XIP file?
  • Name [jdbc/mydb] is not bound in this Context
  • rails and backbone working together
  • Rails wrong number of arguments error when…
  • From inside of a Docker container, how do I connect…
  • DeprecationWarning: Tapable.plugin is deprecated.…
  • Node.js EACCES error when listening on most ports
  • Understanding PrimeFaces process/update and JSF…
  • How to get the process ID to kill a nohup process?
  • When I'm testing a web app by JUnit and Mockito I…
  • Deleting folders in python recursively
  • jmxterm: "Unable to create a system terminal" inside…
  • How to get rid of SourceMapConcat build error in emberjs?
  • Why does my waitpid() not wait for child after…
  • How to calculate means for multiple groups of rows…
  • Singly Linked List in C++ is not reading more than 2 nodes
  • What the memory difference between char *array and…
  • Backend not loading into browser because of…
  • How to get PID of process by specifying process name…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Generate random integers between 0 and 9

Next Post:

Check if checkbox is checked with jQuery

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error