Building NextCloud with Docker
- Tram Ho
Hello everyone, continue TIP share about Docker today is another sharing corner building NextCloud storage system with Docker.
1. Overview
What is NextCloud?
Nextcloud is an open source and a program that supports data storage and synchronization on the cloud computing platform. With Nextcloud, you can build for organizations, businesses or individuals a data storage and synchronization platform similar to Google Drive, Dropbox, Onedrive…
Nextcloud provides many features to create a private cloud, such as:
- Automatic storage: You can access Nextcloud almost anywhere, and you have full control over data storage.
- Easy Sharing: Nextcloud allows very secure File sharing, with anyone or outside the cloud using a password protected path and network members can share Files to Nextcloud.
- Prioritize security: Nextcloud integrates standard security practices including end-to-end encryption. It supports popular authorization schemes, controls, and authentication schemes.
- Lots of Integrations: Nextcloud comes with built-in support – apps and services to extend Cloud functionality. For example, you can manage tasks, edit data in Markdown, and more.
2.Install NextCloud
In this sharing, I use Ubuntu 20.04 LTS and other similar distributions.
Server NextCloud:
OS: Ubuntu 20.04 LTS
Configuration: 2 CPU / 2 GB RAM / 20 GB Disk
IP: 123.123.123.123 (IP Public – eth0)
2.1 Installing Docker and Docker-Compose
1 2 3 4 5 6 7 8 9 | sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose sudo usermod -aG docker $USER newgrp docker |
2.2.Create a docker-compose file
First, you create a folder /opt/NextCloud and file docker-compose.yaml new in this directory.
1 2 | mkdir /opt/wireguard-server |
1 2 | vim /opt/wireguard-server/docker-compose.yaml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | version: '2' volumes: nextcloud: db: services: db: image: mariadb restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=Bund7zXeVz7YnFknLGcnUjHtk #change this - MYSQL_PASSWORD=HFdMe9rn5kf7A8Pqc8v86Pre5 #change this - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud restart: always ports: - 8888:80 links: - db volumes: - nextcloud:/var/www/html environment: - MYSQL_PASSWORD=HFdMe9rn5kf7A8Pqc8v86Pre5 #change this to match the mysql_password above - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=db |
2.3.Set Up NextCloud
We start with the following command:
1 2 3 | cd /opt/wireguard-server docker-compose up -d |
Go to the browser and proceed with the setup Nextcloud http://ip:8888
You wait for a moment, it will be installed and proceed to explore NextCloud
Epilogue
So, through this article, I share with you how to build your own self-hosted system using NextCloud on Docker. Now try to install it now to experience it. Good luck.!
Refer: