×
Community Blog How to Install Nextcloud Talk Using Docker on Alibaba Cloud

How to Install Nextcloud Talk Using Docker on Alibaba Cloud

In this tutorial, we will be installing and setting up Nextcloud on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Nextcloud is a suite of client-server software for creating and using file hosting services, similar to Dropbox. Nextcloud Talk is an application by Nextcloud, which allows you to organize meetings with colleagues, customers and partners with a single click.

In this tutorial, we will be installing and setting up Nextcloud Talk on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 – $1200 worth in Alibaba Cloud credits for your new account. If you don't know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS's IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server's hostname and create user with root privileges.

Setting Up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges.

# sudo apt update && sudo apt upgrade

Software-properties-common package is required to get the supported files for installation of Docker CE. To install software-properties-common, execute the command.

# sudo apt-get install software-properties-common -y 

Apt-transport-https is required for installation of Docker CE. To install apt-transport-https, execute the command.

# sudo apt-get install apt-transport-https -y 

Ca-certificates is required for installation of Docker CE. To install ca-certificates, execute the command.

# sudo apt-get install ca-certificates -y 

Curl is required for installation of Docker CE. To install curl execute the command.

# sudo apt-get install curl -y 

Install Docker CE

To install Docker community edition, follow the steps below.

Step 1:

Add GPG key for Docker by executing command below.

# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Step 2:

Execute the following command to verify the fingerprint of GPG key.

# sudo apt-key fingerprint 0EBFCD88

Step 3:

Add the Docker repository by executing the command below.

# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Step 4:

Update your system by executing command below to load added repository.

# sudo apt update

Step 5:

Execute the following command to install Docker.

# sudo apt install docker-ce

Step 6:

Add your username to docker group by executing command below.

# sudo adduser aareez docker 

Step 7:

Close your current shell session and start a new session. Otherwise, you won't be able to run docker and you may see permission errors.

Step 8:

Execute the following command to check either docker run correctly or not.

# docker run hello-world

Install NextCloud

To install NextCloud and Talk, follow the steps below.

Step 1:

Run the following command to download and install NextCloud on Docker.

# docker run -d -p 8080:80 nextcloud

Install Docker compose:

To keep your data consistent through upgrades and automatically handling of all containers on restart, you may use Docker compose. It is easy to launch configuration in separate database container and persistent volume. To download and install Docker compose, follow the steps below.

Step 1:

Execute the following command to download and install latest version of docker compose.

# sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Step 2:

Now set the permissions for file using the command below.

# sudo chmod +x /usr/local/bin/docker-compose

Step 3:

Get list of started containers using the following command.

# docker container ls --all

1

Stop container using port 8080. To do so, get container id, replace it with 8baab990c424 below and execute the command.

# docker stop 8baab990c424

Step 4:

Option 1 – Without SSL

If you wish to install SSL certificate, skip the steps below and go to Option 2 – With SSL, and then continue from Step 5 of this section.

Create docker-compose.yaml file, paste the following text for configurations and save the file. Before pasting text, remember to set database name, password and user.

# sudo nano docker-compose.yaml
version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=654321Ab
      - MYSQL_PASSWORD=654321Ab
      - MYSQL_DATABASE=ncdb
      - MYSQL_USER=aareez

  app:
    image: nextcloud
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    restart: always

Execute the following command to launch Docker Compose configuration.

# docker-compose up –d

Option 2 – With SSL

Set Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm

Set Up Reverse Proxy

Get list of started containers using the following command.

# docker container ls --all

Stop container using port 8080. To do so, get container id, replace it with 8baab990c424 below and execute the command.

# docker stop 8baab990c424

In this step, you will setup reverse proxy to access NextCloud Talk so that you can access it via domain name without using any port in the end of address. To do so, you will need to update docker-compose.yml file with the following text.

# sudo nano docker-compose.yml

Now add the following text in the opened file and save it.

version: '3'

services:
  db:
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=654321Ab
      - MYSQL_PASSWORD=654321Ab
      - MYSQL_DATABASE=ncdb
      - MYSQL_USER=aareez

  app:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html
    environment:
      - VIRTUAL_HOST=softpedia.xyz
      - LETSENCRYPT_HOST=softpedia.xyz
      - LETSENCRYPT_EMAIL=arslan@gmail.com
      - MYSQL_HOST=db
      - MYSQL_PASSWORD=654321Ab
      - MYSQL_DATABASE=ncdb
      - MYSQL_USER=aareez
    depends_on:
      - db
    networks:
      - proxy-tier
      - default

  proxy:
    build: ./proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    volumes:
      - certs:/etc/nginx/certs:ro
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy-tier

  letsencrypt-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    restart: always
    volumes:
      - certs:/etc/nginx/certs
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - proxy-tier
    depends_on:
      - proxy

volumes:
  db:
  nextcloud:
  certs:
  vhost.d:
  html:

networks:
  proxy-tier:

Now create a directory named proxy.

# sudo mkdir proxy

Navigate to created directory proxy.

# cd proxy

Now create a file named Dockerfile, paste the following text in the opened file and save it.

# sudo nano Dockerfile
FROM jwilder/nginx-proxy:alpine

COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf

Now create uploadsize.conf, paste the following text in opened file and save it.

# sudo nano uploadsize.conf
client_max_body_size 10G;

Now navigate to home directory.

# cd ~

Now launch Docker compose configuration.

# sudo docker-compose up -d

Step 5:

Now open your browser and navigate to http://your_domain.tld:8080 or http://ecs_ip_address:8080 If you see any error while loading page, go to firewall settings section and enable port 8080. After accessing link, you will see the following screen.

2

Step 6:

Now create admin account by filling the form below.

3

Step 7:

Click Storage & database dropdown and fill the database information. Use host value : db

4

After filling data, click Finish Setup. Now you will be redirected to NextCloud dashboard.

5

Install Talk

Talk offers you to make text and video chat. It helps you to make calls. To do so, follow the steps below.

Step 1:

Navigate to profile picture icon on top right corner, a dropdown menu will open. Click +Apps as shown below.

6

Step 2:

Now navigate to Social & communication section. You will see the list of apps. Select Talk from the opened list as shown below. Click Download and enable option and wait for installation.

7

After successful installation, you will see a new icon on top menu bar, click it.

8

You will see the following screen. You will see the list of users of left side if added. You can make calls and chat with them.

9

0 0 0
Share on

Alibaba Clouder

2,599 posts | 762 followers

You may also like

Comments