Simplify Docker Management with Portainer CE on Linux: A Step-by-Step Guide
Managing Docker containers via the command line can be daunting, especially for newcomers. Portainer CE (Community Edition) offers a free, lightweight, and intuitive solution. This web-based interface streamlines Docker management, enabling efficient control over containers, images, networks, and volumes without complex terminal commands.
This guide details the installation and configuration of Portainer CE with Docker on a Linux system.
Prerequisites:
- A Linux system (Ubuntu, Debian, RHEL, or similar).
- A user account with sudo privileges.
- Docker installed on your system. (Instructions for Docker installation are provided below.)
Step 1: Docker Installation on Linux
Portainer runs within a Docker container, requiring prior Docker installation. Instructions vary by distribution:
Debian-based (Ubuntu, Mint):
sudo apt update sudo apt install -y ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io
RHEL-based (CentOS, AlmaLinux, Rocky Linux, Fedora):
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install -y docker-ce docker-ce-cli containerd.io
To avoid constant sudo
usage, grant non-root Docker access:
sudo usermod -aG docker $USER newgrp docker
Enable Docker on boot and start the service:
sudo systemctl enable --now docker sudo systemctl start docker
Verify installation:
docker run hello-world docker --version
Step 2: Create a Docker Volume for Portainer
Portainer needs a persistent volume to store data:
docker volume create portainer_data
Verify creation:
docker volume ls
Step 3: Install and Run Portainer CE
Pull the Portainer CE image and run it as a container:
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:lts
Access Portainer via your server's IP address or localhost:9443
(HTTPS). Accept any browser security warnings due to the self-signed certificate.
Create an admin account.
Connect to your Docker environment.
The Portainer dashboard allows management of containers, images, networks, and volumes.
Verify Portainer's status:
sudo docker ps
Step 4: Managing Containers with Portainer (Example: Nginx)
This section demonstrates deploying and managing an Nginx container through Portainer's web interface.
Create a new container via the Portainer dashboard:
-
Container Name:
nginx-webserver
-
Image:
nginx:latest
-
Host Port:
8080
-
Container Port:
80
Deploy the container and access it at your-server-ip:8080
or localhost:8080
.
Step 5: Managing Portainer in Linux
Start, stop, restart, or remove Portainer using these commands:
docker start portainer # Start Portainer docker stop portainer # Stop Portainer docker restart portainer # Restart Portainer docker rm -f portainer # Remove Portainer
Conclusion:
This guide successfully installed and configured Portainer CE with Docker, providing a user-friendly web interface for efficient Docker management.
以上是像專業(yè)人士一樣管理Docker:在Linux上安裝Portainer CE的詳細內(nèi)容。更多信息請關(guān)注PHP中文網(wǎng)其他相關(guān)文章!

熱AI工具

Undress AI Tool
免費脫衣服圖片

Undresser.AI Undress
人工智能驅(qū)動的應(yīng)用程序,用于創(chuàng)建逼真的裸體照片

AI Clothes Remover
用于從照片中去除衣服的在線人工智能工具。

Clothoff.io
AI脫衣機

Video Face Swap
使用我們完全免費的人工智能換臉工具輕松在任何視頻中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的代碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
功能強大的PHP集成開發(fā)環(huán)境

Dreamweaver CS6
視覺化網(wǎng)頁開發(fā)工具

SublimeText3 Mac版
神級代碼編輯軟件(SublimeText3)

遇到DNS問題時首先要檢查/etc/resolv.conf文件,查看是否配置了正確的nameserver;其次可手動添加如8.8.8.8等公共DNS進行測試;接著使用nslookup和dig命令驗證DNS解析是否正常,若未安裝這些工具可先安裝dnsutils或bind-utils包;再檢查systemd-resolved服務(wù)狀態(tài)及其配置文件/etc/systemd/resolved.conf,并根據(jù)需要設(shè)置DNS和FallbackDNS后重啟服務(wù);最后排查網(wǎng)絡(luò)接口狀態(tài)與防火墻規(guī)則,確認53端口未

作為系統(tǒng)管理員,您可能會發(fā)現(xiàn)自己(今天或?qū)恚┰赪indows和Linux并存的環(huán)境中工作。 有些大公司更喜歡(或必須)在Windows Box上運行其一些生產(chǎn)服務(wù)已不是什么秘密

Node.js建立在Chrome的V8引擎上,是一種開源的,由事件驅(qū)動的JavaScript運行時環(huán)境,用于構(gòu)建可擴展應(yīng)用程序和后端API。 Nodejs因其非阻滯I/O模型而聞名輕巧有效,并且

在Linux系統(tǒng)中,1.使用ipa或hostname-I命令可查看私有IP;2.使用curlifconfig.me或curlipinfo.io/ip可獲取公網(wǎng)IP;3.桌面版可通過系統(tǒng)設(shè)置查看私有IP,瀏覽器訪問特定網(wǎng)站查看公網(wǎng)IP;4.可將常用命令設(shè)為別名以便快速調(diào)用。這些方法簡單實用,適合不同場景下的IP查看需求。

LinuxCanrunonModestHardwarewtareWithSpecificminimumRequirentess.A1GHZPROCESER(X86ORX86_64)iSNEDED,withAdual-Corecpurecommondend.r AmshouldBeatLeast512MbForCommand-lineUseor2Gbfordesktopenvironments.diskSpacePacereQuiresaminimumof5-10GB,不過25GBISBISBETTERFORAD

MySQL用C編寫,是一個開源,跨平臺,也是使用最廣泛的關(guān)系數(shù)據(jù)庫管理系統(tǒng)(RDMS)之一。這是LAMP堆棧不可或缺的一部分,是Web托管,數(shù)據(jù)分析,數(shù)據(jù)庫管理系統(tǒng),數(shù)據(jù)分析,

Ubuntu長期以來一直是Linux生態(tài)系統(tǒng)中可訪問性,波蘭和功率的堡壘。隨著Ubuntu 25.04的到來,代號為“ Prucky Puffin”,Canonical再次證明了其對交付的承諾

MongoDB是一種高性能,高度可擴展的面向文檔的NOSQL數(shù)據(jù)庫,旨在管理繁忙的流量和大量數(shù)據(jù)。與傳統(tǒng)的SQL數(shù)據(jù)庫不同,將數(shù)據(jù)存儲在表中的行和列中,MongoDB在J中結(jié)構(gòu)數(shù)據(jù)
