Hallo zusammen,
leider habe ich Probleme den Docker Container Portainer über die IP mit den Ports 9443 oder 9000 zu erreichen.
Dabei bin ich wie folgt vorgegangen (Testweise Server neu installiert und nach dem Test heruntergefahren):
#Authentifizierung per SSH-Key einrichten
#Server updaten (Ubuntu 22.04)
sudo apt update && sudo apt upgrade -y
sudo reboot
#Hostname setzen
sudo hostnamectl set-hostname ***
#Timezone setzen
sudo timedatectl set-timezone Europe/Berlin
#Apache2 Webserver installieren
sudo apt install apache2 -y
#Docker installieren (wie in der Anleitung: https://docs.docker.com/engine/install/ubuntu/)
#Set up the repository
#Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg -y
#Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
#Use the following command to set up the repository:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
#Install Docker Engine
#Update the apt package index:
sudo apt-get update
#Install Docker Engine, containerd, and Docker Compose.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#Verify that the Docker Engine installation is successful by running the hello-world image.
sudo docker run hello-world
#Hello from Docker!
#This message shows that your installation appears to be working correctly.
#Portainer installieren (wie in der Anleitung: https://docs.portainer.io/start/install-ce/server/docker/linux)
#Portainer Volume erstellen
docker volume create portainer_data
#Portainer Container installieren
docker run -d -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Display More
Testweise habe ich dann folgende Dinge ausprobiert:
Per docker ps habe ich geprüft ob der Container läuft:
82701e65f8c6 portainer/portainer-ce:latest "/portainer" 41 seconds ago Up 40 seconds 8000/tcp, 9000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp portainer
ss -tulpen gibt folgendes aus:
tcp LISTEN 0 4096 0.0.0.0:9443 0.0.0.0:* users:(("docker-proxy",pid=3191,fd=4)) ino:41036 sk:5 cgroup:/system.slice/docker.service <->
sudo ufw status Status: inactive
sudo nano /etc/sysctl.conf #net.ipv4.ip_forward=1 ändern in net.ipv4.ip_forward=1 sudo sysctl -p
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:9443
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
Display More
Ich hoffe Ihr könnt mir da weiter helfen, ich stehe da leider auf dem Schlauch.
LG