Seafile office online 部署

PointY Lv1

提前准备

  • CPU:双核2GHz或更高
  • 内存:4GB或以上
  • 硬盘:至少有40GB的空闲空间
  • SWAP:至少4GB,但取决于主机作系统。多一点更好
  • OS:内核版本3.10或更高版本的amd64 Linux发行版
  • Docker:Docker 团队支持的任何版本

DockerCompose安装

克隆仓库

1
git clone https://github.com/ONLYOFFICE/Docker-DocumentServer

编辑docker-compose.yml文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
services:
onlyoffice-documentserver:
build:
context: .
image: onlyoffice/documentserver #[-de,-ee]
container_name: onlyoffice-documentserver
depends_on:
- onlyoffice-postgresql
- onlyoffice-rabbitmq
environment:
- DB_TYPE=postgres
- DB_HOST=onlyoffice-postgresql
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
# Uncomment strings below to enable the JSON Web Token validation.
# 允许访问私有IP地址
- ALLOW_PRIVATE_IP=true
# 其他安全设置
- JWT_ENABLED=false
# 配置内部URL
- SERVER_ROOT=http://192.168.2.165:8088
# 不使用本地回环地址,使用容器名或内部IP
- DOC_SERVICE_URL=http://onlyoffice-documentserver/
- DOC_EDITOR_URL=http://192.168.2.165:8088/
- STORAGE_URL=http://192.168.2.165:8088/
ports:
- "8088:80" # 端口映射
extra_hosts:
- "192.168.2.165:127.0.0.1" # 将内网IP映射到容器内部
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/info/info.json"]
interval: 30s
retries: 5
start_period: 60s
timeout: 10s
stdin_open: true
restart: always
stop_grace_period: 60s
volumes:
- D:/onlyoffice_docker/data:/var/www/onlyoffice/Data # 数据存储目录
- D:/onlyoffice_docker/logs:/var/log/onlyoffice # 日志目录
- D:/onlyoffice_docker/lib:/var/lib/onlyoffice/documentserver/App_Data/cache/files # 库目录
- D:/onlyoffice_docker/www:/var/www/onlyoffice/documentserver-example/public/files # 文件目录
- D:/onlyoffice_docker/fonts:/usr/share/fonts # 字体目录

onlyoffice-rabbitmq:
container_name: onlyoffice-rabbitmq
image: rabbitmq:3
restart: always
privileged: true
expose:
- '5672'
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "status"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s

onlyoffice-postgresql:
container_name: onlyoffice-postgresql
image: postgres:15
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_HOST_AUTH_METHOD=trust
restart: always
expose:
- '5432'
volumes:
- D:/onlyoffice_docker:/var/lib/postgresql # 数据存储目录
healthcheck:
test: ["CMD-SHELL", "pg_isready -U onlyoffice"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s

volumes:
postgresql_data:

拉取完成后,我们先创建以下文件结构

1
2
3
4
5
6
D:/onlyoffice_docker/
├── logs/ # 日志目录
├── data/ # 文档数据目录
├── lib/ # 库目录
└── db/ # 数据库目录
└── www/ # 文件目录

管理员权限打开 power shell,输入以下命令启动容器

1
docker compose up -d

等待启动完成即可,查看日志确认启动成功

1
2
3
4
5
6
7
8
9
10
11
Installing plugins, please wait...Done

Starting supervisor: supervisord.

* Starting periodic command scheduler cron

...done.

* Starting nginx nginx

...done.

浏览器打开
http://localhost:8088

onlineoffice_welcome

滑动到Testing before integration

1
2
3
4
# Start test example
docker exec 60b6c5a2df5b sudo supervisorctl start ds:example
# Add it to the autostart:
docker exec 60b6c5a2df5b sudo sed 's,autostart=false,autostart=true,' -i /etc/supervisor/conf.d/ds-example.conf

点击 GO TO TEST EXAMPLE

创建文件后出现
onlineoffice_error

这里需要修改:

  1. http://localhost:8088 改为 http://192.168.2.165:8088
  2. 允许私有IP
    http://192.168.2.165:8088界面中滑动到管路界面
    Admin Panel - Server Management
1
2
3
4
# Start Admin Panel
docker exec 07b83f4d40a4 sudo supervisorctl start ds:adminpanel
# Add it to the autostart
docker exec 07b83f4d40a4 sudo sed 's,autostart=false,autostart=true,' -i /etc/supervisor/conf.d/ds-adminpanel.conf

首次登录需要输入token并重置密码
Token可以通过log查找获得
Admin Panel Token

登录上后台后,设置允许私有IP即可
Admin Panel Private Setting

这时候再到http://192.168.2.165:8088/example中测试
onlineoffice_test_word

拓展字体

  1. 在Windows系统下,字体路径为C:\Windows\Fonts
  2. 由于前面的配置中,我们已经配置了字体目录,因此只需要将字体复制到D:/onlyoffice_docker/fonts即可
    onlineoffice_fonts_path
  3. 进入容器,重新加载字体
1
2
cd /usr/bin
./documentserver-generate-allfonts.sh

onlineoffice_fonts
4. 刷新测试文档即可看到加载字体
onlineoffice_fonts_test

默认语言改中文

修改容器文件 /etc/onlyoffice/documentserver-example/default.json
"language" 中的 “zh” 移动到最前面
onlineoffice_def_lang

与Seafile集成

找到 seahub_settings.py
由于我们在 Seafile 社区版13.0 部署 中已经配置了映射路径
这里可以在 F:\seafile\seafile-data\seafile\conf中找到

在结尾加上即可

1
2
3
4
5
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = 'http://192.168.2.165:8088/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')

重启Seafile容器即可

Seafile - Online Office

参考链接

  • 标题: Seafile office online 部署
  • 作者: PointY
  • 创建于 : 2026-02-02 13:43:54
  • 更新于 : 2026-02-04 17:41:58
  • 链接: https://siyuhong.github.io/2026/02/02/seafileoffice-deploy/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论