We can create our own personal cloud by NextCloud. This can be done by installing Nextcloud on your raspberry pi. This blog is little different as we will be running nextcloud as a docker container instead of traditionally installing on the raspberry pi.
Let us collect all the required information for create a nextcloud application
Creating a directory on host system which we will share with the nextcloud server
Share this directory in the container in the folder
Therefore the run command attributes will be
We will use the database created in the blog “Installing MariaDB server on Raspberry Pi by Docker” and have to get the required information for connection.
List all the docker networks
Note:We have to connect to the same docker network onto which the database have been connected.
Name of database container for linking
Download the nextcloud image
docker pull nextcloud
List all the docker images
Now for running the nextcloud container we have two ways.
1.If this is the first installation then enter the following command and go to the setup page and fill in all the information.
docker run -p 4321:80\ --name cloud-service\ -v /media/nas/NextCloud:/NextCloudShare\ --link sql-nextcloud\ --net=nextcloudDBMS\ -d nextcloud
Now open you browser and enter the IP address of your raspberry pi with the above specified port number.
The following web page will open up. Enter all your information by selecting MariaDB. After this your nextcloud will be ready. Hurrreeeeeee 🙂
2. If you already have a database with data from the previous installation just run the following command and nextcloud will be up as it was before.
docker run -p 4321:80\ --name cloud-service\ --mount type=bind,source=/media/nas/NextCloud/,target=/NextCloudShare/\ --link sql-nextcloud\ --net=nextcloudDBMS\ -e MYSQL_DATABASE='Cloud-Database'\ -e MYSQL_USER='nextcloud'\ -e MYSQL_PASSWORD='Superman'\ -e MYSQL_HOST='33453154bd00'\ -d nextcloud