1、下载nextcloud镜像
在一台联网的服务器环境查询并下载镜像
[root@VM-4-16-centos ~]# docker search nextcloud
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nextcloud Nextcloud manual docker image 3863 [OK]
linuxserver/nextcloud A Nextcloud container, brought to you by Lin… 652
nextcloud/all-in-one Nextcloud AIO stands for Nextcloud All-in-On… 88
nextcloudci/server Nextcloud server straight from GitHub master 2 [OK]
nextcloud/aio-onlyoffice 1
nextcloud/univention-app-image 1
nextcloud/aio-nextcloud 1
nextcloud/aio-collabora 1
nextcloud/aio-talk 1
nextcloud/aio-postgresql 0
nextcloud/aio-apache 0
nextcloud/aio-redis 0
azamserver/nextcloud-imagemagick-ffmpeg A Nextcloud docker image with ImageMagick & … 0
nextcloud/aio-imaginary 0
nextcloud/aio-fulltextsearch 0
nextcloud/aio-clamav 0
treehouses/nextcloud-tags 0
nextcloud/aio-notify-push 0
nextcloud/aio-domaincheck 0
treehouses/nextcloud 0
nextcloud/aio-watchtower 0
elestio/nextcloud Nextcloud, verified and packaged by Elestio 0
nextcloudci/translations-app The docker image to run our translation sync… 0 [OK]
nextcloud/aio-borgbackup 0
nextcloudcookbook/testci A repository to contain the test routines fo… 0
[root@VM-4-16-centos ~]# docker pull nextcloud
Using default tag: latest
latest: Pulling from library/nextcloud
360eba32fa65: Pull complete
19de89a948b7: Pull complete
be0f9df298ac: Pull complete
cda134203c51: Pull complete
299efc6dd925: Pull complete
a2655c36e196: Pull complete
4b4b90a10a72: Pull complete
3e9322c2e08a: Pull complete
d146bc20b686: Pull complete
a4cf3c661f4b: Pull complete
b5041d3c27cb: Pull complete
16c26bb3efa9: Pull complete
bfc8d5385a83: Pull complete
86381bf9771a: Pull complete
c9c88fe64aef: Pull complete
2802a2495070: Pull complete
c62c4f6d89d3: Pull complete
fa6d581934c9: Pull complete
e92780daa42c: Pull complete
e4a98113502b: Pull complete
Digest: sha256:0a5151d4452b494de152cb01b6082e239e4d47efb2c0998f6fdf8557e7c95dd5
Status: Downloaded newer image for nextcloud:latest
docker.io/library/nextcloud:latest
[root@VM-4-16-centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nextcloud latest 5cab3681afe9 5 days ago 1.14GB
[root@VM-4-16-centos ~]#
2、将镜像保存在本地
[root@VM-4-16-centos nextcloud]# docker save -o nextcloud.tar nextcloud:latest
[root@VM-4-16-centos nextcloud]# ls
nextcloud.tar
[root@VM-4-16-centos nextcloud]#
3、将保存的nextcloud镜像包上传到所要安装的内网服务器上
4、载入nextcloud镜像包
[root@VM-4-16-centos nextcloud]# ls
nextcloud.tar
[root@VM-4-16-centos nextcloud]# docker load -i nextcloud.tar
a2d7501dfb35: Loading layer [==================================================>] 77.81MB/77.81MB
1ff185c2e955: Loading layer [==================================================>] 3.584kB/3.584kB
e2de06477579: Loading layer [==================================================>] 320.2MB/320.2MB
be1b5a500198: Loading layer [==================================================>] 6.144kB/6.144kB
651d970945d2: Loading layer [==================================================>] 51.22MB/51.22MB
fb13d556034d: Loading layer [==================================================>] 10.75kB/10.75kB
16b1a634e081: Loading layer [==================================================>] 8.192kB/8.192kB
914cb8e5503b: Loading layer [==================================================>] 13.35MB/13.35MB
55eb544bd19a: Loading layer [==================================================>] 4.096kB/4.096kB
582791144134: Loading layer [==================================================>] 49.51MB/49.51MB
68e7cb5a624f: Loading layer [==================================================>] 12.8kB/12.8kB
035699527fb4: Loading layer [==================================================>] 4.608kB/4.608kB
6dd3577f71be: Loading layer [==================================================>] 4.608kB/4.608kB
37323fda7469: Loading layer [==================================================>] 69.12MB/69.12MB
f4d128700000: Loading layer [==================================================>] 67.46MB/67.46MB
619245b9c60e: Loading layer [==================================================>] 12.8kB/12.8kB
b50a4c8cc879: Loading layer [==================================================>] 12.29kB/12.29kB
028d16ee06e0: Loading layer [==================================================>] 527.5MB/527.5MB
494925bb34f2: Loading layer [==================================================>] 15.87kB/15.87kB
0fc62bd46439: Loading layer [==================================================>] 18.43kB/18.43kB
Loaded image: nextcloud:latest
[root@VM-4-16-centos nextcloud]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nextcloud latest 5cab3681afe9 5 days ago 1.14GB
[root@VM-4-16-centos nextcloud]#
5、创建本地数据目录
(用于映射容器中的data目录)
[root@VM-4-16-centos data]# mkdir -p /data/nextcloud_data
[root@VM-4-16-centos data]# ls
docker_data docker_softwarepackage mysql nextcloud_data
[root@VM-4-16-centos data]#
6、启动容器
[root@VM-4-16-centos data]# docker run -d --restart=always --name nextcloud -p 10081:80 -v /data/nextcloud_data:/var/www/html/data nextcloud:latest
3c9eac7e8aca2464e47e4d092e01a3c6feedde62607d1458dc70f45baf3db539
[root@VM-4-16-centos data]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3c9eac7e8aca nextcloud:latest "/entrypoint.sh apac…" 12 seconds ago Up 11 seconds 0.0.0.0:10081->80/tcp nextcloud
[root@VM-4-16-centos data]#
7、创建所需连接的数据库
数据库名:nextCloud
字符集选 utf8mb4
排序规则选 utf8mb4_general_ci
可以直接使用 Navicat 数据库工具创建:
8、nexcloud安装页面初始化
(1)访问初始化地址
浏览器打开http://124.223.5.194:10081
(2)输入所要创建的用户名及密码
输入所要连接的数据库的相关信息
(3)点击安装
可以点击跳过,想要的应用可以之后在安装
这样就表示安装完成了。