Question

Setup certbot SSL for wikijs installation error: Could not bind TCP port 80 because it is already in use by another process

I am attempting to use certbot to add SSL encryption to my wiki js installation. My droplet is on and I am logged into the remote shell. After running: ‘certbot certonly --standalone’ and entering my domains, I get this error:

Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.

  • The activity monitor (on my mac) is not showing any processes on port 80.

  • I had nginx installed (on my mac), but uninstalled it using brew (not using it)

  • I use pm2 (on my mac)to start up a local node.js server, but all stopped these processes

  • I am not sure what process might be blocking port 80.

Further, I am not sure if the warning is about some process in my droplet using port 80 or my MacBook??? When I list active ports in my droplet, I see two instances of ‘docker-pr’ listening on port 80. Could this be an issue?

Following the certbot documentation, I tried using --webroot instead of --standalone (‘certbot certonly --webroot’). The issue here so far is that I don’t know how to specify the webroot location. I’ve dug through the directories but don’t see where this path is.

My confusion is that I am supposing the droplet server is using port 80. I need to be logged in to the server to run certbot. I can’t run certbort if my droplet is off.

Thanks!

Subscribe
Share

Of course, answered my own question soon after asking.

It turns out yes, my app is running inside a Docker container and that Docker container is using port 80. I was able to temporarily stop the docker container, run certbot successfully, then restart.

  1. Went through these steps to find this out: Is docker installed? $ docker -v

  2. Find out: which docker containers are running? What ports? What process names? $ docker ps

3.How do I stop and start the docker containers? $ docker start <name of process>

$ docker stop <name of process>

  1. Test certbot auto renewal: $ certbot renew --dry-run

The auto renewal dry run initially failed because I had restarted docker. It ran successfully after I stopped the docker processes again. Will this be an issue in normal operation when docker is running? If yes, is there a way to switch the wiki js app to another port? (Thinking out loud at this point. I will ask these other questions in another post if need be).


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!