Linux server docker offline deployment of nextCloud container

1. Download nextcloud image

Query and download images in a networked server environment

[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 & amp; … 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. Save the image locally

[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. Upload the saved nextcloud image package to the intranet server to be installed

4. Load nextcloud image package

[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. Create a local data directory

(used to map the data directory in the container)

[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. Start the container

[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. Create the database you need to connect to

Database name: nextCloud
Character set selection utf8mb4
The sorting rule is utf8mb4_general_ci
Can be created directly using the Navicat database tool:

8. nexcloud installation page initialization

(1) Access initialization address
Open the browser http://124.223.5.194:10081

(2) Enter the username and password you want to create
Enter the relevant information about the database you want to connect to

(3) Click to install

You can click to skip and the apps you want can be installed later.

This means the installation is complete.