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: Prerequisites
- A VPS running Ubuntu 24.04, CentOS or Debian. If you don't have one, no worries! We offer the best priced, most reliable, and fastest VPS servers in the market :)
- A working Docker installation—for information about how to install Docker, check out our getting started with Docker tutorial.
Note
If you want to skip all the technical steps of setting up Nextcloud on your server and have it installed in minutes, then I have some great news for you! Our team of engineers has prepared a ready-to-use 1-Click Nextcloud application for your convenience. Just choose a server, and while prompted to choose the operating system, choose Nextcloud from the dropdown menu. This will set up Nextcloud in minutes, which means you don't even need this tutorial. Save time and save money with our Nextcloud 1-Click solution. [cta_inline]Step 1. Install Docker
Ubuntu 24.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:
Next, we add the GPG keys, Docker repositories and finally install Docker. Here is where it gets different for both Ubuntu and Debian:sudo apt-get update
sudo apt-get install curl gnupg2 apt-transport-https ca-certificates software-properties-common
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" |
Continue reading this article
by subscribing to our newsletter.
Subscribe nowby subscribing to our newsletter.
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.
2 Responses to How To Install Nextcloud With Docker and Docker Compose
Sumone
It is crazy how nearly all Linux tutorials on the Internet skip over assumed steps and do not work following the precise steps actually listed.
Marc Chartouny
Hello Sumone, thanks for your comment. We make sure to build our tutorials with much detailed and realistic steps as possible.
Can you please help us out in highlighting the missing part so we inform our engineers to adjust it accordingly?
Much appreciated.
Marc