本教程适用于以下操作系统版本
- Debian 12 (Bookworm)
- Debian 11 (Bullseye)
- Debian 9 (Stretch)
本页内容
- 准备工作
- 安装并配置 MariaDB
- 安装 Pydio Cells
- 配置 Pydio Cells
- 访问 Pydio Cells 网页安装向导
- 为 Pydio Cells 创建 Systemd 服务文件
Pydio 是一款免费、开源且基于云端的文件共享应用。它使用 Golang 语言编写,用于与客户共享文件。借助移动应用、桌面软件或网页浏览器,你可以随时随地共享并访问文件、图片、视频等各类文档。它提供了适用于 Linux、Windows 和 macOS 的原生客户端,以及适用于 Android 和 iOS 的移动客户端。
在本教程中,我将向你展示如何在 Debian 11 上安装 Pydio 应用。
准备工作
- 一台运行 Debian 11 的服务器。
- 服务器上已配置 root 密码。
安装并配置 MariaDB
Pydio 使用 MariaDB 作为数据库后端,因此你必须在服务器上安装 MariaDB 数据库服务器。你可以通过运行以下命令来安装:
dnf install mariadb-server -y
MariaDB 安装完成后,使用以下命令加固 MariaDB 安装:
mysql_secure_installation
该脚本将设置 root 密码、删除匿名用户、禁止 root 远程登录并移除测试数据库,如下所示:
Set root password? [Y/n] n Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
MariaDB 加固完成后,登录 MariaDB shell:
mysql -u root -p
登录后,使用以下命令创建数据库和用户:
CREATE DATABASE pydiodb;
CREATE USER 'pydiodb'@'localhost' IDENTIFIED BY 'password';
接下来,使用以下命令为 Pydio 授予所有权限:
GRANT ALL PRIVILEGES ON pydiodb.* to 'pydiouser'@'localhost';
接下来,使用以下命令刷新权限并退出 MariaDB shell:
FLUSH PRIVILEGES;
EXIT;
安装 Pydio Cells
默认情况下,Debian 11 软件仓库中不包含 Pydio 软件包。因此你需要从其官方网站下载。
你可以使用以下命令下载最新版本的 Pydio cells:
distribId=cells wget -O /usr/bin/cells https://download.pydio.com/latest/${distribId}/release/{latest}/linux-amd64/${distribId}
下载完成后,为下载的文件设置可执行权限,并使用以下命令将其绑定到 HTTP 端口:
chmod +x /usr/bin/cells
setcap 'cap_net_bind_service=+ep' /usr/bin/cells
接下来,使用以下命令验证 Pydio cells 的版本:
cells version
你将看到如下输出:
Warning: no private IP detected for binding broker. Will bind to 209.23.9.181, which may give public access to the broker. Pydio Cells Home Edition Version: 3.0.6 Built: 22 Mar 22 06:06 +0su - pydio cells configure000 Git commit: 2165523347d2b9860d9c86236b7a518456d9cef3 OS/Arch: linux/amd64 Go version: go1.15.14
配置 Pydio Cells
接下来,你需要配置 Pydio Cells。你可以使用以下命令进行配置:
cells configure
系统会要求你在基于浏览器和命令行两种安装模式之间进行选择。
Welcome to Pydio Cells Home Edition installation Pydio Cells Home Edition (v3.0.3) will be configured to run on this machine. Make sure to prepare access and credentials to a MySQL 5.6+ (or MariaDB equivalent) server. Pick your installation mode when you are ready.
选择基于浏览器的安装方式并按 Enter 键。Pydio Cells 配置完成后,你将看到如下输出:
Use the arrow keys to navigate: ↓ ↑ → ←
? Installation mode:
? Browser-based (requires a browser access)
Command line (performed in this terminal)
? Browser-based (requires a browser access)
2022-04-02T11:16:18.544Z INFO pydio.gateway.rest Started
2022-04-02T11:16:18.685Z INFO pydio.rest.install Started
2022-04-02T11:16:22.010Z INFO
Installation Server is starting...
Listening to: 0.0.0.0:8080
2022-04-02T11:16:22.366Z INFO ? Created a new local CA at "/root/.config/pydio/cells/certs/rootCA.pem" ????
2022-04-02T11:16:22.366Z INFO ? Created a new certificate valid for the following names ???? - "127.0.0.1" - "209.23.9.181" - "localhost"
2022-04-02T11:16:22.366Z INFO ? The certificate is at "/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36.pem"
2022-04-02T11:16:22.366Z INFO and the key at "/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36-key.pem"
2022-04-02T11:16:22.366Z INFO
2022-04-02T11:16:22.366Z INFO ???? If you are behind a reverse proxy, you can either install the RootCA on the proxy machine trust store, or configure your proxy to `insecure_skip_verify` for pointing to Cells.
2022-04-02T11:16:22.367Z INFO ???? If you are developing locally, you may install the RootCA in your system trust store to see a green light in your browser!
2022-04-02T11:16:22.367Z INFO ???? To easily install the RootCA in your trust store, use https://github.com/FiloSottile/mkcert. Set the $CAROOT environment variable to the rootCA folder then use 'mkcert -install'
2022-04-02T11:16:22.367Z INFO
2022-04-02T11:16:22.367Z INFO Activating privacy features... done.
2022-04-02T11:16:22.367Z INFO https://0.0.0.0:8080
2022-04-02T11:16:22.367Z INFO WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with "ulimit -n 8192".
2022-04-02T11:16:24.365Z INFO pydio.gateway.proxy Restarting proxy {"caddyfile": "\n\n0.0.0.0:8080 {\n\troot \"/root/.config/pydio/cells/static/install\"\n\tproxy /install [::]:38327\n\n\t\n\ttls \"/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36.pem\" \"/root/.config/pydio/cells/certs/e6de382e6f121a9072d77b25ba622a36-key.pem\"\n}\n\n\n\n\t "}
2022-04-02T11:16:24.868Z INFO pydio.gateway.proxy Restart done
Opening URL https://0.0.0.0:8080 in your browser. Please copy/paste it if the browser is not on the same machine.
访问 Pydio Cells 网页安装向导
此时,Pydio Cells 已启动并监听 8080 端口。你可以通过 URL https://your-server-ip:8080 访问它。你应该会看到 Pydio Cells 许可协议页面:

