blog-image

Mar 24, 2020

15 min read

How To Install Nextcloud With Docker and Docker Compose

Written by

Vippy The VPS
In this tutorial, we'll look at how to install Nextcloud using Docker and Docker Compose. Specifically, we'll be installing Nexcloud along with an Nginx reverse proxy and Let’s Encrypt SSL in a CentOS, Ubuntu, or Debian dockerized environment.

Why Install Nextcloud With Docker and Docker Compose?

Nextcloud is an open source software suite for storing and synchronizing data, sort of like a free alternative to Dropbox or Google Drive. Plus, with Nextcloud, you get an open system architecture that gives you additional functionality and full control of your data. With Nextcloud, you can:
  • Store files, contacts, calendars and more on your server, and synchronize them across various devices
  • Share your data with others to view and collaborate on
  • Expand your Nextcloud installation with apps from the Nextcloud App Store,
  • Or build your own apps and integrate them with Nextcloud.
install nextcloud with docker

Install Nextcloud with Docker: Prerequisites

[cta_inline]

Step 1. Install Docker

Ubuntu 22.04/Debian 12 For both Ubuntu and Debian servers, the latest versions of Docker CE may not be available in the repositories. We need to install the prerequisite packages:
sudo apt-get update

sudo apt-get install curl gnupg2 apt-transport-https ca-certificates software-properties-common 
Next, we add the GPG keys, Docker repositories and finally install Docker. Here is where it gets different for both Ubuntu and Debian:

Ubuntu:

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Then install docker:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Debian:

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Now install Docker:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Other Linux Distributions

If you are using another Linux distribution, check out the
Continue reading this article
by subscribing to our newsletter.
Subscribe now

A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.

If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.