In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces docker using nextcloud to build a private Baidu cloud disk method, has a certain reference value, interested friends can refer to, I hope you have a lot of harvest after reading this article, let Xiaobian take you to understand.
Suddenly there is a need to build a document storage collaborative private service, after multiple search to find onlyoffice service can meet my document editing related needs, and storage can use nextcloud to build a private cloud disk service to meet, so that the use of nextcloud+onlyoffice can meet my document online collaborative storage needs, in fact, to put it bluntly is can edit ofiice files and share the private cloud disk.
In the early stage, I used the traditional mirror to start one by one, and later I changed to docker-compose to deploy, so I also provided two solutions. Another point is that my database uses postgresql, the system also supports mysql and MariaDB, or directly use the built-in sqLite. If you use mysql, MariaDB configuration and my postgresql is similar, built-in sqLite is much simpler, directly ignore all the operations in the database in the article.
text
Install Startup Services
Method 1 traditional deployment, method 2 docker-compose deployment, recommended the second, simple.
Either way, install Docker first.
Docker installation under linux
manner
Pull nextcloud mirrors and database mirrors
Database mirroring is optional, you can also use mysql or directly use nextcloud built-in sqlLite, I use postgresql. There is also because I need to operate office, but also installed onlyoffice services, can be ignored.
docker pull docker.io/nextclouddocker pull postgresdocker pull onlyoffice/documentserver
Creating a Startup Container
If you don't use the built-in database, then the database needs to initialize the storage repository first. I created a cloud repository specifically for storing data and starting it.
Start database (optional)
docker run --restart=always --name postgresql -v /etc/localtime:/etc/localtime -v /data/postgresql:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -d -p 35432:5432 postgres
-e POSTGRES_PASSWORD=123456 means database password default 123456
Start office services (optional)
docker run --name onlyoffice -i -t -d -p 9000:80 onlyoffice/documentserver
Start nextcloud
docker run --restart=always --name nextcloud -p 8080:80 -v /nextcloud:/var/www/html --link postgresql:postgresql -d nextcloud
-name nextcloud Set container name
--restart=always means always self-starting, will restart the container after shutdown, etc.
-p 8080:80 means mapping the local port 8080 to port 80 in the container, that is, you need the local ip:8080 when you want to access (you can choose the port you want).
-v /nextcloud:/var/www/html is used to map container-related resources to the local/nextcloud directory (you can choose your own directory), to facilitate data persistence and external modification of page configuration, etc.
--link postgresql:postgresql optional, link postgresql database container, easy to configure (detailed role later)
method II
Install docker-compose
curl -L https://github.com/docker/compose/releases/download/1.10.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-composechmod +x /usr/local/bin/docker-compose
Writing docker-compose files
Create a dedicated folder, such as nextcloud, and create the docker-compose.yml file inside
version: '2'services: nextcloud: container_name: nextcloud_app image: nextcloud ports: - "8080:80" volumes: - ./ app:/var/www/html links: - postgresql restart: always onlyoffice: container_name: nextcloud_office image: onlyoffice/documentserver ports: - "9000:80" restart: always postgresql: container_name: nextcloud_db image: postgres:11.4 environment: - POSTGRES_PASSWORD:123456 volumes: - ./ postgresql:/var/lib/postgresql/data - /etc/localtime:/etc/localtime restart: alwaysnetworks: default: external: name: nextcloud
start the container
Operate in docker-compose.yml sibling directory.
The first boot will automatically pull the mirror, so there must be a net. And using a network connection, you have to manually create a net bridge.
Creating a net:
docker network create nextcloud
Start:
docker-compose up -d
After the above services are officially launched, the next step is configuration.
initialization configuration
Browser visit ip:8080
4.1 Enter administrator account password
4.2 The data directory is recommended to remain unchanged, the default is good
4.3 database selection
Built-in SQLite database, less storage files can be directly selected to complete the default installation.
If you choose another database, take PostgreSQL as an example:
Database username and password needless to say, database name corresponding database needs to be created in advance.
The most important database host is the database access ip+ port number.
Note: But is the postgresql I filled in a bit familiar? Yes, it is--link (the net method used in method 2 has the same purpose). My database also uses docker container, using--link can be PostgreSQL database container in alias form passed over, so here you can directly use postgresql to represent the database (this is a way of communication between docker containers, note that PostgreSQL container must be started before the nextcloud container).
Whitelist configuration and usage
If you need a domain name and some new ip ports to access, you need to modify the configuration in/nextclou/config/config.php (no please add)
'trusted_domains' => array ( 0 => 'www.xxx.com:10080', ),
Then is the use and mailbox configuration can be self-groping.
Configure onlyoffice (not necessary, I just want to operate word online, etc.)
Enter Cloud Disk to log in as administrator and click Users-> Applications to install ONLYOFFICE plugin:
Then users-> Settings->ONLYOFFICE to fill in their own service address can be.
Effect drawing:
Thank you for reading this article carefully. I hope that the article "docker uses nextcloud to build a private Baidu cloud disk" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it more, pay attention to the industry information channel, and more relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.