Docker使用Portainer CE可视化管理操作

ReWi2023/09/19 18:00:00dockervirtual-platform程序安装

目录

1. 进入官网,获取最新安装信息

Portainer Community Edition (CE)open in new window

2. Deployment(部署步骤)

2.1 First, create the volume that Portainer Server will use to store its database:(创建数据卷)

sudo docker volume create portainer_data
portainer_data

2.2 Then, download and install the Portainer Server container: (安装 Portainer)

# SELinux is disabled on the machine running Docker. If you require SELinux, you will need to pass the --privileged flag to Docker when deploying Portainer.
# If you require HTTP port 9000 open for legacy reasons, add the following to your docker run command: -p 9000:9000
sudo docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Unable to find image 'portainer/portainer-ce:latest' locally

latest: Pulling from portainer/portainer-ce

7bd7f95ed7eb: Pull complete 

9d019f0c1f3a: Pull complete 

5171176db7f2: Pull complete 

52e9438966a5: Pull complete 

43d4775415ac: Pull complete 

c1cad9f5200f: Pull complete 

4de43b91ce75: Pull complete 

d7c8d69c556b: Pull complete 

173ea6e5087e: Pull complete 

90767cd90d02: Pull complete 

4f4fb700ef54: Pull complete 

Digest: sha256:54ec8c7776cf9759f3e4c665a9596c4e0069d6359f4cc012377c6e5f104d8a94

Status: Downloaded newer image for portainer/portainer-ce:latest

1cdbf0e1a4342ac7028b11a89f13886c92ff24b85982ef0afbce75e144c229da

2.3 Portainer Server has now been installed. You can check to see whether the Portainer Server container has started by running docker ps:(查看是否成功)

sudo docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED       STATUS      PORTS                                                                                  NAMES             
de5b28eb2fa9   portainer/portainer-ce:latest  "/portainer"             2 weeks ago   Up 9 days   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp   portainer

3. Logging In (打开浏览器访问)

# 在其他浏览器,则使用IP代替localhost
https://localhost:9443

4. Initial setup(初始化操作)

4.1 Creating the first user(根据界面提示创建 用户名、密码(至少12位))

4.2 Enabling or disabling the collection of statistics(复选框选择是否允许收集统计信息)

4.3 Connecting Portainer to your environments(如果是本地环境,直接开始操作)

附录

How do I remove Portainer?

Stop the Portainer container

sudo docker stop portainer

Delete the Portainer container

sudo docker rm portainer
最后更新时间 2025/4/8 10:10:24