dpanel
- Docker安装部署
- 二进制部署
GitHub官网
一块轻量化docker可视化管理面板,由国人开发,个人觉得是比较好用的,功能都很齐全,并且可以通过修改源码,自定义前端样式等。
Docker安装部署
官网
部署环境:Ubuntu 24.04 LTS
- 安装docker
apt -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y install docker-ce
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://registry-mirrors.yunyuan.co"],
"insecure-registries" : ["0.0.0.0/0"]
}
EOF
systemctl daemon-reload
systemctl restart docker
- 安装标准版
创建面板容器时,请根据实际情况修改映射端口。面板不能绑定 host 网络(请勿使用 --network host 参数!!!)
默认版本中提供了域名绑定及Https证书功能,需要绑定 80 及 443 端口。如果你不需要这些功能,请安装 Lite 版
docker run -d --name dpanel --restart=always \
-p 80:80 -p 443:443 -p 8807:8080 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/dpanel:/dpanel -e APP_NAME=dpanel dpanel/dpanel:latest
- 安装 Lite 版
在 lite 版中,不包含域名转发功能。即容器内不会安装 nginx 及 acme.sh 等相关组件需要域名转发请借助外部工具。
docker run -d --name dpanel --restart=always \
-p 8807:8080 -e APP_NAME=dpanel \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/dpanel:/dpanel dpanel/dpanel:lite
- 安装Lite版本
oot@huhy:~# docker run -d --name dpanel --restart=always \
-p 8807:8080 -e APP_NAME=dpanel \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/dpanel:/dpanel dpanel/dpanel:lite
Unable to find image 'dpanel/dpanel:lite' locally
lite: Pulling from dpanel/dpanel
f18232174bc9: Already exists
3ed246920dfa: Pull complete
d0cb6d0dd844: Pull complete
19b5b9b0e508: Pull complete
eb62329725b7: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:abe45597a6e4b9c29143362a447dca4b444b6f683428bb6834c8a781b551a478
Status: Downloaded newer image for dpanel/dpanel:lite
f011cfbbc4cdf3ff4a85b3e9a43150bb8380aa42e30afe28c1124d365f51dc04
root@huhy:~# docker ps | grep dpanel
f011cfbbc4cd dpanel/dpanel:lite "sh -c '/app/server/…" 9 seconds ago Up 8 seconds 0.0.0.0:8807->8080/tcp, [::]:8807->8080/tcp dpanel
root@huhy:~#
- 浏览器访问:IP:8807
- 设置管理员和密码直接登录
二进制部署
dpanel 面板允许不依赖容器,直接通过二进制包的方式运行,编译构建前还可以对底层的源码进行一定的微调
- 拉取源码
git clone https://github.com/donknap/dpanel.git
- 部署要求:Go Version >= 1.23
apt install -y golang make
- 查看源码
cd dpanel
root@huhy:~/dpanel# ls
app common database Dockerfile go.mod LICENSE Makefile README.md SECURITY.md
asset config.yaml docker Dockerfile-lite go.sum main.go README_EN.md reload.sh
root@huhy:~/dpanel# ls asset/
index.html nginx plugin static
- 修改Makefile文件中的代理IP进行替换
--build-arg PROXY="https_proxy=http://192.168.200.11:7890 http_proxy=http://192.168.200.11:7890" \
- 编译源码:注意替换版本信息
make build PROJECT_NAME=dpanel CGO_ENABLED=1 VERSION=1.6.1
root@huhy:~/dpanel# make build PROJECT_NAME=dpanel CGO_ENABLED=1 VERSION=1.6.1
CGO_ENABLED=1 go build -ldflags '-X main.DPanelVersion=1.6.1 -s -w' -gcflags="all=-trimpath=/Users/renchao" -asmflags="all=-trimpath=/Users/renchao" -tags ce -o /root/dpanel/runtime/dpanel /root/dpanel/*.go
go: downloading go1.23.3 (linux/amd64)
go: downloading github.com/gin-gonic/gin v1.10.0
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/we7coreteam/w7-rangine-go/v2 v2.0.3
go: downloading gorm.io/gen v0.3.26
-------------------
go: downloading filippo.io/edwards25519 v1.1.0
go: downloading github.com/mattn/go-runewidth v0.0.16
go: downloading github.com/xeipuuv/gojsonschema v1.2.0
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading go.opentelemetry.io/auto/sdk v1.1.0
go: downloading github.com/rivo/uniseg v0.4.7
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
cp /root/dpanel/config.yaml /root/dpanel/runtime/config.yaml
root@huhy:~/dpanel# ls runtime/
config.yaml dpanel
- 使用go进行构建
CGO_ENABLED=1 go build -ldflags '-X main.DPanelVersion=1.6.1 -s -w' -o runtime/dpanel
root@huhy:~/dpanel# CGO_ENABLED=1 go build -ldflags '-X main.DPanelVersion=1.6.1 -s -w' -o runtime/dpanel
- 启动二进制文件
./runtime/dpanel server:start -f config.yaml
root@huhy:~/dpanel# ./runtime/dpanel server:start -f config.yaml
[2025-03-25 01:50:13.509] [DEBUG] default config {"env": "lite"}
[2025-03-25 01:50:13.509] [DEBUG] default config {"version": "1.6.1"}
[2025-03-25 01:50:13.509] [DEBUG] default config {"storage": "/root/dpanel/runtime"}
[2025-03-25 01:50:13.509] [DEBUG] default config {"db": "/root/dpanel/runtime/dpanel.db"}
[2025-03-25 01:50:13.529] [DEBUG] default main {"migrate": "1.1.1"}
[2025-03-25 01:50:13.529] [DEBUG] default main {"migrate": "1.5.2"}
[2025-03-25 01:50:13.530] [DEBUG] default main {"migrate": "1.5.3"}
[2025-03-25 01:50:13.532] [DEBUG] default provider load community edition
[2025-03-25 01:50:13.551] [DEBUG] default Event Monitor Loop
********************************************************************
http | Host: 0.0.0.0,Port: 8086,
********************************************************************
- 如果由报错信息,忽略即可,浏览器访问:IP:8086