Wednesday, August 09, 2017

Docker and Apple Server Service: How to use ports 80 and 443 on Mac OS X


I was trying to deploy some Docker containers yesterday which use ports 80 and 443. OK, I will confess that I was trying to deploy Wordpress or Bitnami Wordpress and MySQL to containers to see if I could migrate my personal blog to Wordpress. Eventually, I am hoping to migrate all of my blogs to a new blogging environment.


Well the containers would not deploy because the ports 80 and 443 were being used. A quick connection to localhost confirmed that the Apple was using these ports for running its processes. So I logged into the only to discover no way to turn it off.


Apple service is simply that... a service. The launchctl command will allow us to stop and start services. So I tried to stop the service only to discover it will automatically restart on a new PID. The only solution apparently is to unload the service temporarily. The following commands will allow you to unload and load the service, and check its status. This will allow you to use Docker containers on those ports while doing your development and testing.


Popular Posts