Skip to content

ljgonzalez1/nextcloud_docker

 
 

Repository files navigation

Nextcloud with docker

Install

Copy .env.dist to .env and edit values to your needs:

cp .env.dist .env
vim .env

Build docker images:

docker-compose -f docker-compose.build.yml build --pull

Run docker stock:

docker-compose up [-d]

Goto http://localhost:$NEXTCLOUD_PORT and follow Nextcloud installation instructions.

Log level

To "increase" performance you can set log level to error:

bin/occ log:manage --level=error

Improving Nextcloud Previews

According to this article Preview mechanism need some tuning.

Install Nextcloud app and setup recommended configurations:

bin/occ config:app:set previewgenerator squareSizes --value="32 256"
bin/occ config:app:set previewgenerator widthSizes  --value="256 384"
bin/occ config:app:set previewgenerator heightSizes --value="256"
bin/occ config:system:set preview_max_x --value 2048
bin/occ config:system:set preview_max_y --value 2048
bin/occ config:system:set jpeg_quality --value 60
bin/occ config:app:set preview jpeg_quality --value="60"

If you want to start from scratch you can delete preview folder:

rm -rf ./data/appdata_*/preview

And regenerate previews first time by:

bin/occ preview:generate-all -vvv

Full Text Search

To improve search result we can install:

goto settings, select Elasticsearch from select box, as an address type http://elasticsearch:9200 and setup index to nextcloud_index.

For first index run:

bin/occ fulltextsearch:index

Collabora online

If you want to run collabora online locally and you don't have a reverse proxy, you have to add nginx and collabora to your /etc/hosts:

127.0.0.1 collabora
127.0.0.1 nginx

For nextcloud (docker service) collabora is avaliable under collabora host and it has to be the same host for a client (your browser).

For collabora (docker service) nextcloud is avaliable under nginx host and you have to access nextcloud instance via http://nginx:$NEXTCLOUD_PORT.


Install richdocuments, goto settings, select Use your own server and as an url put http://collabora:9980.

Done!

Reverse proxy

Basic nginx configuration for reverse proxy is avaliable here.

Update Server > Domain names and Reverse proxy > proxy_pass ports (read ports from your .env file).

Remove include nginxconfig.io/security.conf; from nextcloud domain conf. Docker nginx service conf is build base on Nextcloud example.

In .env file you have to change:

NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.example.com
COLLABORA_CERT_DOMAIN=collabora.example.com
COLLABORA_SERVER_NAME=collabora.example.com
COLLABORA_DOMAIN=nextcloud.example.com

If you have install nextcloud already, in ./config/config.php:

  • add nextcloud.example.pl to trusted_domains array,
  • change overwrite.cli.url to nextcloud.example.pl.

If you have setup collabora online, you have to update URL (and Port) of Collabora Online-server to collabora.example.com.

Reload docker:

docker-compose up [-d]

Talk (STUN / TURN)

If you have install talk app and you want to "increase" performance and have video calls, you have to set up your own STUN/TURN server.

In .env change COTURN_REALM to your nextcloud domain, goto settings and set:

  • STUN server to your-server-ip:$COTURN_PORT,
  • TURN server to your-server-ip:$COTURN_PORT,
  • TURN secret to $COTURN_SECRET.

Notify Push

To configure notify_push app:

  • Install the notify_push app from the appstore,
  • Restart nextcloud service (docker-compose restart nextcloud),
  • set the url of the push server (bin/occ notify_push:setup http://domain/push)

If you got push server is not a trusted proxy then you have to add displayed proxies in config/config.php to trusted_proxies.

Update / Deploy

Update images names (.env *_IMAGE) which point to your hub.

Run:

docker-compose -f docker-compose.build.yml build --pull

If you didn't build images on the server run:

docker-compose -f docker-compose.build.yml push

On the server run:

docker-compose pull
docker-compose up -d

About

Docker setup to run Nextcloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 82.6%
  • Shell 17.4%