Languages avaliable: pt-BR
You need to have, on your server, the installed docker. The installation can be done with an official script, following the following steps:
- Download the docker
curl -fsSL https://get.docker.com -o get-docker.sh- run the script
sh get-docker.sh- Give permissions to execute the Docker command to your user
sudo usermod -aG docker $USER- Remove the installation script
rm get-docker.shFollow the instructions of this repository:
https://github.com/LibreCodeCoop/nginx-proxy
Follow the instructions of this repository:
https://github.com/LibreCodeCoop/postgres-docker
Copy the .env.example to .env and set the values.
cp .env.example .env| Environment | service | Description | 
|---|---|---|
| VIRTUAL_HOST | web | Your domain | 
| LETSENCRYPT_HOST | web | Your domain | 
| LETSENCRYPT_EMAIL | web | Your sysadmin email | 
| NEXTCLOUD_TRUSTED_DOMAINS | app | domains separated by comma. The domain web is mandatory, add your domain together with whe domain web. The domain webis the domain of Nginx service. | 
| POSTGRES_DB | db | PostgreSQL database name (default: nextcloud) | 
| POSTGRES_USER | db | PostgreSQL database user (default: nextcloud) | 
| POSTGRES_PASSWORD | db | PostgreSQL database user password | 
| POSTGRES_HOST | app | PostgreSQL server host (default: postgres) | 
| NEXTCLOUD_ADMIN_USER | app | Nextcloud administrator username | 
| NEXTCLOUD_ADMIN_PASSWORD | app | Nextcloud administrator password | 
| NEXTCLOUD_ADMIN_EMAIL | app | Nextcloud administrator email | 
| SMTP_HOST | app | SMTP server for email sending | 
| SMTP_SECURE | app | SMTP security type (ssl, tls, or empty) | 
| SMTP_PORT | app | SMTP server port | 
| SMTP_AUTHTYPE | app | SMTP authentication type (LOGIN, PLAIN, NTLM) | 
| SMTP_NAME | app | Username for SMTP authentication | 
| SMTP_PASSWORD | app | Password for SMTP authentication | 
| MAIL_FROM_ADDRESS | app | Sender email address | 
| MAIL_DOMAIN | app | Sender email domain | 
| TZ | app | Timezone (e.g., America/Sao_Paulo) | 
PS: Let's Encrypt only work in servers when the
VIRTUAL_HOSTandLETSENCRYPT_HOSThave a valid public domain registered in a DNS server. Don't try to use in localhost, don't work!
Create a network
docker network create reverse-proxy
docker network create postgresAfter finish the setup, access this url: https://yourdomain.tld/settings/admin/overview.
If is necessary run any occ command, run like this:
docker compose exec -u www-data app ./occ db:add-missing-indices
docker compose exec -u www-data app ./occ db:convert-filecache-bigintYou can do this using environments and creating a file called docker-compose.override.yml to add new services.
- Create your .inifile atvolumes/php/folder. Example:volumes/php/xdebug.ini
- Alter the file docker-compose.override.ymladding your volume
services:
  app:
    volumes:
      - ./volumes/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini- For PHP-FPM modifications, include the following volume to the app service in docker-compose.override.ymlfile:
services:
  app:
    volumes:
        - ./volumes/php/pm.ini:/usr/local/etc/php/conf.d/- Create a file  ./volumes/php/pm.iniwith the following content (see references for tunning according your setup):
[www]
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3- References:
- https://docs.nextcloud.com/server/21/admin_manual/installation/server_tuning.html#tune-php-fpm
- https://spot13.com/pmcalculator/
# The postgres service is executed separated to be possible reuse this service to other applications that use PostgreSQL
docker compose up -f docker-compose-postgres.yml -d
docker compose up -d
docker compose -dChange the value of NEXTCLOUD_VERSION at .env file and put the tag name that you want to use. Check the availables tags here: https://hub.docker.com/_/nextcloud/tags
Build the images, down the containers and get up again:
docker compose build --pull
docker compose up -dIf you want to see the logs, run:
docker compose logs -f --tail=100You will see this message in the logs and other many upgrade messages:
app_1      | 2020-04-28T19:49:38.568623133Z Initializing nextcloud 18.0.4.2 ...
app_1      | 2020-04-28T19:49:38.577733913Z Upgrading nextcloud from 18.0.3.0 ...