EuberDeveloper
EuberDeveloper

Reputation: 1048

Portainer with ssl working only on port 443 and not on 80

I followed this page to setup portainer both on https and http:

openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -keyout ~/local-certs/portainer.key -out ~/local-certs/portainer.crt

docker run -d -p 443:9000 -p 80:8000 \
    --name portainer --restart always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \
    -v ~/local-certs:/certs \
    portainer/portainer-ce:2.6.3 --ssl --sslcert /certs/portainer.crt --sslkey 
    /certs/portainer.key

It is working for https and port 443, but if I try http (so, port 80), I get just a blank page with the text "Not found".

Upvotes: 1

Views: 5461

Answers (1)

Hubschrauber
Hubschrauber

Reputation: 101

Looks like you have your port mappings crossed up. To map Portainer's app-UI/webserver ports to the standard http (80) and https (443) ports on the docker host, you need: -p 80:9000 -p 443:9443

The setup instructions docker command shows container-port 8000 mapped out, but there's no info on that page about what port 8000 is used for, or why it is mapped to the docker host, so I bet a lot of people assume it is supposed to be the non-ssl port for the Portainer app. However, that is actually on port 9000 (which is also noted on the setup instructions page, btw). See: https://docs.portainer.io/v/ce-2.11/start/install/server/docker/linux

If you're curious about port 8000, see: https://docs.portainer.io/v/be-2.10/advanced/edge-agent

Upvotes: 1

Related Questions