<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="OneClickVirt 虚拟化管理平台">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2025-10-14 15:33<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
OneClickVirt 虚拟化管理平台


一个可扩展的通用虚拟化管理平台，支持 LXD、Incus、Docker 和 Proxmox VE。


Github：https://github.com/oneclickvirt/oneclickvirt


官方教程：https://www.spiritlhl.net/guide/dashboard.html


hubdocker：https://hub.docker.com/r/spiritlhl/oneclickvirt


快速部署




方式一：使用预构建镜像


使用已构建好的多架构镜像，会自动根据当前系统架构下载对应版本：


基础使用（不配置域名）：


XML/HTML代码


    docker run -d \

      --name oneclickvirt \

      -p 80:80 \

      -v oneclickvirt-data:/var/lib/mysql \

      -v oneclickvirt-storage:/app/storage \

      --restart unless-stopped \

      spiritlhl/oneclickvirt:latest





配置域名访问：


如果你需要配置域名，需要设置 FRONTEND_URL 环境变量：


XML/HTML代码


    docker run -d \

      --name oneclickvirt \

      -p 80:80 \

      -e FRONTEND_URL=&quot;https://your-domain.com&quot; \

      -v oneclickvirt-data:/var/lib/mysql \

      -v oneclickvirt-storage:/app/storage \

      --restart unless-stopped \

      spiritlhl/oneclickvirt:latest





说明：FRONTEND_URL 用于配置前端访问地址，影响 CORS、OAuth2 回调等功能。系统会自动检测 HTTP/HTTPS 协议并调整相应配置，协议头可以是http或https。


或者使用 GitHub Container Registry：


XML/HTML代码


    docker run -d \

      --name oneclickvirt \

      -p 80:80 \

      -e FRONTEND_URL=&quot;https://your-domain.com&quot; \

      -v oneclickvirt-data:/var/lib/mysql \

      -v oneclickvirt-storage:/app/storage \

      --restart unless-stopped \

      ghcr.io/oneclickvirt/oneclickvirt:latest





方式二：自己编译打包


如果需要修改源码或自定义构建：


XML/HTML代码


    git clone https://github.com/oneclickvirt/oneclickvirt.git

    cd oneclickvirt

    

    

    docker build -t oneclickvirt .

    

    

    docker run -d \

      --name oneclickvirt \

      -p 80:80 \

      -v oneclickvirt-data:/var/lib/mysql \

      -v oneclickvirt-storage:/app/storage \

      --restart unless-stopped \

      oneclickvirt





方式三：手动开发部署


环境要求


Go 1.24.5


Node.js 22+


MySQL 8.0+


npm 或 yarn


环境部署


构建前端


XML/HTML代码


    cd web

    npm i

    npm run serve





构建后端


XML/HTML代码


    cd server

    go mod tidy

    go run main.go





开发模式下不需要反代后端，vite已自带后端代理请求。


在mysql中创建一个空的数据库oneclickvirt，记录对应的账户和密码。


访问前端地址，自动跳转到初始化界面，填写数据库信息和相关信息，点击初始化。


完成初始化后会自动跳转到首页，可以开始开发测试了。


本地开发


前端：http://localhost:8080


后端 API：http://localhost:8888


API 文档：http://localhost:8888/swagger/index.html


默认账户


系统初始化后会生成以下默认账户：


管理员账户：admin / Admin123!@#


普通用户：testuser / TestUser123!@#


提示：请在首次登录后立即修改默认密码。


配置文件


主要配置文件位于 server/config.yaml


演示截图









      




Docker安装：https://www.spiritlhl.net/guide/docker/docker_install.html


LXD安装：https://www.spiritlhl.net/guide/lxd/lxd_install.html




开设虚拟内存(SWAP)(非必须的可选项)


XML/HTML代码


    国际

    curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh &amp;&amp; chmod +x addswap.sh &amp;&amp; bash addswap.sh

    国内

    curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh &amp;&amp; chmod +x addswap.sh &amp;&amp; bash addswap.sh





Docker安装


XML/HTML代码


    国际

    curl -L https://raw.githubusercontent.com/oneclickvirt/docker/main/scripts/dockerinstall.sh -o dockerinstall.sh &amp;&amp; chmod +x dockerinstall.sh &amp;&amp; bash dockerinstall.sh

    国内

    curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/docker/main/scripts/dockerinstall.sh -o dockerinstall.sh &amp;&amp; chmod +x dockerinstall.sh &amp;&amp; bash dockerinstall.sh





LXD主体安装


XML/HTML代码


    国际

    curl -L https://raw.githubusercontent.com/oneclickvirt/lxd/main/scripts/lxdinstall.sh -o lxdinstall.sh &amp;&amp; chmod +x lxdinstall.sh &amp;&amp; bash lxdinstall.sh

    国内

    curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/lxd/main/scripts/lxdinstall.sh -o lxdinstall.sh &amp;&amp; chmod +x lxdinstall.sh &amp;&amp; bash lxdinstall.sh 





常用镜像：https://storage.spiritlhl.net/


使用此项目可以在docker中运行，管理其他设备的lxd和docker容器，或者kvm虚拟机，简单易用，支持nat v4和ipv6，作为自用的管理小鸡平台。


</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
