相机上传(测试版):把 iPhone 照片备份到你自己的 Plex 服务器
当你的 iPhone 或 iPad 连接家中的 Wi-Fi 时,相机上传会把设备上的照片和视频备份到你家里的服务器。它们会和其他内容一起显示在 Plex 和 Phlix 中。不用云端,也不用订阅存储服务。你的照片只会传到你自己的服务器,不会传给其他任何人。
相机上传是测试版功能。它包含在 Phlix 1.0.21 或更高版本中。如果 App Store 中还没有这个版本,它正在准备上架。
相机上传由两部分组成。iPhone 或 iPad 上的 Phlix App 负责读取你的相机胶卷。你服务器上的一个小巧的免费程序,即相机上传助手,负责接收照片,并把它们写入你 Plex 照片图库中的一个文件夹。助手是一个 Docker 容器。
- 只在家中。Phlix 只通过家中的 Wi-Fi 上传,在其他任何地方都不会上传。绝不通过蜂窝网络上传。
- 只传给你。照片经过加密,从你的手机直接传到你的服务器,一张都不会传给 Phlix。
- 只做拷贝。绝不会删除或更改你手机上的任何内容。
背景:Plex 自己的相机上传功能已终止
Plex 从 2014 年起就有自己的相机上传功能。2021 年 3 月,Plex 在其论坛上宣布将终止对该功能的支持,并计划于 2021 年 6 月将其移除(Plex 的公告,存档副本)。
Phlix 的相机上传为 iPhone 和 iPad 重新带来了这一思路。Phlix 是一款可与 Plex Media Server 配合使用的独立 App,并非由 Plex 开发。详见完整经过(英文)。
所需条件
- 带有照片图库的 Plex Media Server,运行在装有 Docker 20.10 或更高版本的电脑或 NAS 上:Linux、装有 Docker Desktop 的 Mac 或 Windows PC、Synology(Container Manager、DSM 7.2 或更高版本)、Unraid,或 TrueNAS SCALE 24.10 或更高版本。Docker 是一款免费程序,它把其他程序放在叫作“容器”的封闭盒子里运行。Intel、AMD 和 Arm 处理器都可以使用。
- 装有 Phlix 1.0.21 或更高版本的 iPhone 或 iPad。如果 App Store 中还没有这个版本,它正在准备上架。
- 手机和服务器连接在同一个家庭网络中。
助手是免费的。在 App 中,前 100 次上传免费,其余的由 Phlix Pro 上传。在相机上传仍是测试版期间,无法替代的内容,请自己另外保留一份备份。详见测试版能做什么、不能做什么(英文)。
第 1 步:安装助手
正在用手机阅读?第 1 步要在服务器上完成。请在电脑上打开此页面,以便复制命令。
此操作只需在运行 Plex Media Server 的机器上做一次。首先确定你的上传文件夹,也就是手机照片要存入的文件夹。它必须位于你某个 Plex 照片图库所包含的文件夹之内,否则 Plex 永远不会显示这些照片。如果你的图库文件夹是 /mnt/media/Photos,那么 /mnt/media/Photos/Camera Uploads 是个不错的选择。
要查看图库的文件夹,请在浏览器中打开 Plex,前往“设置 › 管理 › 媒体库”,在你的照片图库上选择“编辑资料库”,然后选择“添加文件夹”。
你的 Plex 本身也在 Docker 中运行吗?这在 Unraid 和 TrueNAS SCALE 上很常见。这时 Plex 显示的是文件夹在它自己容器内的路径,例如 /data/Photos。而助手需要的是文件夹在服务器上的路径,例如 /mnt/media/Photos。详见如何找到这两个路径(英文)。
安装助手有三种方式。方式 B 适用于所有系统。在 Unraid、Synology 和 TrueNAS SCALE 上,请改用下方针对你系统的说明,而不是方式 A 和 C。
这些命令要在服务器的终端中输入:在 Mac 上使用名为“终端”的 App;在 Windows 上使用 PowerShell;在 Linux 上使用终端程序,或从另一台电脑通过 SSH 连接。方框中的命令都带有复制按钮。如果 Docker 提示“permission denied”,请在每条 docker 命令前加上 sudo。
A. 一条命令 快速
适用于 Linux 电脑或服务器,以及装有 Docker Desktop 的 Mac。不适用于 Windows、Unraid 或 TrueNAS SCALE。
将以下命令粘贴到服务器的终端中:
curl -fsSL https://phlixapp.com/camera-upload/install.sh | sh安装程序会检查 Docker,并询问你的上传文件夹。它会在你的主目录中新建一个名为 phlix-camera-upload 的文件夹,把 Compose 文件 docker-compose.yml 写入其中,然后启动助手并运行检查。一切正常时,它会输出 Phlix Camera Upload is running.,下面还有一行以 Status page: 开头,给出助手状态页面的地址。
它绝不使用 sudo,绝不更改 Plex,也绝不删除任何照片。运行前你可以先阅读脚本,还可以先加上 --dry-run 试运行,这样不会做任何更改:
curl -fsSL https://phlixapp.com/camera-upload/install.sh | sh -s -- --dry-run以后随时再次运行安装程序,即可更新助手。GitHub 仓库中也有同一个脚本。
B. 交给 AI 助理
文件 SETUP-WITH-AI.md 包含为 AI 助理编写的完整说明:如何找到 Plex 图库的文件夹、安装助手、检查安装,以及解决出现的问题。AI 助理在更改助手自己文件夹以外的任何内容之前,都会先询问你。该文件是英文的,但 AI 助理可以用中文与你交流。
如果你使用的 AI 助理能在服务器上运行命令(Claude Code、Codex、Gemini CLI、Cursor 等类似工具),请在服务器上新建一个空文件夹,并在其中运行:
curl -fsSLO https://phlixapp.com/camera-upload/SETUP-WITH-AI.md然后在该文件夹中启动 AI 助理,并对它说:按照 SETUP-WITH-AI.md 操作
Claude Code 还可以把设置流程添加为一项技能,只需在终端中运行一次:
claude plugin marketplace add jrl8085/phlix-camera-upload
claude plugin install phlix-camera-upload@phlix然后在服务器上启动 Claude Code,并说:在这台服务器上设置 Phlix Camera Upload
如果使用 ChatGPT 或 Claude App 等聊天助理:把文件 SETUP-WITH-AI.md 发给它,并说请一步一步带我完成这些操作。它会逐条告诉你命令,你在服务器上运行后,再把输出的内容粘贴回去。
C. 使用 Docker Compose 手动安装
适合想看清每一步的人,可用于 Linux、Mac 或 Windows PC。共六步,只需编辑一行。
- 以照片所有者的用户身份创建上传文件夹。助手会以此文件夹所有者的身份写入文件。
mkdir "/mnt/media/Photos/Camera Uploads" - 为助手创建一个文件夹,并进入该文件夹。
mkdir phlix-camera-upload cd phlix-camera-upload - 下载 Compose 文件
docker-compose.yml:这是一个小型文本文件,用来告诉 Docker 如何运行助手。curl -fsSLO https://phlixapp.com/camera-upload/docker-compose.yml - 用文本编辑器打开
docker-compose.yml。找到注释CHANGE THE NEXT LINE,在它的下一行,把/CHANGE/THIS/Photos/Camera Uploads替换为你的上传文件夹。保存文件。 - 启动助手。第一次启动时,Docker 会下载镜像,也就是打包成 Docker 格式的助手。
docker compose up -d - 让助手检查一切是否正常。
docker exec phlix-camera-upload python -m phlix_upload doctor
Compose 文件(与下载的内容完全相同)
文件中的注释是英文的。只需修改 CHANGE THE NEXT LINE 下面的那一行。
# Phlix Camera Upload
#
# This file starts the helper that receives the photos and videos the Phlix
# app uploads from your iPhone or iPad, and writes them into a folder of your
# Plex photo library.
#
# How to use this file:
# 1. Change the one line marked CHANGE THE NEXT LINE below.
# 2. In the folder that holds this file, run: docker compose up -d
# 3. Open https://YOUR-SERVER:7459 in a browser to check that it runs.
# The browser warns about the certificate. That is expected.
#
# If something does not work, ask the helper what is wrong:
# docker exec phlix-camera-upload python -m phlix_upload doctor
#
# Setup guide: https://phlixapp.com/camera-upload/
# If the app cannot find the helper:
# https://github.com/jrl8085/phlix-camera-upload/blob/main/NETWORKING.md
services:
phlix-camera-upload:
image: ghcr.io/jrl8085/phlix-camera-upload:1
container_name: phlix-camera-upload
# Start again by itself when the server or Docker restarts.
restart: unless-stopped
# The Phlix app looks for the helper on port 7459 of your server.
ports:
- "7459:7459"
volumes:
# Your upload folder: the folder on this server where the photos go.
#
# It must be inside a folder that one of your Plex photo libraries
# includes. If it is not, Plex never shows the photos.
#
# Make the folder before you start the helper. Docker refuses to start
# the helper if the folder is missing. The helper writes files as the
# user who owns the folder.
#
# Write the path as it is on the server itself. If Plex runs in Docker,
# do not use the path from inside the Plex container.
#
# Examples:
# Linux /mnt/media/Photos/Camera Uploads
# Synology /volume1/photo/Camera Uploads
# TrueNAS /mnt/tank/media/Photos/Camera Uploads
# Mac /Users/you/Pictures/Camera Uploads
# Windows C:\Users\you\Pictures\Camera Uploads
#
# Spaces in the path are fine. If the path has a "#" after a space, or
# a ":" before a space, put the whole path in 'single quotes'.
- type: bind
# CHANGE THE NEXT LINE. Keep "source: " and write your folder after it.
source: /CHANGE/THIS/Photos/Camera Uploads
target: /photos
bind:
create_host_path: false
# The helper's own data: the list of paired phones, the list of files
# it has received, and its certificate. No photos are kept here.
# Docker makes a folder named "config" next to this file. Keep it: if
# it is lost, every phone has to pair again.
# If your tool has no "next to this file" (TrueNAS, Portainer), write a
# full path in place of ./config, for example:
# /mnt/tank/apps/phlix-camera-upload:/config
- ./config:/config
# Lets the helper find Plex Media Server on this machine.
extra_hosts:
- "host.docker.internal:host-gateway"
# The helper can never gain more rights than it was started with.
security_opt:
- "no-new-privileges:true"
# Optional settings. The helper works without any of them.
#
# To use one, remove the "# " in front of "environment:" and in front of
# the setting you want. Leave the other spaces as they are. Then run
# "docker compose up -d" again.
#
# environment:
# # Where Plex Media Server is. Set this if the helper's status page
# # says "Plex Media Server: Not found", or to make sure that the helper
# # asks your own server and no other.
# PLEX_URL: "http://192.168.1.10:32400"
#
# # Write files as this user and group. Without these, the helper uses
# # the owner of the upload folder.
# PUID: "1000"
# PGID: "1000"
#
# # Permissions for new files and folders. With 022, other users may
# # read them. With 002, the group may also change them.
# UMASK: "022"
#
# # The name that the app and the status page show for this helper.
# NAME: "Phlix Camera Upload"
#
# # Who may pair. auto: the owner of the Plex server pairs without a
# # code and everyone else types the pairing code. code: everyone types
# # the code. plex: only the owner of the Plex server may pair.
# PAIRING: "auto"
#
# # Your own pairing code, in place of the one the helper makes. Write
# # at least 6 letters or digits between the quotes.
# PAIRING_CODE: ""
#
# # The folders the helper makes inside the upload folder. You can use
# # {device}, {year}, {month} and {day}.
# PATH_TEMPLATE: "{device}/{year}/{year}-{month}"
#
# # Refuse uploads that would leave less than this many GB free. Uploads
# # that are still arriving count too.
# MIN_FREE_GB: "2"
#
# # The largest single file the helper accepts, in GB.
# MAX_UPLOAD_GB: "50"
#
# # More file types to accept, besides the usual photo and video types.
# # Separate them with commas.
# EXTRA_EXTENSIONS: "insp,lrv"
#
# # How much the log says: debug, info, warning or error.
# LOG_LEVEL: "info"
#
# # Write "off" only if your own reverse proxy adds HTTPS in front of
# # the helper. Phlix talks HTTPS only: with "off" and no such proxy,
# # the app cannot use the helper.
# TLS: "on"
#
# # Your own certificate and its key, as paths inside the container.
# # Set both. A file you put in the config folder is at /config/...
# TLS_CERT: "/config/my-cert.pem"
# TLS_KEY: "/config/my-key.pem"
#
# PORT, BIND, UPLOAD_DIR and CONFIG_DIR exist too. With Docker you do not
# need them. To use another port on your server, change only the first
# number in the "ports" line above, for example "8443:7459". The app
# looks for port 7459 by itself, so with another port you type the
# helper's address into the app.
Unraid、Synology、TrueNAS SCALE、Windows
- Unraid 没有 Docker Compose。请在你的 Plex 照片图库所包含的共享文件夹中创建上传文件夹,用
chown 99:100把它交给 Unraid 的标准用户,再用下面的命令下载模板,然后在 Docker 标签页中选择“Add Container”,并选取phlix-camera-upload。详见Unraid 的操作步骤(英文)。mkdir "/mnt/user/Photos/Camera Uploads" chown 99:100 "/mnt/user/Photos/Camera Uploads"wget -O /boot/config/plugins/dockerMan/templates-user/my-phlix-camera-upload.xml https://raw.githubusercontent.com/jrl8085/phlix-camera-upload/main/unraid/phlix-camera-upload.xml - Synology:在 Container Manager 中创建一个名为
phlix-camera-upload的项目,粘贴 docker-compose.yml 的内容,并填入上传文件夹的完整路径,例如/volume1/photo/Camera Uploads。详见Synology 的操作步骤(英文)。 - TrueNAS SCALE:不要使用方式 A。前往“Apps › Discover Apps”,选择“Install via YAML”,粘贴 Compose 文件,并写明完整路径。详见TrueNAS SCALE 的操作步骤(英文)。
- 装有 Docker Desktop 的 Mac 或 Windows PC:在 Windows 上,请使用方式 B 或 C,并在本页写
curl的地方输入curl.exe。只有在 Docker Desktop 运行且电脑未进入睡眠时,才能上传。详见Mac 和 Windows 的说明(英文)。
检查是否正常运行
在家庭网络中的另一台设备上,用浏览器打开助手的状态页面。把 SERVER 替换为你服务器的地址,例如 https://192.168.1.10:7459:
https://SERVER:7459浏览器会警告此连接不是私密连接。这是正常现象。家用服务器没有可以让证书颁发机构担保的公开名称,因此助手会自己生成证书。请继续访问该页面。Phlix 不依赖浏览器的检查:它会在配对时记住助手的确切证书。
页面上应显示 Upload folder: Ready 和 Plex Media Server: Found。如果显示的是其他内容,doctor 命令会告诉你该怎么做:
docker exec phlix-camera-upload python -m phlix_upload doctorPhlix Camera Upload 1.0.1
OK The helper is running on port 7459
OK The upload folder /photos can be written to.
OK 223.6 GB free on the upload disk.
OK Plex Media Server found: its owner can pair from Phlix without a code.
OK 1 paired, 37 files stored (33.0 MB).
NOTE Pairing code: run `python -m phlix_upload code` the same way to see it.
Nothing needs fixing.
以 PROBLEM 开头的行后面,会跟着一行以 Fix: 开头的内容。
Plex 中的一项设置。Plex 只有在扫描之后才会显示新文件。如果服务器归你的 Plex 账户所有,照片到达后,Phlix 会请求 Plex 进行扫描。为了家里的其他人,也为保险起见,请在 Plex 中打开“设置 › 资料库 › 自动扫描我的资料库”。此设置默认关闭。
第 2 步:连接你的 iPhone
- 将 iPhone 或 iPad 连接到家中的 Wi-Fi。
- 打开 Phlix,前往“设置”›“相机上传”。如果“设置”中没有“相机上传”这一项,说明你的 Phlix 版本低于 1.0.21。“设置”中的“版本”一项会显示版本号。
- 轻点“查找助手”,然后轻点“检查我的网络”。Phlix 会在你 Plex 服务器的地址上查找助手。找到助手之前,不会打开任何功能,也不会上传任何内容。如果 iOS 询问是否允许 Phlix 查找本地网络上的设备,请允许。
- 当 Phlix 显示“已找到助手”时,为这台设备选择一个文件夹名称,例如“小明的 iPhone”,然后轻点“连接”。请慎重选择名称:设备会一直使用它首次配对时获得的文件夹。
- 如果 Phlix 接着显示“输入配对码”,请输入助手的配对码,然后轻点“配对”。拥有自己 Plex 账户的家庭成员会看到这一步。下方的“谁需要配对码”说明了在哪里找到配对码。
- Phlix 会显示“已连接”。选择要备份的内容:“此设备上的全部内容”或“仅新照片”,然后轻点“打开相机上传”。
- iOS 会询问是否允许 Phlix 读取你的照片。请选择“完全访问”,这样它才能备份所有照片。
看到绿点和“已连接到 …”(“…”即助手的名称),表示连接正常。灰色表示你不在家,此时 Phlix 会等待。橙色表示有情况需要你处理,页面上会说明是什么情况。
谁需要配对码
- 你是 Plex 服务器的所有者:只要助手的状态页面显示
Plex Media Server: Found,Phlix 无需配对码即可配对。App 会向助手出示一个来自你 Plex 服务器的短期令牌,助手向 Plex 确认它是否属于服务器所有者,然后丢弃这个令牌。 - 其他所有人,例如拥有自己 Plex 账户的家庭成员,需要输入助手的配对码。服务器所有者可以用下面的命令找到配对码,也可以在助手每次启动时的日志中找到。大小写、空格和连字符都无关紧要:
docker exec phlix-camera-upload python -m phlix_upload code
如果 Phlix 显示“未找到助手”,相机上传会保持关闭,也不会向任何地方发送任何内容。详见App 找不到助手(英文)。
接下来会怎样
- Phlix 打开时,上传会立即开始,速度只受你的 Wi-Fi 限制。首次大量备份时,把手机接上充电器并保持“相机上传”页面打开,速度会更快。
- Phlix 关闭时,iOS 只让它断断续续地短暂运行,而且多半是在手机充电时。iOS 对所有 App 都是这样处理的,这意味着大型图库需要在后台花上几天。之后的新照片会自动跟上。
- 不在家时,不会发送任何内容,Phlix 甚至不会查找你的服务器。手机重新连上家中的 Wi-Fi 后,备份会继续进行。
- 全部备份完成后,页面会显示“已全部备份”。打开“备份完成时通知我”,还能收到通知。
Phlix 会上传你自己照片图库中的照片和视频,每项只上传一次,上传的是它当时在“照片”中的样子。视频可选(“包括视频”);除非你打开“包括截屏”,否则不会上传截屏。实况照片会作为静态照片上传。已隐藏的照片、共享相簿和从电脑同步的照片不会上传。
照片存到哪里
每台手机或平板电脑在上传文件夹中都有自己的文件夹,里面再按年、按月分别建立文件夹:
Camera Uploads/
Anna's iPhone/
2026/
2026-11/
IMG_1234.HEIC
IMG_1235.MOV
Ben's iPad/
2026/
2026-10/
- 年份和月份取自照片本身的日期。文件会保留它在手机上的名称。
- 两张不同的照片即使同名,也都会保留。任何内容都绝不会被覆盖。
- 两台手机上的同一张照片只存储一次。
隐私与安全
- 你的照片留在你的网络中。手机会把照片直接发送到你的服务器。开发者 Phlix 绝不会收到这些照片,也无法访问它们。助手不连接互联网上的任何地方,它唯一联系的就是你自己的 Plex Media Server。
- 连接经过加密。手机配对时,Phlix 会记住助手的确切证书。此后,它只与出示该证书的服务器通信。
- 配对需要证明。Plex 服务器的所有者通过 Plex 证明身份,而且助手绝不会存储 Plex 令牌。其他人需要配对码;对于试图猜测配对码的人,助手会放慢响应速度。
- 已配对的手机只能添加。助手不提供任何列出、读取、下载、覆盖或删除已存储文件的方式。它只接受照片和视频文件。
- 你可以查看代码。助手的源代码公开在 GitHub 上,并附有安全说明。完整说明见隐私政策(英文)。
帮助与故障排除
先运行助手自带的检查。它会测试安装情况,并告诉你如何修复问题:
docker exec phlix-camera-upload python -m phlix_upload doctor在 Phlix 中,“相机上传”页面会指出它发现的问题,轻点“检查连接”即可再试一次。每种问题在完整指南(英文)中都有单独的章节:
- App 找不到助手
- 照片没有出现在 Plex 中
- 配对不成功
- 文件的所有者不对,或助手无法写入
- 助手无法启动
- 网络帮助:防火墙、访客 Wi-Fi、VPN、在 Docker 中运行的 Plex
- 以后的更改:更新、移动或移除助手
GitHub 上的简体中文版助手说明:README。助手的问题可以在 GitHub Issues 上报告,其他问题请前往支持页面。
常见问题
相机上传是测试版吗?
是的。相机上传是 Phlix 1.0.21 或更高版本中的测试版功能。无法替代的内容,请自己另外保留一份备份;遇到问题,请告诉我们:在 Phlix 中打开“设置”,然后轻点“发送反馈”。
Plex 自己的相机上传怎么了?
Plex 于 2021 年 3 月宣布将终止对其相机上传功能的支持,并计划于 2021 年 6 月将其移除。Phlix 的相机上传是一款独立 App 中的一项单独的功能:它通过你自己服务器上的助手,把照片拷贝到你 Plex 照片图库中的一个文件夹。
它会删除我 iPhone 上的照片吗?
不会。Phlix 会把你的照片和视频拷贝到你的服务器。它绝不会删除或更改你照片图库中的任何内容。
不在家时或使用蜂窝网络时能用吗?
不能,这是有意为之。Phlix 只在手机连接家中的 Wi-Fi 时上传。不在家时,它不发送任何内容,也不会查找你的服务器。旅行时拍的照片会在你回家后上传。
需要 Plex Pass 吗?
不需要。助手只是把普通文件写入你 Plex 照片图库中的一个文件夹,任何 Plex Media Server 都支持这种方式。
需要多少费用?
服务器上的助手是免费的。在 App 中,前 100 次上传免费,其余的由 Phlix Pro 上传。
全家人都能用吗?
能。每台 iPhone 和 iPad 都单独配对,并获得自己的文件夹。Plex 服务器的所有者无需配对码即可配对;其他人需要输入助手的配对码。如果两台手机上有同一张照片,服务器只存储一次。
这是同步吗?如果我删除了照片会怎样?
这是从手机到服务器的单向拷贝。在手机上删除照片后,服务器上的副本仍会保留。每张照片只上传一次。
能和 iCloud 照片一起使用吗?
能。无论 iOS 把照片存放在哪里,Phlix 都会读取你照片图库中的照片。如果开启了“优化 iPhone 储存空间”,iOS 会在 Phlix 请求时从 iCloud 下载全尺寸原件。共享相簿不包括在内。
Phlix 是 Plex 开发的吗?
不是。Phlix 是一款可与 Plex Media Server 配合使用的独立 App,与 Plex, Inc. 没有关联,也未获得 Plex, Inc. 的认可或赞助。
Phlix:让你的 Plex 照片得到应有的呈现
按日期排列的时间线,还能在电视大屏幕上放映幻灯片。从 1.0.21 版起,还提供相机上传(测试版):把相机胶卷备份到你自己的服务器。
免费下载 PhlixiPhone 和 iPad · iOS 17 或更高版本。相机上传需要 Phlix 1.0.21 或更高版本。如果 App Store 中还没有这个版本,它正在准备上架。