Member-only story
Release Port on Linux
Often a process gets stuck to a port and you’d like to release the port. It happens to me sometimes when I am developing with NextJS or with other local servers that the process is running in the background and you don’t know which process is holding up the port you need for your new server.
Run the following command to find out the process Id that is holding up the port:
sudo netstat -tulpn | grep :<port_number>
# or
sudo ss -tulpn | grep :<port_number>Once you found out the process id, kill it with the following commnad:
kill -9 <PID>- 9 flag is to force it to terminate the process. You might have to add “sudo” if it is above your user’s permissions to kill the process.
Hope it helps.








