Build a Nextcloud instance in Docker Compose complete with Redis and optional PostgreSQL
Go to file
James de67d26593 remove unused nginx files
rename NGINX_HOST to NEXTCLOUD_DOMAIN
2022-02-08 23:15:15 +00:00
nextcloud add previews config file 2022-01-31 22:44:18 +00:00
secrets replace mariadb with postgresql 2022-01-31 21:30:08 +00:00
.env.example remove unused nginx files 2022-02-08 23:15:15 +00:00
.gitignore replace mariadb with postgresql 2022-01-31 21:30:08 +00:00
README.md fix headings level 2022-02-02 17:08:49 +00:00
docker-compose.yaml remove unused nginx files 2022-02-08 23:15:15 +00:00

README.md

Nextcloud (Docker Compose)

Build a Nextcloud instance in Docker Compose complete with PostgreSQL, Redis and SSL

Prerequisites

  1. Docker
  2. Docker Compose
  3. SSL key and cert

Setup

  1. Create a copy of .env.example:
cp .env.example .env
  1. Replace the SSL_CERT_PATH and SSL_KEY_PATH variables in the newly created .env file to point to your SSL key and cert

  2. Replace the NGINX_HOST variable with your desired domain

  3. Replace VOLUME_PATH variable if you wish to change where volume data is stored

  4. Modify other variables as needed

  5. Create the required secrets files (you should consider restricting access to these files):

# Postgres
echo "SuperSecretPassword" > secrets/postgres_password.txt # Replace with your own super secret password

# Nextcloud
echo "admin" > secrets/nextcloud_admin_user.txt                   # Replace with desired admin username
echo "SuperSecretPassword" > secrets/nextcloud_admin_password.txt # Replace with super secret password for admin Nextcloud user
  1. Bring up the containers!
sudo docker-compose -p nextcloud up --build -d
  1. (Optional) To enable some file previews copy previews.config.php into your Nextcloud's config directory (replace $volume with the path you have set in the VOLUME_PATH environment variable):
sudo cp nextcloud/previews.config.php $volume/var/www/html/config/
sudo chown www-data:root $volume/var/www/html/config/