CentOS7 下安装 OnlyOffice

命令一键安装

wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install epel-release -y
setenforce 0
yum install docker -y【测试版本:yum install docker-ce -y】
systemctl start docker
systemctl enable docker
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --add-port=8082/{tcp,udp}
firewall-cmd --add-port=8082/{tcp,udp} --permanent
docker pull hub.c.163.com/gongzh/onlyoffice:latest
docker run -i -t -d -p 8082:80 hub.c.163.com/gongzh/onlyoffice

安装缓慢可以尝试修改epel源到阿里云:https://www.keke.moe/archives/572.html

命令解释

  1. yum install epel-release -y //安装epel组件
  2. setenforce 0 //关闭SeLinux防火墙
  3. yum install docker -y //安装Docker
  4. systemctl start docker //启动Docker
  5. systemctl enable docker //应用Docker
  6. systemctl enable firewalld //打开防火墙
  7. systemctl start firewalld //启动防火墙
  8. firewall-cmd --add-port=8082/{tcp,udp} //增加防火墙端口
  9. firewall-cmd --add-port=8082/{tcp,udp} --permanent //应用防火墙端口
  10. docker pull hub.c.163.com/gongzh/onlyoffice:latest //加载组件
    这一步我替换成了163镜像,附官方镜像命令为:docker pull docker.io/onlyoffice/documentserver
  11. docker run -i -t -d -p 8082:80 hub.c.163.com/gongzh/onlyoffice //启动组件
    参考第10步如用官方镜像,这一步启动命令为:docker run -i -t -d -p 8082:80 --restart always --name onlyoffice docker.io/onlyoffice/documentserver

额外命令

systemctl restart docker 重启 Docker

参考文献

小夙o,CSDN:https://blog.csdn.net/weixin_41244495/article/details/110632159

THE END