Hello. In this post, I will teach you how to deploy Owncloud using Docker compose. It will be brief but explained step by step.
Briefly, I will tell you that Docker compose is more thought of production environments where compatibility should be as high as possible. This is precisely the great advantage of Docker images that we will be able to use in any supported system thanks to the technology of containers. Then, these steps can be done from any Linux distribution that has installed Docker and Docker Compose.
Owncloud is one of the best-known solutions to create our own private cloud as if it were a professional service. Of course, by this I do not mean that Owncloud is not professional, I mean that its behavior is similar to that of proprietary solutions such as Google Drive or OneDrive.
So let’s get to work.
Install Docker and Docker Compose on Linux
The first step is to have Docker installed in the system, obviously.
- If you are using Ubuntu: How to install Docker on Ubuntu 18.04?
- For CentOS 8: How to install Docker on CentOS 8?
- For CentOS 7: How to install Docker CE on CentOS 7?
- If you use Windows: How to install Docker in Windows 10?
- Or, if you are using Debian 10: How to install Docker on Debian 10?
And using your distribution’s package manager, you can install Docker Compose. For example:
:~$ sudo apt docker-compose
For Debian, Ubuntu, and derivatives.
:~$ sudo dnf install docker-compose
Or, for RHEL, CentOS and derivatives.
Deploy Owncloud using Docker compose
Well, the first step is to create a new folder where we will do the process.
:~$ mkdir owncloud
:~$ cd owncloud
Then, in that folder create a new file called docker-compose.yml that contains all the instructions for deployment. When you create it, add the following:
:~$ sudo nano docker-compose.yml
I proceed to explain.
In this file, we will raise two services. The first is the Owncloud. The image is configured for Owncloud to run on port 80, but I exposed port 1234. You can set the number you want but don’t touch 80.
Then come the volumes. The first part is folders on our host system to make sure the data is persistent. These folders must be created before the services are deployed.
After this, comes the second service. By default, the Owncloud image is configured to use SQLite. But in this case, we have decided to use MariaDB. All simple just set up an initial key and you’re done.
Let us create the volume folders.
:~$ mkdir /home/angelo/owncloud_data
:~$ mkdir /home/angelo/owncloud_data/apps
:~$ mkdir /home/angelo/owncloud_data/config
:~$ mkdir /home/angelo/owncloud_data/data
Then, run Docker Compose.
:~$ sudo docker-compose up -d
That’s enough. Now open your web browser and go to
http://your-server:1234 and you will see the following. Create an admin account.
Next, configure the Database.
Finally, you’ll see the login screen and you are done. You can now use Owncloud.
Owncloud is a really useful application. And to deploy it using Docker compose is something easy and within everyone’s reach.
For more information on this, see the official documentation of the Owncloud Docker image.