For AI agents: the complete documentation index is available at https://www.tteam.icu/zh/llms.txt, the full documentation bundle is available at https://www.tteam.icu/zh/llms-full.txt, and this page is available as Markdown at https://www.tteam.icu/zh/project/interesting/nextcloud.md.

nextcloud网盘

AI 总结AI 生成

核心内容:介绍 Nextcloud 私有网盘的 Docker 部署方式,对比 SQLite 和 PostgreSQL 两种数据库配置。

内容要点:

  • 使用 SQLite
  • 使用 PostgreSQL 作为数据库

适合在个人服务器、家庭实验室或轻量生产环境中按步骤部署与维护时参考。

Nextcloud 是功能完整的私有网盘和协作平台,适合文件同步、共享、日历、联系人和插件扩展等场景。

小规模个人测试可以使用 SQLite;如果要长期使用或多人访问,建议使用 PostgreSQL 作为数据库。

使用 SQLite

version: "2.1"
services:
  nextcloud:
    image: nextcloud
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
    volumes:
      - ./nextcloud/config:/config
      - ./nextcloud/data:/data
    ports:
      - 8087:80
    restart: unless-stopped

使用 PostgreSQL 作为数据库

version: '3'

services:
  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: nextcloud
    volumes:
      - ./db:/var/lib/postgresql/data

  app:
    image: nextcloud
    restart: always
    ports:
      - "8087:80"
    volumes:
      - ./nextcloud:/var/www/html
    depends_on:
      - db
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=nextcloud
Tip

生产使用时需要重点备份 nextcloud 数据目录、数据库和应用配置。反向代理后还要检查 trusted_domains、HTTPS 和上传文件大小限制。