

We need to install Nginx because NextCloud Application is running on port 8080 and we want it to run on port 80/443 (HTTP/HTTPS) so we need the Ngnix web server run as a reverse proxy. Step 7: Install Ngnix Web Server & configure SSL Certificate on the Application ServerĪs we have set up Docker-based NextCloud Application and Domain Name is pointed to the EC2 machine. We need to Map a Domain Name with the Static IP Address of the EC2 machine using the control panel of Domain Registrar. Sudo docker-compose ps (See the running containers) Sudo docker-compose up -d (Run the docker in the detach mode) Save the file and run the following command to run the Docker-Compose based NextCloud Application & Database. version: ‘2’ volumes: nextcloud: db: services: db: image: mariadb command: - transaction-isolation=READ-COMMITTED - binlog-format=ROW restart: always volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD= custompassword - MYSQL_PASSWORD= custompassword - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud ports: - 8080:80 links: - db volumes: - nextcloud:/var/www/html restart: always Paste following the following to the docker-compose.yml file.

Sudo mkdir -p /opt/docker-projects/nextcloud

Please create a folder and put the docker-compose.yml file there. There are 2 parts of the docker-compose.yml file first the App (Nextcloud Image) and the second one is DB (MySQL/MariaDB Image). We will use the docker-compose.yml file to set up the application. NextCloud official images are available on the Docker Hub and we can download/pull the latest images from Docker Hub and use them to configure our setup. Now, we’ll set up the NextCloud Application using Docker-Compose. Step 5 Setup & Configuration of NextCloud using Docker-Compose The domain name or sub-domain name needs to be pointed to the EC2 instance. We can use any domain name that we already have. Make sure we store the access key & secret access key to a safe place. We need to set up an IAM user with appropriate permissions on the S3 Bucket and would require the programmatic access (Access Key & Secret Access Key), this would be required to set up S3 as external storage on NextCloud. We need to create an S3 Bucket for storing our data on S3 securely. Please check the version of Docker & Docker-Compose
