mirror of
https://github.com/Thumbscrew/nextcloud-docker-compose.git
synced 2025-01-18 09:35:46 +00:00
Build a Nextcloud instance in Docker Compose complete with Redis and optional PostgreSQL
|
||
---|---|---|
nextcloud | ||
secrets | ||
.env.example | ||
.gitignore | ||
docker-compose.yaml | ||
README.md |
Nextcloud (Docker Compose)
Build a Nextcloud instance in Docker Compose complete with PostgreSQL, Redis and SSL
Prerequisites
- Docker
- Docker Compose
- SSL key and cert
Setup
- Create a copy of
.env.example
:
cp .env.example .env
-
Replace the
SSL_CERT_PATH
andSSL_KEY_PATH
variables in the newly created.env
file to point to your SSL key and cert -
Replace the
NGINX_HOST
variable with your desired domain -
Replace
VOLUME_PATH
variable if you wish to change where volume data is stored -
Modify other variables as needed
-
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
- Bring up the containers!
sudo docker-compose -p nextcloud up --build -d
- (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 theVOLUME_PATH
environment variable):
sudo cp nextcloud/previews.config.php $volume/var/www/html/config/
sudo chown www-data:root $volume/var/www/html/config/