Dashy 自定义首页仪表板搭建教程

Dashy 是一款功能丰富的开源首页仪表板应用,可以将你的所有自托管服务、常用网站和工具集中在一个美观的页面上。Dashy 支持高度自定义的布局和主题、服务状态监控、多种小部件以及用户认证等功能。本文将介绍如何在搬瓦工 VPS 上使用 Docker 部署 Dashy。部署前请确保已安装好 Docker 和 Docker Compose

一、系统要求

  • 操作系统:Ubuntu 20.04+ 或 Debian 11+。
  • 内存:512MB 即可。
  • 磁盘:不到 1GB 空间。

二、使用 Docker 快速部署

mkdir -p /opt/dashy
cd /opt/dashy

cat > /opt/dashy/docker-compose.yml <<'EOF'
version: '3.8'

services:
  dashy:
    image: lissy93/dashy:latest
    restart: always
    ports:
      - "4000:8080"
    volumes:
      - /opt/dashy/conf.yml:/app/user-data/conf.yml
    environment:
      - NODE_ENV=production
    healthcheck:
      test: ["CMD", "node", "/app/services/healthcheck"]
      interval: 1m30s
      timeout: 10s
      retries: 3
EOF

三、创建配置文件

Dashy 通过 YAML 配置文件管理所有内容。创建 conf.yml

cat > /opt/dashy/conf.yml <<'EOF'
pageInfo:
  title: My HomeLab Dashboard
  description: 服务导航面板
  navLinks:
    - title: GitHub
      path: https://github.com
    - title: Blog
      path: https://yourdomain.com

appConfig:
  theme: colorful
  layout: auto
  iconSize: medium
  language: zh-CN
  statusCheck: true
  statusCheckInterval: 300

sections:
  - name: 基础设施
    icon: fas fa-server
    items:
      - title: 搬瓦工 KiwiVM
        description: VPS 管理面板
        url: https://kiwivm.64clouds.com
        icon: fas fa-cloud
      - title: Nginx Proxy Manager
        description: 反向代理管理
        url: https://npm.yourdomain.com
        icon: fas fa-shield-alt
        statusCheck: true

  - name: 开发工具
    icon: fas fa-code
    items:
      - title: Gitea
        description: 代码托管
        url: https://git.yourdomain.com
        icon: fab fa-git-alt
        statusCheck: true
      - title: n8n
        description: 工作流自动化
        url: https://n8n.yourdomain.com
        icon: fas fa-robot
        statusCheck: true

  - name: 监控与统计
    icon: fas fa-chart-line
    items:
      - title: Umami
        description: 网站统计
        url: https://analytics.yourdomain.com
        icon: fas fa-chart-bar
        statusCheck: true
      - title: Uptime Kuma
        description: 服务监控
        url: https://uptime.yourdomain.com
        icon: fas fa-heartbeat
        statusCheck: true

  - name: 存储与媒体
    icon: fas fa-hdd
    items:
      - title: Nextcloud
        description: 私有云盘
        url: https://cloud.yourdomain.com
        icon: fas fa-cloud-upload-alt
        statusCheck: true
      - title: Jellyfin
        description: 媒体服务器
        url: https://media.yourdomain.com
        icon: fas fa-film
        statusCheck: true
EOF

四、启动 Dashy

cd /opt/dashy
docker compose up -d

访问 http://your-server-ip:4000 即可看到仪表板。

五、配置 Nginx 反向代理

cat > /etc/nginx/sites-available/dashy <<'EOF'
server {
    listen 80;
    server_name dash.yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:4000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
EOF

ln -s /etc/nginx/sites-available/dashy /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d dash.yourdomain.com

六、主题与外观定制

Dashy 内置了多种主题,在 appConfig 中通过 theme 字段设置。常用主题包括:

  • default:默认浅色主题。
  • colorful:色彩丰富的主题。
  • material-dark:Material Design 深色主题。
  • dracula:流行的 Dracula 配色。
  • nord:Nord 配色方案。
  • one-dark:Atom One Dark 配色。

你也可以通过自定义 CSS 实现完全个性化的外观。在 appConfig 中添加:

appConfig:
  customCss: |
    .item {
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

七、小部件功能

Dashy 支持丰富的小部件(Widgets),可以在仪表板上显示实时信息。在配置文件中添加小部件:

sections:
  - name: 系统信息
    icon: fas fa-info-circle
    displayData:
      collapsed: false
    widgets:
      - type: clock
        options:
          timeZone: Asia/Shanghai
          format: zh-CN
      - type: system-info
      - type: public-ip

八、认证设置

为仪表板添加访问认证,防止未授权用户查看你的服务列表:

appConfig:
  auth:
    users:
      - user: admin
        hash: your_sha256_password_hash
        type: admin
      - user: guest
        hash: guest_password_hash
        type: normal

生成密码哈希:

echo -n 'your_password' | sha256sum | awk '{print $1}'

九、服务状态监控

appConfig 中启用 statusCheck: true 后,Dashy 会定期检测每个标记了 statusCheck: true 的服务是否在线。状态图标会用绿色(正常)、橙色(响应慢)或红色(离线)来标识。

十、常见问题

修改配置不生效

修改 conf.yml 后需要重启容器:

cd /opt/dashy
docker compose restart

图标无法显示

Dashy 支持 Font Awesome 图标、favicon 自动获取和自定义图片 URL。如果 favicon 获取失败,可以使用 Font Awesome 图标或直接指定图片地址。

总结

Dashy 是一款功能强大且高度可定制的首页仪表板,非常适合管理多个自托管服务。资源占用极低,在搬瓦工最低配方案上也能流畅运行。更多仪表板和服务部署教程请参考:Homer 仪表板Homarr 仪表板Docker 安装教程。选购搬瓦工 VPS 请参考全部方案,购买时使用优惠码 NODESEEK2026 可享受 6.77% 的循环折扣。

关于本站

搬瓦工VPS中文网(bwgvps.com)是非官方中文信息站,整理搬瓦工的方案、优惠和教程。我们不销售主机,不提供技术服务。

新手必读
搬瓦工优惠码

NODESEEK2026(优惠 6.77%)

购买时填入即可抵扣。