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

VMware Workstation 14 Pro installs CentOS 7.0

The specific method of installing CentOS 7.0 on V...

How to add links to FLASH in HTML and make it compatible with all major browsers

Look at the code first Copy code The code is as fo...

Echart Bar double column chart style most complete detailed explanation

Table of contents Preface Installation and Config...

When backing up files in Centos7, add the backup date to the backup file

Linux uses files as the basis to manage the devic...

Implementing shopping cart function based on vuex

This article example shares the specific code of ...

Do you know the meaning of special symbols in URL?

1.# # represents a location in a web page. The ch...

8 JS reduce usage examples and reduce operation methods

reduce method is an array iteration method. Unlik...

React implementation example using Amap (react-amap)

The PC version of React was refactored to use Ama...

Detailed explanation of Linux index node inode

1. Introduction to inode To understand inode, we ...

An elegant way to handle WeChat applet authorization login

Preface When the WeChat mini program project invo...

Example of how to quickly build a LEMP environment with Docker

LEMP (Linux + Nginx + MySQL + PHP) is basically a...

How to implement Ajax concurrent request control based on JS

Table of contents Preface Ajax serial and paralle...

MySQL slow query and query reconstruction method record

Preface What is a slow query and how to optimize ...

How to add java startup command to tomcat service

My first server program I'm currently learnin...

Ubuntu MySQL version upgraded to 5.7

A few days ago, the library said that the server ...