title: Docker tutorials all bind to port 80, and fail on local and remote servers as port 80 is already in use
body: <p>Trying to wrap my head around all these Docker tutorials, and there is really no explanation around what port 80 is all about. Just, "bind to port 80".</p>
  
  <p>This is the 3rd Docker tutorial I've taken with the same error after running the sample Dockerfile:</p>
  
  <blockquote>
    <p>Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address
    already in use</p>
  </blockquote>
  
  <p>So, I've understood that port 80 is basically the default port, which would allow my app to run at <code>example.com</code> instead of <code>example.com:80</code> - for example. My web server, and local machine complain that this port is in use. Of course it is, it's in use by default.</p>
  
  <p>So, why are all these Docker tutorials binding to port 80? I bet they are doing it right, and I am missing something... but, cannot find a clear solution or description. </p>
  
  <p>Here is the tutorial I'm doing: Digital Ocean's Install WordPress with Docker: <a href="https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-docker-compose" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-docker-compose</a></p>
  
  <p>Sure enough, port 80 fails for me:</p>
  
  <pre><code>webserver:
    depends_on:
      - wordpress
    image: nginx:1.15.12-alpine
    container_name: webserver
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - wordpress:/var/www/html
      - ./nginx-conf:/etc/nginx/conf.d
      - certbot-etc:/etc/letsencrypt
    networks:
      - app-network
  </code></pre>
  
  <p>Changing this to throws no error, but this means we can only resolve <code>http://example.com:90</code> -  </p>
  
  <pre><code>ports:
    - "90:80"
  </code></pre>
  
  <p>What am I missing here? Why are all of these definitions of port 80 failing locally on my Mac and on a remote Digital Ocean Ubuntu8.1 server?</p>