Rancher Container is stopped and Rancher UI gives 404 backend

Hi all, I installed Rancher on a single node using Docker. With self-signed certiciate options. (I tried also all other options)
docker run -d --restart=unless-stopped
-p 80:80 -p 443:443
-v /<CERT_DIRECTORY>/<FULL_CHAIN.pem>:/etc/rancher/ssl/cert.pem
-v /<CERT_DIRECTORY>/<PRIVATE_KEY.pem>:/etc/rancher/ssl/key.pem
–privileged \ rancher/rancher:latest \ --no-cacerts

Installing rancher I am able to access https://rancher.domainname.com but after suddenly rancher/rancher:latest container is going to stop and RancherUI gives 404 backend error. Pods are working, certificate also did not expired.
I tried to reboot the server, restart docker service but did not work. When I try to restart the rancher/rancher:latest container it is giving :
Error response from daemon: Cannot restart container container_id : driver failed programming external connectivity on endpoint container_name : Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use.
netstat -plnt | grep 80 and netstat -plnt | grep 443 → nginx is listening and I could not start the container because of the 443 and 80 ports are binding.
Is there any suggestions? I can be so grateful.

This sounds like Rancher Docs: Advanced Options for Docker Installs, but you didn’t follow the port mapping.

Hi,
I tried also with this option :

docker run -d --restart=unless-stopped \
  -p 8080:80 -p 8443:443 \
  --privileged \
  rancher/rancher:latest

but after rancher container is just stopped and gave 404 backend error and for “bind: address already in use” error I could not restart the rancher container. How can I solve this problem?

Share the docker ps -a output from the host and docker inspect from that container please. Also include the curl -vLk http://rancher.yourdomain.com:8080 and curl -vLk https://rancher.yourdomain.com:8443