Running docker, I get this port issue:
ERROR: for mmp_php_1 Cannot start service php: driver failed programming external connectivity on endpoint mmp_php_1 (80f0277f963830426b07e4ae461b8533864822fceb67263a78c27b4ae91d87f5): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use ERROR: for php Cannot start service php: driver failed programming external connectivity on endpoint mmp_php_1 (80f0277f963830426b07e4ae461b8533864822fceb67263a78c27b4ae91d87f5): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use ERROR: Encountered errors while bringing up the project. Then I check the ports and it appears something is using 80.
timothy@13-9360:~/Public/pub/mmp$ ps -eaf | grep 1380 root 1380 2 0 Nov04 ? 00:00:00 [hci0] timothy 20779 9201 0 08:34 pts/18 00:00:00 grep --color=auto 1380 timothy@13-9360:~/Public/pub/mmp$ netstat -tlnp | grep 80 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - tcp6 0 0 :::8080 :::* LISTEN - tcp6 0 0 :::80 :::* LISTEN - How do I kill whatever process is running here so I can use port 80 again?
My localhost is the apache landing page atm which is weird because I've removed apache from my computer. Not sure why that's happening either.
sudo netstat -tlnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:58347 0.0.0.0:* LISTEN 1029/rpc.mountd tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 2591/vino-server tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN 16215/java tcp 0 0 0.0.0.0:44814 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1019/rpcbind tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1089/nginx -g daemo tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 3036/dnsmasq tcp 0 0 0.0.0.0:46357 0.0.0.0:* LISTEN 1029/rpc.mountd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 20431/cupsd tcp 0 0 127.0.0.1:29754 0.0.0.0:* LISTEN 1268/vpnagentd tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 2696/dropbox tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 16215/java tcp 0 0 0.0.0.0:42622 0.0.0.0:* LISTEN 1029/rpc.mountd tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 2696/dropbox tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 2696/dropbox tcp6 0 0 :::5672 :::* LISTEN 18276/docker-proxy tcp6 0 0 :::5900 :::* LISTEN 2591/vino-server tcp6 0 0 :::59533 :::* LISTEN 1029/rpc.mountd tcp6 0 0 :::42991 :::* LISTEN 1029/rpc.mountd tcp6 0 0 :::111 :::* LISTEN 1019/rpcbind tcp6 0 0 :::8080 :::* LISTEN 18412/docker-proxy tcp6 0 0 :::80 :::* LISTEN 1089/nginx -g daemo tcp6 0 0 ::1:631 :::* LISTEN 20431/cupsd tcp6 0 0 :::15672 :::* LISTEN 18260/docker-proxy tcp6 0 0 :::47673 :::* LISTEN 1029/rpc.mountd tcp6 0 0 :::17500 :::* LISTEN 2696/dropbox tcp6 0 0 :::35324 :::* LISTEN - tcp6 0 0 :::2049 :::* LISTEN - Shouldn't i be able to just change the port like you were saying.
version: '3' services: php: build: . volumes: - ./www:/var/www/html:delegated - ./configs:/configs links: - db:db - redis:redis - rabbit:rabbit - elasticsearch:elasticsearch ports: - "80:80" - "443:443" extra_hosts: - "localhost.local:127.0.0.1" environment: - CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH_SERVER_HOSTNAME=elasticsearch db: image: mariadb environment: 71 Answer
I had a similar issue once.
Another process was bound to port 80.
I had to find the culprit. I used netstat to find which process was using port 80.
You might need to install a package that includes netstat: net-tools
sudo apt install net-tools -y Once installed, netstat was installed, proceeded with command
sudo netstat -tlnp What I got was something similar to this :
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp6 0 0 :::80 :::* LISTEN 4227/httpd So process httpd with ID 4227 was using port 80. I opened htop, hit F3 to enable search, typed in httpd and found out that nextcloud (a file storage cloud server) was the parent process using httpd (a web page server).
What you do next however, is up to you. You might want to change the ports they use and then forward them internally. Or maybe just remove the app using that port or disabling it temporarily.
I was in the process of installing Docker to containerise my existing servers/services, etc. so I removed the Nextcloud snap, restarted Docker.
sudo snap remove nextcloud To restart docker, I initally tried sudo systemctl restart docker but realised that was not the name of the service because it was a Snap docker.
To find the name of the service I would have to sift through systemctl statuses:
sudo systemctl status | grep docker and found out the service name was snap.docker.dockerd.service
To restart it, I used sudo systemctl restart snap.docker.dockerd.service
Then I tried my docker command again, and the error was gone.