Using docker
Simple use
docker run -d -p 7000:80 nextcloud
With volume for later upgrade
docker run -d -p 7000:80 \
-v /dkr/nextcloud/nextcloud:/var/www/html \
-v /dkr/nextcloud/apps:/var/www/html/custom_apps \
-v /dkr/nextcloud/config:/var/www/html/config \
-v /dkr/nextcloud/data:/var/www/html/data \
-v /dkr/nextcloud/theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \
nextcloud
For advanced use cases:
docker run -d -p 7000:80 –name=my-nextcloud –restart=always -v /dkr/nextcloud/nextcloud:/var/www/html -v /dkr/nextcloud/apps:/var/www/html/custom_apps -v /dkr/nextcloud/config:/var/www/html/config -v /dkr/nextcloud/data:/var/www/html/data nextcloud
Install postgres on docker
docker run –name postgres-container -e POSTGRES_PASSWORD=postgres -p 5432:5432 –restart=always -e PGDATA=/var/lib/postgresql/data/pgdata -v /dkr/postgres:/var/lib/postgresql/data -d postgres