:PROPERTIES:
:ID:       56f39be4-1108-4020-be5a-1f3a0fbf96fa
:END:
#+title: nextcloud
#+filetags: :self-hosting:

* The docker file:

#+begin_src bash

  version: '3.8'
  services:
    app:
      image: nextcloud
      restart: unless-stopped
      ports:
        - 8007:80
      volumes:
        - nextcloud:/var/www/html
      environment:
        - POSTGRES_DB=nextcloud
        - POSTGRES_USER=nextcloud
        - POSTGRES_PASSWORD=zxq123_nextcloud
        - POSTGRES_HOST=postgres
      networks:
        - postgres_network

  volumes:
    nextcloud:

  networks:
    postgres_network:
      external: true

#+end_src

* Database related things:

#+begin_src bash

  zxq_db=# CREATE DATABASE nextcloud;
  CREATE DATABASE
  zxq_db=# CREATE USER nextcloud WITH PASSWORD 'zxq123_nextcloud';
  CREATE ROLE
  zxq_db=# GRANT ALL PRIVILEGES ON DATABASE nextcloud TO nextcloud;
  GRANT
  zxq_db=# 

#+end_src




* Config

Location is:

sudo nano /var/lib/docker/volumes/nextcloud_nextcloud/_data/config/config.php

