How to Install, Setup & Use Nextcloud

Nextcloud is a powerful piece of software that allows you to create your own alternative to things like Dropbox cloud storage, Google calendar and contact syncing, Trello boards, Microsoft Office online document editing, and much more all in a single interface, hosted on your own secure server. It's a cloud tool that can be expanded with hundreds of different add-on apps as well.

In this article, we'll show you how to install Nextcloud on a ServersGate cloud server using Ubuntu. The instructions will be similar for Debian or CentOS.

What is Nextcloud?

Nextcloud is open-source software for storing files on a remote server and syncing them between all of your devices. It gives you the power to create your own Dropbox or Google Drive setup. Nextcloud allows you to:

  • Share filders and folders
  • Sync contacts and calendars
  • Conduct secure voice and video calls
  • View and edit documents

With an expansive library of add-ons, Nextcloud is a very powerful tool for those who are privacy-focused and want total control of their data.

Nextcloud Pricing

You might be wondering, with so many features, is nextcloud free? The answer of course is yes! It's completely open-source so there is no cost related to Nextcloud. All that you need is a server to install it on!

Nextcloud System Requirements

In order to run Nextcloud, you'll need a Cloud or Dedicated Server with:

  • 2GB of RAM
  • 2 CPU cores
  • Debian, CentOS, or Ubuntu
  • Sufficient disk space to back up your files
  • A domain name to use for the server. This can be a subdomain of your primary domain name.

Depending on the size of the cloud storage you will be maintaining, your requirements may vary.

NextCloud Installation

Step 1: SSH into the server

We'll begin by logging into the server via ssh to the root user:

Step 2: Install Docker

We'll start by updating the apt repository and downloading the required software:

Add the Docker GPG key:

Setup the stable repository:

Update the repository and install Docker CE:

We'll then install Docker Compose:

Step 3: Install Nextcloud

Create the Docker network:

Create the docker-compose file:

Paste the following content into the file:

Replace the MySQL root password and user password, your domain, and your Nextcloud admin username/password in the file:

version: '3'
services:
proxy:
image: jwilder/nginx-proxy:alpine
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
container_name: nextcloud-proxy
networks:
- nextcloud_network
ports:
- 80:80
- 443:443
volumes:
- ./proxy/conf.d:/etc/nginx/conf.d:rw
- ./proxy/vhost.d:/etc/nginx/vhost.d:rw
- ./proxy/html:/usr/share/nginx/html:rw
- ./proxy/certs:/etc/nginx/certs:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nextcloud-letsencrypt
depends_on:
- proxy
networks:
- nextcloud_network
volumes:
- ./proxy/certs:/etc/nginx/certs:rw
- ./proxy/vhost.d:/etc/nginx/vhost.d:rw
- ./proxy/html:/usr/share/nginx/html:rw
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
db:
image: mariadb
container_name: nextcloud-mariadb
networks:
- nextcloud_network
volumes:
- db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=mysql
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
restart: unless-stopped
app:
image: nextcloud:latest
container_name: nextcloud-app
networks:
- nextcloud_network
depends_on:
- letsencrypt
- proxy
- db
volumes:
- nextcloud:/var/www/html
- ./app/config:/var/www/html/config
- ./app/custom_apps:/var/www/html/custom_apps
- ./app/data:/var/www/html/data
- ./app/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
environment:
- VIRTUAL_HOST=nextcloud.YOUR-DOMAIN
- LETSENCRYPT_HOST=nextcloud.YOUR-DOMAIN
- LETSENCRYPT_EMAIL=YOUR-EMAIL
restart: unless-stopped
volumes:
nextcloud:
db:
networks:
nextcloud_network:

Then you can run the installation:


Step 4: Complete the Web Installation

You cannot go to the domain you configured above in order to complete the Nextcloud installation. You will begin by providing an admin account and identifying which apps to install:
Enter your admin username and password, then select MySQL and enter the database name, username, and password. Change "localhost" to "db".

Click Finish setup to complete the install process. Nextcloud will show its progress through the install process on the next page.

Once the installation is complete, you can now begin using Nextcloud!

Next Steps

Now that your Nextcloud is installed, you can begin adding apps and customizing the interface to your exact needs. Check out the rest of our knowledge base to read more server tutorials to help you get started with your server!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install Netbeans on Ubuntu 18.04

Netbeans is a full-featured cross-platform IDE that assists you to build applications in Java,...

34 Linux Basic Commands Every User Should Know

When hearing about Linux, most people think of a complicated operating system that is only used...