Tutorial on building nextcloud personal network disk with Docker

Tutorial on building nextcloud personal network disk with Docker

1. Introduction

Nextcloud is a very easy-to-use network disk system with powerful functions and complete plug-ins. It is very suitable for setting up personal and corporate network disks.

2. Deployment Environment

Server system: CentOS7

Docker version: 20.10.10

Tools

Tools used: Docker 20.10.10

4. Deployment Process

1. Create a new Nextcloud folder on the host. The Nextcloud folder is used to map the storage path of the Nextcloud container.

mkdir -p /home/docker/nextcloud

2. Build the mysql container.

docker run -d --name mysql \
--restart=always \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=hzbb@123321 \
mysql 

insert image description here

Command details:
–name mysql The container is named mysql
--restart=always Automatically restart the container when starting the docker service
-p 3306:3306 Container port 3306 is mapped to host port 3306
-e MYSQL_ROOT_PASSWORD=hzbb@123321 Set the password of the mysql service root user
mysql Pull and use mysql image

3. Enter the MySQL container to create the nextcloud database

docker exec -it mysql /bin/bash
mysql -uroot -phzbb@123321
create database nextcloud;

4. Build Nextcloud container

docker run -d --name nextcloud \
--restart=always \
-p 80:80 \
-v /home/docker/nextcloud/:/var/www/html/ \
nextcloud

Command details:

–name nextcloud container name nextcloud
--restart=always Automatically restart the container when starting the docker service
-p 80:80 maps host port 80 to container port 80
-v /home/docker/nextcloud/:/var/www/html/ The host /home/docker/nextcloud folder is mapped to the /var/www/html folder in the container
nextcloud Pull and use nextcloud image

5. Complete the initial installation of Nextcloud by accessing the host IP through the web. The host IP tested here is 192.168.102.103.

insert image description here

【Construction completed~】

【Error handling】

When executing mysql -uroot -phzbb@123321, an error message appears: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

The mysql service has not been fully started. Wait for a while and then execute again

Summarize

This is the end of this article about using Docker to build nextcloud personal network disk tutorial. For more related Docker nextcloud network disk content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Docker+nextcloud to build a personal cloud storage system
  • Docker uses nextcloud to build a private Baidu cloud disk
  • How to deploy nextcloud network disk using docker
  • How to install and deploy NextCloud private network disk using docker

<<:  Detailed explanation of the usage of image tags in HTML

>>:  CSS to achieve pop-up window up and down center left and right and transparent background lock window effect

Recommend

Detailed explanation of JavaScript array deduplication

Table of contents 1. Array deduplication 2. Dedup...

Summary of shell's method for determining whether a variable is empty

How to determine whether a variable is empty in s...

Implementation of code optimization for Vue2.x project performance optimization

Table of contents 1 Use of v-if and v-show 2. Dif...

CentOS6.9+Mysql5.7.18 source code installation detailed tutorial

CentOS6.9+Mysql5.7.18 source code installation, t...

Markup Languages ​​- Lists Again

Click here to return to the 123WORDPRESS.COM HTML ...

Solve the problem of ugly blue border after adding hyperlink to html image img

HTML img produces an ugly blue border after addin...

Example of building a Jenkins service with Docker

Pull the image root@EricZhou-MateBookProX: docker...

The most common declaration merge in TS (interface merge)

Table of contents 1. Merge interface 1.1 Non-func...

MySQL briefly understands how "order by" works

For sorting, order by is a keyword we use very fr...

Linux system prohibits remote login command of root account

ps: Here is how to disable remote login of root a...