同意许可协议并点击 NEXT 按钮。你应该会看到数据库配置页面。

填写你的数据库配置并点击 NEXT 按钮。你应该会看到管理员用户创建页面:

输入你的管理员用户名和密码,并点击 NEXT 按钮。你应该会看到如下页面:

现在,点击 INSTALL NOW 按钮。你应该会看到 Pydio Cells 登录页面:

输入你的管理员用户名和密码,并点击 ENTER 按钮。你应该会在接下来的页面中看到 Pydio 仪表盘:

为 Pydio Cells 创建 Systemd 服务文件
接下来,你需要创建一个 systemd 服务文件来管理 Pydio 服务。首先,按 CTRL+C 停止 Pydio 服务,然后使用以下命令创建 systemd 服务文件:
nano /etc/systemd/system/cells.service
添加以下内容:
[Unit] Description=Pydio Cells Documentation=https://pydio.com Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/bin/cells [Service] User=root Group=root PermissionsStartOnly=true AmbientCapabilities=CAP_NET_BIND_SERVICE ExecStart=/usr/bin/cells start Restart=on-failure StandardOutput=journal StandardError=inherit LimitNOFILE=65536 TimeoutStopSec=5 KillSignal=INT SendSIGKILL=yes SuccessExitStatus=0 WorkingDirectory=/root [Install] WantedBy=multi-user.target
保存并关闭文件,然后重新加载 systemd 守护进程以使更改生效:
systemctl daemon-reload
接下来,使用以下命令启动并启用 Pydio 服务:
systemctl enable cells
systemctl start cells
你也可以使用该命令检查 Pydio 的状态:
systemctl status cells
你将看到如下输出:
? cells.service - Pydio Cells
Loaded: loaded (/etc/systemd/system/cells.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2022-04-02 11:34:24 UTC; 6s ago
Docs: https://pydio.com
Main PID: 25764 (cells)
Tasks: 119 (limit: 2341)
Memory: 421.6M
CPU: 4.114s
CGroup: /system.slice/cells.service
??25764 /usr/bin/cells start
??25769 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.jobs$
??25775 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.search$
??25781 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.gateway.websocket$
??25783 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.pydiods1$
??25787 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.personal$
??25790 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.cellsdata$
??25802 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.versions$
??25805 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.sync.thumbnail>
??25816 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.tasks$
??25819 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.objects.local1$
??25847 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.pydiods1$
??25848 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.personal$
??25849 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.cellsdat>
??25850 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.versions$
??25851 /usr/bin/cells start --fork --config local --registry grpc://:8000 --broker grpc://:8003 ^pydio.grpc.data.index.thumbnai>
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.294Z INFO pydio.test.objects Started
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.307Z INFO pydio.gateway.grpc Activating self-signed configura>
Apr 02 11:34:29 debian11 cells[25764]: 2022-04-02T11:34:29.308Z INFO pydio.gateway.grpc Started
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.191Z INFO pydio.grpc.data.index.pydiods1 Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.194Z INFO pydio.grpc.data.index.personal Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.195Z INFO pydio.grpc.data.index.cellsdata Warning: no private>
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.204Z INFO pydio.grpc.data.index.thumbnails Warning: no privat>
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.212Z INFO pydio.grpc.data.index.versions Warning: no private >
Apr 02 11:34:30 debian11 cells[25764]: 2022-04-02T11:34:30.326Z INFO pydio.gateway.proxy Restarting proxy {"caddy>
总结
恭喜!你已成功在 Debian 11 上安装并配置了 Pydio Cells。现在你可以从 Pydio 仪表盘上传文件、文档和图片,并通过任意移动设备或网页浏览器访问。如有任何疑问,欢迎随时向我提问。