GithubHelp home page GithubHelp logo

docker-nextcloud-letsencrypt's Introduction

Automated docker nextcloud for nginx proxy (webproxy) integrated with LetsEncrypt

This repo allows you to set up the great Nextcloud as a container over SSL auto generated and auto renewed by our Web Proxy.

Nextcloud Environment

Prerequisites

In order to use this compose file (docker-compose.yml) you must have:

  1. docker https://docs.docker.com/engine/installation/
  2. docker-compose https://docs.docker.com/compose/install/
  3. docker-compose-letsencrypt-nginx-proxy-companion https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion

How to use

  1. Clone this repository:
git clone https://github.com/evertramos/docker-nextcloud-letsencrypt.git
  1. Make a copy of our .env.sample and rename it to .env:

Update this file with your preferences.

#
# Configuration for Nextcloud using NGINX WebProxy
#

# Containers name
DB_CONTAINER_NAME=cloud-db
APP_CONTAINER_NAME=cloud-app

# Mysql settings
MYSQL_HOST=cloud-db
MYSQL_DATABASE=cloud_db
MYSQL_ROOT_PASSWORD= cloud,root,password
MYSQL_USER=cloud_user
MYSQL_PASSWORD=cloud,user,password

# Nextcloud settings
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=admin,password

# Nextcloud data path
NEXTCLOUD_DATA_DIR=/var/www/html/data
NEXTCLOUD_TABLE_PREFIX=

# Nextcloud local data path
LOCAL_DB_DIR=/home/user/cloud/data/db
LOCAL_DATA_DIR=/home/user/cloud/data/cloud
LOCAL_CONF_DIR=/home/user/cloud/data/cloud/config
LOCAL_APPS_DIR=/home/user/cloud/data/cloud/apps

# Host 
VIRTUAL_HOST=cloud.yourdomain.com
LETSENCRYPT_HOST=cloud.yourdomain.com
[email protected]

#
# Network name
# 
# Your container app must use a network connected to your webproxy 
# https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion
#
NETWORK=webproxy
  1. Start your container
$ docker-compose up -d
  1. Overwrite protocol to https
$ docker exec --user www-data cloud-app php occ config:system:set overwriteprotocol --value="https"

This container must be in a network connected to your webproxy containers or use the same network of the webproxy.

Please keep in mind that when starting for the first time it may take a few moments (even a couple minutes) to get your Let's Encrypt certificates generated.

Any further Nextcloud configuration please check Nextcloud Admin Documentation

docker-nextcloud-letsencrypt's People

Contributors

alanqchen avatar evertramos avatar goodchip avatar mstroppel avatar parthjdabhi avatar sateesh-pagolu avatar thrasos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-nextcloud-letsencrypt's Issues

occ db:convert-filecache-bigint

There are some warnings regarding your setup.

* Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read [the documentation page about this](https://docs.nextcloud.com/server/17/go.php?to=admin-bigint-conversion).
  * mounts.storage_id
  * mounts.root_id
  * mounts.mount_id

Please double check the [installation guides ↗](https://docs.nextcloud.com/server/17/go.php?to=admin-install), and check for any errors or warnings in the [log](https://cloud.hellenic-milsim.community/settings/admin/logging).

Check the security of your Nextcloud over [our security scan ↗](https://scan.nextcloud.com).

.env file: env.txt
docker-compose.yml: docker-compose.yml.txt

Solution:
Run on container cloud-ap the following:
sudo docker exec -it --user www-data cloud-app php occ db:convert-filecache-bigint

SMTP Service for nextcloud

Hi,

first of all many thanks for your great work. I'm a newbie to server administration, the console and all these things. With your files provided life is so much easier... :)

I've noticed that I'm unable to set up a working SMTP-Service in Nextcloud. The error message is:

Expected response code 220 but got code "421", with message "421 smtp.strato.de : No SMTP service (MBL-B) "

Could it be possible that the SMTP service is blocked by nginx. And if so do you have any idea how to change it?

Many thanks in advance.

Greetings from Berlin
Lutz

Nextcloud proxy settings

Hi Evert, first of all thanks a lot for this repo, after much trying examples around, yours worked at first try, great stuff, thanks a bunch!

I'm having some upload issues and tried lots of things (nginx .conf settings, stopping server antivirus, php settings) but I'm still unable to upload files bigger than 1M...

I just read that adjusting NC proxy settings could be a good thing, do you think it's necessary? I think overwritehost and overwriteprotocol would be the relevant ones, but I'm not sure what to use for overwritehost...
https://github.com/nextcloud/server/blob/master/config/config.sample.php#L451

Access through untrusted domain

I get this error when I first call the domain defined with VIRTUAL_HOST and LETSENCRYPT_HOST:

**Access through untrusted domain**
Please contact your administrator. If you are an administrator, edit the "trusted_domains" setting in config/config.php like the example in config.sample.php.


Further information how to configure this can be found in the documentation.

What did I wrong?

Really slow upload and download speeds.

Before I say anything, thanks for awesome work on this series of repos.
I setup the proxy and others docker containers (wp, nextcoud, portainer),
however the nextcloud (NC) is giving me really slow upload (max 10mb/s, avg 6mb/s) and download (6mb/s).
I tried in two different networks, one in the same LAN (via ethernet) as my NC server (traceroute looks like is going out of my LAN and come back) and other network where I have bandwidth of 1GB/s and I obtained same results on both.
Doing a web search people suggested to disable HTTP/2 in nginx (I have not tried it yet).
Comparing to my previous NC setup which I have a 3TB HDD I can almost utilize the full capability of ethernet (100mb/s) on uploads.
My proxy/NC server setup is 1TB SSD with intel xeon 2690v3 (12c/24t) and CPU-Usage during upload/downloads is not a bottleneck (less than 10%).
Anyone have a suggestion idea of what could be the issue?

Quick question

I followed the instructions and installed it successfully.

However, I'm getting the error below whenever I'm accessing https:// (locally)

503 Service Temporarily Unavailable

Is this because the IP address of the server is not public and the letsencrypt cert is failing?

Thank you in advance!

Windows / Linux client : “server replied: server entity too large”

Hi,

After fixing my php-fpm problem, I now have the error: server replied: server entity too large

Looking more ready and looking on the internet, it appears that you have to change the value client_max_body_size

Searching the docker-compose-letsencrypt-nginx-proxy-companion and docker-nextcloud-letsencrypt-nginx-proxy-companion folder is what I got in response:

./docker-compose-letsencrypt-nginx-proxy-companion/conf.d/uploadsize.conf
./docker-nextcloud-letsencrypt/data/cloud/core/doc/admin/installation/nginx.html

I change the value for both files: 10G

And I then restart the containers.

I change the value for both files: 10G

And I then restart the containers.
Despite the changes, I still have the error message: server replied: server entity too large

Une idée ? (An idea?) :)

Database issue: SQLSTATE[HY000] [2006] MySQL server has gone away

Hi!

I've got this error:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away
and this in logs:

cloud-db     | 2020-05-13 20:46:17 9 [Warning] Aborted connection 9 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.6' (This connection closed normally without authentication)
cloud-app    | 172.19.0.4 - - [13/May/2020:20:46:17 +0000] "POST /index.php HTTP/1.1" 200 3606 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"
cloud-app    | [Wed May 13 20:46:29.151194 2020] [access_compat:error] [pid 33] [client 172.19.0.4:56694] AH01797: client denied by server configuration: /var/www/html/data/htaccesstest.txt
cloud-app    | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "GET /data/htaccesstest.txt HTTP/1.1" 403 673 "-" "Nextcloud Server Crawler"
cloud-app    | [Wed May 13 20:46:29.180728 2020] [access_compat:error] [pid 35] [client 172.19.0.4:56700] AH01797: client denied by server configuration: /var/www/html/data/htaccesstest.txt
cloud-app    | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "GET /data/htaccesstest.txt HTTP/1.1" 403 673 "-" "Nextcloud Server Crawler"
cloud-db     | 2020-05-13 20:46:29 10 [Warning] Aborted connection 10 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.6' (This connection closed normally without authentication)
cloud-app    | 172.19.0.4 - - [13/May/2020:20:46:29 +0000] "POST /index.php HTTP/1.1" 200 3603 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0"

*.*.*.* - my ip

when try to login first time.

I changed only paths in config, here it is:

# Containers name
DB_CONTAINER_NAME=cloud-db
DB_IMAGE_TAG=latest
APP_CONTAINER_NAME=cloud-app
APP_IMAGE_TAG=latest

# Mysql settings
MYSQL_HOST=cloud-db
MYSQL_DATABASE=cloud_db
MYSQL_ROOT_PASSWORD= cloud,root,password
MYSQL_USER=cloud_user
MYSQL_PASSWORD=cloud,user,password

# Nextcloud settings
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=admin,password

# Nextcloud data path
NEXTCLOUD_DATA_DIR=/var/www/html/data
NEXTCLOUD_TABLE_PREFIX=

# Nextcloud local data path
LOCAL_DB_DIR=/mnt/volume-cloud/cloud/data/db
LOCAL_DATA_DIR=/mnt/volume-cloud/cloud/data/cloud
LOCAL_CONF_DIR=/mnt/volume-cloud/cloud/data/cloud/config
LOCAL_APPS_DIR=/mnt/volume-cloud/cloud/data/cloud/apps

# Host
VIRTUAL_HOST=[here my domain]
LETSENCRYPT_HOST=[here my domain]
LETSENCRYPT_EMAIL=[here my mail]

#
# Network name
#
# Your container app must use a network conencted to your webproxy 
# https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion
#
NETWORK=webproxy

Host is ubuntu-server 18.04.

Thank you!

Windows / Linux client : “Connection Closed”

Hi,

Thank you very much for your nice work

I installed without problem the docker-compose-letsencrypt-nginx-proxy-companion and then installed and docker-nextcloud-letsencrypt.

I did not encounter any particular problem on the server side. Some settings in the Cpanel of Nextcloud and it's perfect!

I'm just enabled PHP-FPM on the domain in CPanel .But in Nextcloud Client (Linux and Windows) i have : Connection closed after a few minutes of synchronization

I have about 95GB of sync to do. So I settled in the Cpanel at 110 GB to be quiet

Despite having stopped the container Nextcloud and DB, always the same error

The error is the same with the Nextcloud client as the Owncloud client

Do you have an idea ? Thank you very much Ramos

Larger client_max_body_size by default

For the usage of Nextcloud I encountered the problem that the default client_max_body_size is not large enough, so it needs manual configuration as you shown in this gist of yours. It would be nice if this could be configured by default somehow, I now have to manually set this for the Nextcloud to work properly with anything above 1MB (which is a lot of files if you use this instead of dropbox). Is there any way to incorporate this in the .env file?

How can I update Nextcloud?

I installed nextcloud and everything was fine until I realized that my nextcloud version is 17.0.0.9.
I tried to use the web based updater but as shown in the image the button for updating does nothing.

nextcloud2

It's also interesting that it installed this old version by default although I checked my .env file for the APP_IMAGE_TAG variable which is set to latest.

I don't want to use such an outdated version. How can I update my nextcloud correctly?

Unable to read NEXTCLOUD_DATA_DIR

I have been banging my head around this. I've made some changes to my set up due to a typo in my nextcloud_data_dir path. Everything was working before. The new typoed path was created with no issues. However I was not happy. with the setup. So I removed everything to start again to correct the issue. But now I cannot get nextcloud to read the data-dir on ubuntu 18.04. Do you have any recommendations?

Error to connect database

Hi Evert,
Actually, i install a new server with docker.
I use your work :)
docker-compose-Nginx-Letsencryt is ok
docker-portainer-letsencrypt is ok
But for docker-nextcloud-letsencrypt , i have a problem.
When i start a new installation of nextcloud, i have :
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused

I Don't understand because my .env is totaly similar of my docker-nextcloud-letsencrypt. I just change :

Host
VIRTUAL_HOST=cloud.yourdomain.com
LETSENCRYPT_HOST=cloud.yourdomain.com
LETSENCRYPT_EMAIL=[email protected]

and i change

Nextcloud local data path
LOCAL_DB_DIR=/home/user/cloud/data/db
LOCAL_DATA_DIR=/home/user/cloud/data/cloud
LOCAL_CONF_DIR=/home/user/cloud/data/cloud/config
LOCAL_APPS_DIR=/home/user/cloud/data/cloud/apps

By

Nextcloud local data path
LOCAL_DB_DIR=./data/db
LOCAL_DATA_DIR=./data/cloud
LOCAL_CONF_DIR=./data/cloud/config
LOCAL_APPS_DIR=./data/cloud/apps

Thank a lot for your reply

Christophe

Change .env.sample

Hi,
For your .env.sample, i propose to change this

Nextcloud local data path

LOCAL_DB_DIR=/home/user/cloud/data/db
LOCAL_DATA_DIR=/home/user/cloud/data/cloud
LOCAL_CONF_DIR=/home/user/cloud/data/cloud/config
LOCAL_APPS_DIR=/home/user/cloud/data/cloud/apps

With

Nextcloud local data path

LOCAL_DB_DIR=./cloud/data/db
LOCAL_DATA_DIR=./cloud/data/cloud
LOCAL_CONF_DIR=./cloud/data/cloud/config
LOCAL_APPS_DIR=./cloud/data/cloud/apps

Best regards,

Christophe

Stuck on Grand Access

Hi!

I can't login from any client, android or linux or windows. Just from browser i can login and create some accounts.

I just enter my Login and Password and then tap to Grand access and it loops.

In logs i see this, nothing interesting:

│   MY_HOST_HERE SOME_IP - - [14/May/2020:09:49:28 +0000] "GET /login/flow/grant?clientIdentifier=&stateToken=cqX3gekquHSxSjKCJjdqCcb1F4AGTlSJEzNAOp1CaIUJ5eXbtGPojdPiY1Xk2GIr HTTP/2.0" 200 1597 "-" "Xiaomi Mi 9T Pro (Android)"          │
│   MY_HOST_HERE SOME_IP - - [14/May/2020:09:49:29 +0000] "GET /core/js/oc.js?v=42497c32 HTTP/2.0" 200 6197 "-" "Xiaomi Mi 9T Pro (Android)"                                                                                                │
│   MY_HOST_HERE SOME_IP - - [14/May/2020:09:49:29 +0000] "GET /cron.php HTTP/2.0" 200 20 "-" "Xiaomi Mi 9T Pro (Android)"                                                                                                                  │
│   MY_HOST_HERE SOME_OTHER_IP - - [14/May/2020:09:49:39 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 3380 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0" 

Optimal setting to use with Wordpress + NextCloud?

First of all, thank you for this repository and also the WordPress repository.
It has saved me a lot of time setting up my new VPS and a WordPress docker instance.

I am now looking to include your NextCloud repository under the same domain (but under the cloud subdomain like your sample suggests) and wondering what is the optimal way to set this up on the same instance? My concern is that we create a database for the WordPress instance and the NextCloud instance also seems to create a database which will create unnecessary overhead.

What is the best way to get something like above setup?

access from LAN

Since i have installed everything is working fine, just needed to add my domain into trusted_domains in config.php

when i try to connect to nextcloud from my lan I get 400 Bad request on both server host name and ip.

could you please help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.