Install ownCloud in Docker with Docker Compose

In this tutorial, we'll walk through the steps to install ownCloud in Docker using a Docker Compose file for easy cloud storage and file sharing. Let's get started!

Step 1: Create a project directory

First, create a new project directory for ownCloud:

Copy
mkdir owncloud-docker-server
cd owncloud-docker-server

Step 2: Copy the Docker Compose file

Next, copy the Docker Compose file from the ownCloud documentation repository:

Copy
wget https://raw.githubusercontent.com/owncloud/docs-server/master/modules/admin_manual/examples/installation/docker/docker-compose.yml

This file contains the configuration settings for the ownCloud Docker container, including the MariaDB and Redis containers.

Step 3: Create the environment configuration file

Create an environment configuration file named .env in the project directory with the following contents:

Copy
cat << EOF > .env
OWNCLOUD_VERSION=10.11
OWNCLOUD_DOMAIN=localhost:8080
OWNCLOUD_TRUSTED_DOMAINS=localhost
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=8080
EOF

This sets the required configuration settings for ownCloud, including the version, domain name, trusted domains, admin username and password, and HTTP port.

Step 4: Build and start the ownCloud container

Build and start the ownCloud container using the following command:

Copy
docker-compose up -d

This will download the required Docker images, build the ownCloud Docker image, and start the container in detached mode. You can then access the ownCloud web interface by visiting http://localhost:8080 in your web browser. The admin username and password you set in the .env file will be used to log in to the web interface.

That's it! You've successfully installed ownCloud in Docker using a Docker Compose file. You can now use it to store and share files in the cloud.