- Edited
1) Install Docker Manager in the App Store.
2) Run Docker Manager, go to Image management and get the latest nextcloud and mariadb images by simply entering their image names.
3) Prepare folders for permanent storage of your container data. I suggest to create a "docker" folder in which you create another folder for your actual container. I will name them "nextcloud" and "mariadb".
4) Create the containers in Docker Manager. To do so you need to know which ports and directories your applications are working with. This information can usually be found at the docker hub of your application. In case of nextcloud the link is: https://hub.docker.com/_/nextcloud/
Nextcloud uses port 80 and saves it's data in the directory /var/www/html
You need to map the port 80 to something free on your server. I will use 8080.
Also map the directory of your container /var/www/html to the directory we prepared earlier /docker/nextcloud
5) Change the container name to something that makes sense - nextcloud for example.
6) Repeat the procedure for MariaDB. This time map port 3306 to something free. I will simply add an 0 and use port 33060. Your directory mapping needs to be /var/lib/mysql to /docker/mariadb
This time we also need to add Environment Variables in order to create the necessary database for nextcloud to work with:
MYSQL_ROOT_PASSWORD=password
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
MYSQL_PASSWORD=password
Simply change the values after "=" to whatever you want your password or name to be.
7) Change the container name to something easy again.
8) Get the IP of your MariaDB container by going to the Terminal and entering docker exec mariadb cat /etc/hosts. The name after exec is your container name. Now you know why we changed it to something easy
Note the IP address you see at the very bottom.
9) Now run the Nextcloud-Setup by entering your servers IP followed by the nextcloud port in your browser. Choose an account name and password and fill in the mariadb database details as well as the correct IP and port of your container.
10) Congrats you did it! You sucessfully set up Nextcloud and MariaDB using Docker Manager!