{"id":1912,"date":"2024-04-15T07:00:24","date_gmt":"2024-04-15T07:00:24","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=1912"},"modified":"2025-05-15T15:35:01","modified_gmt":"2025-05-15T15:35:01","slug":"installing-nextcloud-docker","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/installing-nextcloud-docker\/","title":{"rendered":"How To Install Nextcloud With Docker and Docker Compose"},"content":{"rendered":"<p>In this tutorial, we'll look at how to install Nextcloud using Docker and Docker Compose.<\/p>\n<p>Specifically, we'll be installing Nexcloud along with an Nginx reverse proxy and Let\u2019s Encrypt SSL in a CentOS, Ubuntu, or Debian dockerized environment.<\/p>\n<h2>Why Install Nextcloud With Docker and Docker Compose?<\/h2>\n<p><a href=\"https:\/\/nextcloud.com\" target=\"_blank\" rel=\"noopener\">Nextcloud<\/a> is an open source software suite for storing and synchronizing data, sort of like a free alternative to Dropbox or Google Drive.<\/p>\n<p>Plus, with Nextcloud, you get an open system architecture that gives you additional functionality <em>and<\/em> full control of your data.<\/p>\n<p>With Nextcloud, you can:<\/p>\n<ul>\n<li>Store files, contacts, calendars and more on your server, and synchronize them across various devices<\/li>\n<li>Share your data with others to view and collaborate on<\/li>\n<li>Expand your Nextcloud installation with apps from the <a href=\"https:\/\/apps.nextcloud.com\" target=\"_blank\" rel=\"noopener\">Nextcloud App Store<\/a>,<\/li>\n<li>Or build your own apps and integrate them with Nextcloud.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8781\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1-1024x456.jpg\" alt=\"install nextcloud with docker\" width=\"600\" height=\"267\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1-1024x456.jpg 1024w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1-300x134.jpg 300w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1-768x342.jpg 768w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1-1536x685.jpg 1536w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/homepage-1.jpg 1584w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h2><a id=\"Prerequisites_9\"><\/a>Install Nextcloud with Docker: Prerequisites<\/h2>\n<ul>\n<li>A VPS running Ubuntu 24.04, CentOS or Debian. \u00a0If you don't have one, no worries! We offer the best priced, most reliable, and fastest <a href=\"https:\/\/ssdnodes.com\/\" target=\"_blank\" rel=\"noopener\">VPS servers<\/a> in the market \ud83d\ude42<\/li>\n<li>A working Docker installation\u2014for information about how to install Docker, check out our <a href=\"https:\/\/www.ssdnodes.com\/blog\/getting-started-docker-vps\/\">getting started with Docker tutorial<\/a>.<\/li>\n<\/ul>\n<h3>Note<\/h3>\n<p>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 <a href=\"https:\/\/www.ssdnodes.com\/\">server<\/a>, and while prompted to choose the operating system, choose <strong>Nextcloud<\/strong> 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 <a href=\"https:\/\/ssdnodes.com\/\" target=\"_blank\" rel=\"noopener\">Nextcloud 1-Click<\/a> solution.<\/p>\n<div class=\"cta-inline\"><\/div>\n<h2>Step 1. Install Docker<\/h2>\n<p><strong>Ubuntu 24.04\/Debian 12<\/strong><br \/>\nFor 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:<\/p>\n<pre><code><\/code><\/pre>\n<pre class=\"chroma\" tabindex=\"0\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo apt-get update\r\n<\/span><\/span><\/code><code>\r\nsudo apt-get install curl gnupg2 apt-transport-https ca-certificates software-properties-common <\/code><\/pre>\n<p>Next, we add the GPG keys, Docker repositories and finally install Docker. Here is where it gets different for both Ubuntu and Debian:<\/p>\n<h3><strong>Ubuntu:<\/strong><\/h3>\n<pre><code><\/code><\/pre>\n<pre class=\"chroma\" tabindex=\"0\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo install -m <span class=\"m\">0755<\/span> -d \/etc\/apt\/keyrings\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\r\n<\/span><\/span>\r\n<span class=\"line\"><span class=\"cl\"><span class=\"c1\"># Add the repository to Apt sources:<\/span>\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">echo<\/span> <span class=\"se\">\\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">\"deb [arch=<\/span><span class=\"k\">$(<\/span>dpkg --print-architecture<span class=\"k\">)<\/span><span class=\"s2\"> signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"k\">$(<\/span>. \/etc\/os-release <span class=\"o\">&amp;&amp;<\/span> <span class=\"nb\">echo<\/span> <span class=\"s2\">\"<\/span><span class=\"nv\">$VERSION_CODENAME<\/span><span class=\"s2\">\"<\/span><span class=\"k\">)<\/span><span class=\"s2\"> stable\"<\/span> <span class=\"p\">|<\/span> <span class=\"se\">\\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo apt-get update<\/span><\/span><\/code><\/pre>\n<pre><code><\/code><\/pre>\n<p>Then install docker:<\/p>\n<div class=\"preview\">\n<div class=\"preview__inner-1\">\n<div class=\"preview__inner-2\">\n<div class=\"cl-preview-section\">\n<pre><code>sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><strong>Debian:<\/strong><\/h3>\n<pre><code><\/code><\/pre>\n<pre class=\"chroma\" tabindex=\"0\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo install -m <span class=\"m\">0755<\/span> -d \/etc\/apt\/keyrings\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg -o \/etc\/apt\/keyrings\/docker.asc\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\r\n<\/span><\/span>\r\n<span class=\"line\"><span class=\"cl\"><span class=\"c1\"># Add the repository to Apt sources:<\/span>\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">echo<\/span> <span class=\"se\">\\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">\"deb [arch=<\/span><span class=\"k\">$(<\/span>dpkg --print-architecture<span class=\"k\">)<\/span><span class=\"s2\"> signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/debian \\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"k\">$(<\/span>. \/etc\/os-release <span class=\"o\">&amp;&amp;<\/span> <span class=\"nb\">echo<\/span> <span class=\"s2\">\"<\/span><span class=\"nv\">$VERSION_CODENAME<\/span><span class=\"s2\">\"<\/span><span class=\"k\">)<\/span><span class=\"s2\"> stable\"<\/span> <span class=\"p\">|<\/span> <span class=\"se\">\\\r\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">  sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null\r\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo apt-get update\r\n<\/span><\/span><\/code><code>\r\n<\/code><\/pre>\n<p>Now install Docker:<\/p>\n<div class=\"preview__inner-2\">\n<div class=\"cl-preview-section\">\n<pre><code>sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<h3>Other Linux Distributions<\/h3>\n<p>If you are using another Linux distribution, check out the <a href=\"https:\/\/docs.docker.com\/engine\/\" target=\"_blank\" rel=\"noopener\">official Docker documentation<\/a>.<\/p>\n<h2>Step 2. Install Docker Compose<\/h2>\n<div class=\"cl-preview-section\">\n<p>To install Docker Compose, first determine the latest version from the\u00a0<a href=\"https:\/\/github.com\/docker\/compose\/releases\" target=\"_blank\" rel=\"noopener\">releases page<\/a>. At the time of writing, the current stable version is\u00a0<code>2.26.0<\/code>.<\/p>\n<p>Create a new directory for Docker Plugins:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>mkdir -p ~\/.docker\/cli-plugins\/\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Download the Docker Compose binary (Make sure to change\u00a0<code>2.26.0<\/code>\u00a0to the latest version):<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>curl -SL https:\/\/github.com\/docker\/compose\/releases\/download\/v2.26.0\/docker-compose-linux-x86_64 -o ~\/.docker\/cli-plugins\/docker-compose\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Set<a href=\"https:\/\/www.ssdnodes.com\/blog\/linux-permissions\/\"> execute permissions<\/a> to make the binary executable:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>chmod +x ~\/.docker\/cli-plugins\/docker-compose\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Verify the installation:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>docker compose version\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>You should see the version you installed:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre><code>Docker Compose version v2.26.0<\/code><\/pre>\n<\/div>\n<h2>Step 3. Install Nextcloud using Docker and Docker Compose<\/h2>\n<p>We can now install Nextcloud with Docker and Docker Compose.<\/p>\n<p>Before we start defining services in the <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file, we create a network so that containers can communicate. Run the following command in the terminal:<\/p>\n<pre><code>$ docker network create nextcloud_network\r\n<\/code><\/pre>\n<p>Since we want to containerize Nextcloud along with other containers associated with it, we will define and knit all the services together in the <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file incrementally.<\/p>\n<p>For this tutorial, we\u2019ll define the services one by one, starting with the Nginx reverse proxy:<\/p>\n<ul>\n<li>Nginx reverse proxy<\/li>\n<li>Let\u2019s Encrypt<\/li>\n<li>MariaDB<\/li>\n<li>Nextcloud<\/li>\n<\/ul>\n<p>Create the docker compose file where we will define all the services.<\/p>\n<pre><code>$ nano docker-compose.yml\r\n<\/code><\/pre>\n<h2>Step 4. Configure the Nginx Reverse Proxy Container<\/h2>\n<p>In the file you just created, paste the following:<\/p>\n<pre><code>version: '3'  \r\n\r\nservices:\r\n\r\n  proxy:\r\n    image: jwilder\/nginx-proxy:alpine\r\n    labels:\r\n      - \"com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true\"\r\n    container_name: nextcloud-proxy\r\n    networks:\r\n      - nextcloud_network\r\n    ports:\r\n      - 80:80\r\n      - 443:443\r\n    volumes:\r\n      - .\/proxy\/conf.d:\/etc\/nginx\/conf.d:rw\r\n      - .\/proxy\/vhost.d:\/etc\/nginx\/vhost.d:rw\r\n      - .\/proxy\/html:\/usr\/share\/nginx\/html:rw\r\n      - .\/proxy\/certs:\/etc\/nginx\/certs:ro\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n      - \/var\/run\/docker.sock:\/tmp\/docker.sock:ro\r\n    restart: unless-stopped\r\n<\/code><\/pre>\n<p>Let\u2019s look at the configuration created in the above <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file in detail. The service for proxy uses the image from <a href=\"https:\/\/github.com\/jwilder\/nginx-proxy\" target=\"_blank\" rel=\"noopener\">jwilder\/nginx-proxy<\/a>. The label <code>\"com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy\"<\/code> is used so that the Let\u2019s Encrypt container knows which nginx proxy container to use for certificate generation.Then, there is network by the name <code>nextcloud_network<\/code>, which is used by the containers to communicate among themselves. The Volumes section is used by the container to configure the Nginx virtual host and to access certificates generated by Let\u2019s Encrypt companion container. The <code>\/etc\/localtime:\/etc\/localtime:ro<\/code> is used to duplicate the host timezone inside the container.<\/p>\n<h2><a class=\"md-header-anchor md-print-anchor\" href=\"af:\/\/n218\" name=\"header-n218\" target=\"_blank\"> <\/a>Step 5. Configure the Let\u2019s Encrypt Container<\/h2>\n<p>Now that you have <code>nginx<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>proxy<\/code> container set up, you can add the following to your <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file.<\/p>\n<pre><code>  letsencrypt:\r\n    image: jrcs\/letsencrypt-nginx-proxy-companion\r\n    container_name: nextcloud-letsencrypt\r\n    depends_on:\r\n      - proxy\r\n    networks:\r\n      - nextcloud_network\r\n    volumes:\r\n      - .\/proxy\/certs:\/etc\/nginx\/certs:rw\r\n      - .\/proxy\/vhost.d:\/etc\/nginx\/vhost.d:rw\r\n      - .\/proxy\/html:\/usr\/share\/nginx\/html:rw\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n      - \/var\/run\/docker.sock:\/var\/run\/docker.sock:ro\r\n    restart: unless-stopped\r\n<\/code><\/pre>\n<p>The Lets\u2019 Encrypt container depends on our first service (<code>proxy<\/code>) and is a part of the network <code>nextcloud_network<\/code>. The <code>restart: unless<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>stopped<\/code> allows the containers to be stopped gracefully unless you manually run <code>docker stop letsencrypt<\/code> or <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose down letsencrypt<\/code>.<\/p>\n<h2><strong>Step 6. Configure the MariaDB Container<\/strong><\/h2>\n<p>For Nextcloud to work correctly, we need to connect it to a MariaDB database. Fortunately, we can add that to our <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file as well:<\/p>\n<pre><code>  db:\r\n    image: mariadb\r\n    container_name: nextcloud-mariadb\r\n    networks:\r\n      - nextcloud_network\r\n    volumes:\r\n      - db:\/var\/lib\/mysql\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n    environment:\r\n      - MYSQL_ROOT_PASSWORD=secret\r\n      - MYSQL_PASSWORD=mysql\r\n      - MYSQL_DATABASE=nextcloud\r\n      - MYSQL_USER=nextcloud\r\n    restart: unless-stopped\r\n<\/code><\/pre>\n<p>The service section for MariaDB is pretty self-explanatory. This container is also part of the network <code>nextcloud_network.<\/code> We have also defined the environment variable for the database name, username, and password that Nextcloud uses to connect to the database.<\/p>\n<h2><strong>Step 7. Configure the Nextcloud Docker Container<\/strong><\/h2>\n<p>We\u2019re finally ready to create the Nextcloud Docker container in our <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> file. Add the following to the bottom.<\/p>\n<pre><code>  app:\r\n    image: nextcloud:latest\r\n    container_name: nextcloud-app\r\n    networks:\r\n      - nextcloud_network\r\n    depends_on:\r\n      - letsencrypt\r\n      - proxy\r\n      - db\r\n    volumes:\r\n      - nextcloud:\/var\/www\/html\r\n      - .\/app\/config:\/var\/www\/html\/config\r\n      - .\/app\/custom_apps:\/var\/www\/html\/custom_apps\r\n      - .\/app\/data:\/var\/www\/html\/data\r\n      - .\/app\/themes:\/var\/www\/html\/themes\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n    environment:\r\n      - VIRTUAL_HOST=nextcloud.YOUR-DOMAIN\r\n      - LETSENCRYPT_HOST=nextcloud.YOUR-DOMAIN\r\n      - LETSENCRYPT_EMAIL=YOUR-EMAIL\r\n    restart: unless-stopped\r\n<\/code><\/pre>\n<p>The nextcloud service depends on the other three containers. To make Nextcloud\u2019s data persistent while upgrading, and get access to backups, we use a named Docker volume <code>nextcloud<\/code>, similar to the way we used a Docker volume named <code>db<\/code> for the MariaDB data.<br \/>\nHere, we have defined the virtual host, Let\u2019s Encrypt host, and email in the environment variables <code>VIRTUAL_HOST<\/code>, <code>LETSENCRYPT<em>HOST<\/em><\/code>, and <code>LETSENCRYPT``<strong>EMAIL<\/strong><\/code>, respectively. The proxy service creates the subdomain and encrypts it with Let\u2019s Encrypt certificates for the container, given you supply valid domains and emails for those three environment variables.<\/p>\n<p>At last, we need defined volumes for both Nextcloud and MariaDB for data persistence followed by networks.<\/p>\n<pre><code>volumes:\r\n  nextcloud:\r\n  db:\r\n\r\nnetworks:\r\n  nextcloud_network:\r\n<\/code><\/pre>\n<p>After combining all the service definitions, your final <code>docker<span style=\"font-family: 'Open Sans', 'Clear Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">-<\/span>compose.yml<\/code> should look like following:<\/p>\n<pre><code>version: '3' \r\n\r\nservices:\r\n\r\n  proxy:\r\n    image: jwilder\/nginx-proxy:alpine\r\n    labels:\r\n      - \"com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true\"\r\n    container_name: nextcloud-proxy\r\n    networks:\r\n      - nextcloud_network\r\n    ports:\r\n      - 80:80\r\n      - 443:443\r\n    volumes:\r\n      - .\/proxy\/conf.d:\/etc\/nginx\/conf.d:rw\r\n      - .\/proxy\/vhost.d:\/etc\/nginx\/vhost.d:rw\r\n      - .\/proxy\/html:\/usr\/share\/nginx\/html:rw\r\n      - .\/proxy\/certs:\/etc\/nginx\/certs:ro\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n      - \/var\/run\/docker.sock:\/tmp\/docker.sock:ro\r\n    restart: unless-stopped\r\n\r\n  letsencrypt:\r\n    image: jrcs\/letsencrypt-nginx-proxy-companion\r\n    container_name: nextcloud-letsencrypt\r\n    depends_on:\r\n      - proxy\r\n    networks:\r\n      - nextcloud_network\r\n    volumes:\r\n      - .\/proxy\/certs:\/etc\/nginx\/certs:rw\r\n      - .\/proxy\/vhost.d:\/etc\/nginx\/vhost.d:rw\r\n      - .\/proxy\/html:\/usr\/share\/nginx\/html:rw\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n      - \/var\/run\/docker.sock:\/var\/run\/docker.sock:ro\r\n    restart: unless-stopped\r\n\r\n  db:\r\n    image: mariadb\r\n    container_name: nextcloud-mariadb\r\n    networks:\r\n      - nextcloud_network\r\n    volumes:\r\n      - db:\/var\/lib\/mysql\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n    environment:\r\n      - MYSQL_ROOT_PASSWORD=toor\r\n      - MYSQL_PASSWORD=mysql\r\n      - MYSQL_DATABASE=nextcloud\r\n      - MYSQL_USER=nextcloud\r\n    restart: unless-stopped\r\n\r\n  app:\r\n    image: nextcloud:latest\r\n    container_name: nextcloud-app\r\n    networks:\r\n      - nextcloud_network\r\n    depends_on:\r\n      - letsencrypt\r\n      - proxy\r\n      - db\r\n    volumes:\r\n      - nextcloud:\/var\/www\/html\r\n      - .\/app\/config:\/var\/www\/html\/config\r\n      - .\/app\/custom_apps:\/var\/www\/html\/custom_apps\r\n      - .\/app\/data:\/var\/www\/html\/data\r\n      - .\/app\/themes:\/var\/www\/html\/themes\r\n      - \/etc\/localtime:\/etc\/localtime:ro\r\n    environment:\r\n      - VIRTUAL_HOST=nextcloud.YOUR-DOMAIN\r\n      - LETSENCRYPT_HOST=nextcloud.YOUR-DOMAIN\r\n      - LETSENCRYPT_EMAIL=YOUR-EMAIL\r\n    restart: unless-stopped\r\n\r\nvolumes:\r\n  nextcloud:\r\n  db:\r\n\r\nnetworks:\r\n  nextcloud_network:\r\n<\/code><\/pre>\n<h2>Step 8. Get Everything Running!<\/h2>\n<p>Now run the <code>docker compose<\/code> from the terminal to create the containers:<\/p>\n<pre><code>$ docker compose up -d\r\nCreating nextcloud-mariadb ... done\r\nCreating nextcloud-proxy   ... done\r\nCreating nextcloud-letsencrypt ... done\r\nCreating nextcloud-app         ... done\r\n<\/code><\/pre>\n<p>To confirm all the containers are running, issue the following command:<\/p>\n<pre><code>$ docker ps -a\r\nCONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                                      NAMES\r\n92222232c4be        nextcloud:latest                         \"\/entrypoint.sh apac\u2026\"   9 minutes ago       Up 9 minutes        80\/tcp                                     nextcloud-app\r\n89e96fe10ee6        jrcs\/letsencrypt-nginx-proxy-companion   \"\/bin\/bash \/app\/entr\u2026\"   9 minutes ago       Up 9 minutes                                                   nextcloud-letsencrypt\r\nd059517f519c        jwilder\/nginx-proxy:alpine               \"\/app\/docker-entrypo\u2026\"   9 minutes ago       Up 9 minutes        0.0.0.0:80-&gt;80\/tcp, 0.0.0.0:443-&gt;443\/tcp   nextcloud-proxy\r\n7e0945eb6608        mariadb                                  \"docker-entrypoint.s\u2026\"   9 minutes ago       Up 9 minutes        3306\/tcp                                   nextcloud-mariadb\r\n<\/code><\/pre>\n<p>Wait a minute for the SSL certificate generation process to finish, and then load up the domain name you chose in your browser. Enter your chosen admin username and password. Choose MySQL as the database in the configure database section. Type in the username, password, and database name you configured via the <code>MYSQL_USER<\/code>, <code>MYSQL_PASSWORD<\/code>, and <code>MYSQL_DATABASE<\/code> environment variable from earlier. Change the hostname value from <code>localhost<\/code> to <code>db<\/code> and click <em>Finish Setup<\/em>. The system then redirects you to the Nextcloud dashboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8783 size-full\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/NextCloud-1.png\" alt=\"install nextcloud with docker and docker compose\" width=\"1026\" height=\"613\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/NextCloud-1.png 1026w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/NextCloud-1-300x179.png 300w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/NextCloud-1-1024x612.png 1024w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2020\/03\/NextCloud-1-768x459.png 768w\" sizes=\"auto, (max-width: 1026px) 100vw, 1026px\" \/><\/p>\n<p>The containerization of Nextcloud with Docker is complete! You have now learned how to install Nextcloud using Docker and Docker Compose.<\/p>\n<p>Now you can upload files and photos to your drive hosted on your VPS and share them with others.<\/p>\n<p>To extend the functionality of your Nextcloud server, you can now consider installing any number of the available apps, such as <a href=\"https:\/\/apps.nextcloud.com\/apps\/bookmarks\" target=\"_blank\" rel=\"noopener\">Bookmarks<\/a>, <a href=\"https:\/\/apps.nextcloud.com\/apps\/calendar\" target=\"_blank\" rel=\"noopener\">Calendar<\/a>, <a href=\"https:\/\/apps.nextcloud.com\/apps\/contacts\" target=\"_blank\" rel=\"noopener\">Contacts<\/a>, <a href=\"https:\/\/apps.nextcloud.com\/apps\/tasks\" target=\"_blank\" rel=\"noopener\">Tasks<\/a>, <a href=\"https:\/\/apps.nextcloud.com\/apps\/notes\" target=\"_blank\" rel=\"noopener\">Notes<\/a>, and more available on the <a href=\"https:\/\/apps.nextcloud.com\/\" target=\"_blank\" rel=\"noopener\">Nextcloud App Store<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elevate your data management game with our comprehensive guide: Install Nextcloud effortlessly using Docker and Docker Compose. Take charge of your files today!<\/p>\n","protected":false},"author":20,"featured_media":8932,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[182,180],"class_list":["post-1912","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-docker","tag-nextcloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=1912"}],"version-history":[{"count":21,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1912\/revisions"}],"predecessor-version":[{"id":12924,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1912\/revisions\/12924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/8932"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=1912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=1912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=1912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}