Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen tcp 0.0.0.0:80: bind: address already in use #16

Closed
wedojava opened this issue Mar 24, 2016 · 9 comments
Closed

listen tcp 0.0.0.0:80: bind: address already in use #16

wedojava opened this issue Mar 24, 2016 · 9 comments

Comments

@wedojava
Copy link

  • When I run docker-compose up,there is a error alert blow:
Starting data
redis is up-to-date
mysql is up-to-date
Starting php-nginx
ERROR: failed to create endpoint php-nginx on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
  • My OS is Ubuntu 15,it had no nginx or apache service.And PHP+NGINX config in docker-compose.yml is blow:
php-nginx:
  image: laradock/phpnginx:latest
  container_name: php-nginx
  ports:
    - "80:80"
  volumes:
    - ./settings/nginx:/etc/nginx/sites-available
    - ../:/var/www
    - ./logs/nginx:/var/log/nginx
  links:
    - mysql
    - redis
  privileged: true
  extra_hosts:
    - "laravel.dev:127.0.0.1"
  • My laravel project root dir is git/Code/hfcms/,the docker dir is git/Code/hfcms/docker.
@Mahmoudz
Copy link
Member

Looks like you're already using the port 80!!

Change the default port in the docker-compose.yml

  ports:
    - "8084:80"

And try to use the port 8084 instead laravel.dev:8084.

@danktec
Copy link

danktec commented Jan 31, 2017

I was getting this error when using the docker-compose inheritance feature (-f ), the ports in the base file were not being over-ridden by my overlay file

@philtrep
Copy link
Member

philtrep commented Feb 5, 2017

@dhdanno You cannot override ports in docker-compose. There's an open issue about this in the docker-compose repo docker/compose#3939

@tuxisma
Copy link

tuxisma commented Aug 28, 2017

I solved that problem just stopping apache on ubuntu xenial.

sudo /etc/init.d/apache2 stop

I had apache running.

Mahmoudz pushed a commit that referenced this issue Sep 25, 2017
@LeKibbitz
Copy link

For us, the solution was to stop & disable the BranchCache windows' service.

@deepak1725
Copy link

This works for me nmap localhost as i have nginx globally installed , and it occupies port 80 on boot up.
'nmap localhost' will tell you which program started a port

@connor11528
Copy link

I had nginx running globally on mac. Stopping it fixed the error:

sudo nginx -s stop

@misheki
Copy link

misheki commented Jan 10, 2018

Thank you @tuxisma!

My host rebooted and suddenly one of my containers that maps to port 80 couldn't start. I got this error: Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use + docker container failed to start

Stopping apache2 service in my ubuntu host solved it!

@mylastore
Copy link

mylastore commented Feb 21, 2018

same here after ubuntu update not sure why but nginx was running globally on my linux PC and also solve the problem with

sudo nginx -s stop

@laradock laradock locked as resolved and limited conversation to collaborators Feb 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants