部署实战4 min read0 views

Ente Photos 自托管部署教程:端到端加密的家庭相册

Ente Photos 服务端零知识,照片在手机上加密后才上传。本文按官方 quickstart 部署,并解决域名、HTTPS、对象存储与验证码问题。

Ente Photos 自托管部署教程:端到端加密的家庭相册

Ente Photos 是开源相册里少见的「端到端加密」方案:照片在设备上加密后才上传,服务器只存密文。它提供 iOS、Android、Web、桌面全平台客户端,自建后可以完全替代云相册。这篇教程按官方 quickstart 部署一套可用的实例,并说明域名、HTTPS 与备份的关键点。

一、部署前必须知道的三件事

  1. 手机 App 强制 HTTPS:自建服务器地址必须是 https://,纯 IP + HTTP 连不上。准备两个域名,例如 photos.example.com(Web)和 api.example.com(API)。
  2. 至少 2 核 4GB,照片存对象存储(MinIO 或外部 S3),数据库用 PostgreSQL。
  3. museum.yaml 是密钥文件:里面是数据库和对象存储凭据,丢了等于数据打不开,务必备份。

二、镜像与端口

服务镜像端口
museum(API)ghcr.io/ente-io/server8080
web(Photos)ghcr.io/ente/web3000
web(公开相册)ghcr.io/ente/web3002
postgrespostgres:15内部
miniopgsty/silo3200

三、用官方 quickstart 生成配置

mkdir -p /opt/ente && cd /opt/ente
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ente/ente/main/server/quickstart.sh)"

脚本会创建 my-ente/,里面生成 compose.yaml、museum.yaml,并自动填好随机密码。进入目录查看:

cd my-ente
ls -l
docker compose up -d
docker compose ps

启动后本机可以访问:Photos http://IP:3000、API http://IP:8080/ping、公开相册 http://IP:3002。

四、改成自己的域名与公网地址

默认 museum.yaml 里的 S3 endpoint 指向 localhost:3200,只适合本机测试。要让手机 App 上传,必须让客户端能访问到对象存储,两种做法:

  • 简单做法:给 MinIO 也配一个 HTTPS 域名(例如 s3.example.com),把 museum.yaml 里的 endpoint 改成 s3.example.com,并让反代转发到 3200。
  • 推荐做法:生产环境直接换成外部 S3(Cloudflare R2、Backblaze B2、阿里云 OSS 等),把 are_local_buckets 设为 false,填好 key/secret/endpoint。

另外把 compose.yaml 里 web 的 ENTE_API_ORIGIN 改成 https://api.example.com,否则前端仍然请求 localhost。

五、反向代理

三个入口分别反代,注意上传体积与超时:

server {
    listen 443 ssl http2;
    server_name photos.example.com;
    ssl_certificate     /etc/letsencrypt/live/photos.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/photos.example.com/privkey.pem;

    client_max_body_size 0;
    proxy_request_buffering off;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 600s;
    }
}

把 photos.example.com 换成 api.example.com 指向 8080,albums.example.com 指向 3002,s3.example.com 指向 3200(如果用本地 MinIO)。

六、注册与验证码

  1. 打开 https://photos.example.com,注册账号。
  2. 注册需要邮箱验证码。自建实例不发邮件,验证码直接打在 museum 日志里:
docker compose logs museum | grep -i "verification\|otp" | tail -20
  1. 登录后创建相册、邀请家人;手机 App 里「设置 → 服务器 → 自定义服务器」填 https://api.example.com。
Ente Photos Web 时间线
Ente Photos 的 Web 端时间线,数据在服务端是密文

七、备份

  • my-ente/museum.yaml:凭据与密钥,单独备份。
  • PostgreSQL 数据卷:docker compose exec postgres pg_dump -U pguser ente_db > ente.sql。
  • MinIO 数据卷(或外部 S3 桶):照片密文本体。

三者缺一不可。建议每周自动备份数据库与 museum.yaml,对象存储开启版本控制。

Ente 架构
Ente 架构:客户端加密后经 museum 写入对象存储

八、常见问题

手机 App 提示无法连接服务器? 99% 是 HTTPS 或证书问题;先用手机浏览器打开 https://api.example.com/ping,能返回 pong 再连 App。

上传失败? 检查 museum.yaml 的 S3 endpoint 是否是手机能访问的公网地址,以及桶是否存在。

忘记管理员密码? Ente 的密码参与密钥派生,无法在服务端重置;务必保存好恢复密钥。

九、小结

Ente 的部署比 Immich 复杂一点,换来的是「服务器也看不到你的照片」。如果你在意隐私、又想要接近商业云相册的体验,它值得这一小时的折腾。

相关阅读:Immich 部署教程 · 2026 开源家庭相册横评

MORE / 03

Keep reading

ChronoFrame Docker Deployment: A One-Command Self-Hosted Portfolio
部署实战

ChronoFrame Docker Deployment: A One-Command Self-Hosted Portfolio

2026.11.14 · 3 min read

Piwigo Docker Deployment: The Veteran Open-Source Family Gallery
部署实战

Piwigo Docker Deployment: The Veteran Open-Source Family Gallery

2026.11.14 · 3 min read

Lychee Docker Deployment: A Beautiful Family Photo Album
部署实战

Lychee Docker Deployment: A Beautiful Family Photo Album

2026.11.14 · 3 min read

StarCode

Discover and share great open-source projects. We serve developers and carry the spirit of the internet forward.

Contact

WeChat / advertising: ITcloub (please mention StarCode)

Disclaimer: Resources on this site remain the property of their original authors and are for learning and exchange only. For copyright concerns, contact us via About us → Copyright complaints.

Powered by Nuxt · Deployed on Cloudflare