Skip to main content

Install Nextcloud on Docker

Version 2 configuration works best on the latest Nextcloud v29.0. 

As of this version, when it gives you the first admin login, create your new login and wait for a bit. You may need refresh or, leave and go back to the page.
It may take a while but it SHOULD eventually end up giving you the login screen to enter your new credentials. 

MIGRATIONS: if you need to migrate. You can still use the version 2 config but read the migration wiki before you continue. 

Version 1:

version: '3'

#volumes:
#  nextcloud:
#  mariadb:

services:
  mariadb:
    image: mariadb
    container_name: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - /mounted/local/storage/location/data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=Mariaisabitch
      - MYSQL_PASSWORD=Mariaisabitch
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=marialikescock

  nextcloud:
    image: nextcloud
    container_name: nextcloud
    restart: always
    links:
      - mariadb
    volumes:
      - /mounted/local/storage/location/config:/config
      - /mounted/local/storage/location/data:/data
      - /mounted/local/storage/location/apps:/apps
    ports:
      - 8091:80
    environment:
      - MYSQL_PASSWORD=Mariaisabitch
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=marialikescock
      - MYSQL_HOST=mariadb


Version 2: 

version: '3'
services:
  mariadb:
   image: mariadb
   container_name: nextmaria
   restart: unless-stopped
   command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
   volumes:
     - /mounted/local/storage/location/datadb:/var/lib/mysql
   ports:
     - 3006:3306
   environment:
     - MYSQL_ROOT_PASSWORD=Mariaisfat
     - MYSQL_PASSWORD=Mariaisfat     
     - MYSQL_DATABASE=nextcloud
     - MYSQL_USER=nextcloud

  Nextcloud:
    image: nextcloud
    container_name: nextcloud
    restart: unless-stopped
    links:
      - mariadb
    volumes:
      - /mounted/local/storage/location/data:/var/www/html
    ports:
      - 8000:80
    environment:
      - MYSQL_PASSWORD=Mariaisfath
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=mariadb