Nextcloud not work

Hello world,

I can’t get Nextcloud to work for some reason. I already have ports mapped on 8080 and or 80 for the nginx page so I put it on 9090. Well I ran my docker file but still can not access :frowning:

I used same PW at app and db…

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=*RPW*
      - MYSQL_PASSWORD=*PW*
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=*USERNAME*

  app:
    image: nextcloud
    restart: always
    ports:
      - 9090:90
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=*PW*
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

I also have allowed inbound 9090 and 90

Try 9090:80 instead. NextCloud is likely trying to listen to 80, which is seeing no traffic because nothing is mapped to that port.

It’s been a bit since I played with Docker, but I am pretty sure you can have multiple containers bind to the same port so long as you have different ports exposed externally (8080 & 9090, in this case).

4 Likes

Also make sure they’re both on a Docker network that can communicate.

If you use the nginx image, you’ll have to use a PHP-FPM container as well.

EDIT: Here’re the examples docker/.examples at master · nextcloud/docker · GitHub

I have 2 separate container

Yes you do. But you really need 3 (nginx, php-fpm and MySQL).

This worked!

1 Like

Question now is how can I have the files on a different drive. Something like this:
image

What OS are you hosting on?

On Linux, my experience is you need two things:

  1. Set the volume to whatever directory you want (similar to how you have it, not sure the exact syntax on Windows)
  2. Make sure that directory exists, and that the user Docker is running as has permission to read and write to that directory.

The issue was kinda solved, excluding the volumes thing. I don’t really know how to format the volumepaths in yaml readable for docker.

Anyways, this would solve the issue about not being able to access. The Page http://cc.abyss.fi

I don’t know how to setup https. I have serversided https certificate setup in the iis like mentioned in some tutorial but still can not access https://cc.abyss.fi or https://4byssal.ddns.net:9090

I found that to setup nextcloud all the way using my separate nginx server I needed to have a few more values in the docker-compose file.

that would be one that you might need if that is the url you want to access nextcloud at.

  • TRUSTED_PROXIES=192.168.0.100

proxy may not need to be set in your case since its all on the same IP, but you could try adding it anyways.

I also found that modifying the config file for nextcloud directly was easier sometimes, I’m still testing to make sure that these docker-compose values actually make the edits. The docker image I used comes from here.

https://hub.docker.com/_/nextcloud

1 Like

I haven’t been able to find that file…

On the machine running docker you can normally find it in this directory

/var/lib/docker/volumes/some_volume/_data/data/config/config.php

You may have to swap to sudo su to navigate to it. If so then you should consider moving to a dedicated volume at some point in the docker-compose file using

volumes:
  - /mnt/cloudVolume:/var/www/html

Or something like that.