Nextcloud (stack)
Where are your photos and documents? With Nextcloud you pick a server of your choice, at home, in a data center or at a provider. And that is where your files will be. Nextcloud runs on that server, protecting your data and giving you access from your desktop or mobile devices.
linux
Sourced
Repo
Env Vars
PUID=1000PGID=100TZ=''DATABASE_PASSWORD=''MYSQL_ROOT_PASSWORD=''PORT=''
Services
nextcloud
linuxserver/nextcloud
Ports
${PORT}:443
/config : /portainer/Files/AppData/Config/Nextcloud/Config
unless-stopped
Env Vars
PUID=${PUID}PGID=${PGID}TZ=${TZ}
nextcloud_db
linuxserver/mariadb
Volumes
/config : /portainer/AppData/Config/Nextcloud/DB
unless-stopped
Env Vars
PUID=${PUID}PGID=${PGID}MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}TZ=${Timezone}MYSQL_DATABASE=nextcloud_dbMYSQL_USER=nextcloudMYSQL_PASSWORD=${DATABASE_PASSWORD}
Installation
Via Portainer
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select the app you wish to deploy, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me

Via Docker Run
Service #1 - nextcloud
docker run --name nextcloud -d \
-e "${PUID}" \
-e "${PGID}" \
-e "${TZ}" \
-p ${PORT}:443 \
-v /portainer/Files/AppData/Config/Nextcloud/Config:/config \
--restart=unless-stopped \
linuxserver/nextcloud
Service #2 - nextcloud_db
docker run --name nextcloud_db -d \
-e "${PUID}" \
-e "${PGID}" \
-e "${MYSQL_ROOT_PASSWORD}" \
-e "${Timezone}" \
-e "nextcloud_db" \
-e "nextcloud" \
-e "${DATABASE_PASSWORD}" \
-v /portainer/AppData/Config/Nextcloud/DB:/config \
--restart=unless-stopped \
linuxserver/mariadb
Via Docker Compose
Save this file as docker-compose.yml and run docker-compose up -d
Use this only as a guide.
- name: nextcloud
image: linuxserver/nextcloud
ports:
- ${PORT}:443
volumes:
- bind: /portainer/Files/AppData/Config/Nextcloud/Config
container: /config
restart_policy: unless-stopped
env:
- name: PUID
value: ${PUID}
- name: PGID
value: ${PGID}
- name: TZ
value: ${TZ}
- name: nextcloud_db
image: linuxserver/mariadb
volumes:
- bind: /portainer/AppData/Config/Nextcloud/DB
container: /config
restart_policy: unless-stopped
env:
- name: PUID
value: ${PUID}
- name: PGID
value: ${PGID}
- name: MYSQL_ROOT_PASSWORD
value: ${MYSQL_ROOT_PASSWORD}
- name: TZ
value: ${Timezone}
- name: MYSQL_DATABASE
value: nextcloud_db
- name: MYSQL_USER
value: nextcloud
- name: MYSQL_PASSWORD
value: ${DATABASE_PASSWORD}
Alternative Methods
For more installation options, see the Documentation in the GitHub repo
Container Documentation
nextcloud Documentation
A Nextcloud container, brought to you by LinuxServer.io.
nextcloud_db Documentation
A Mariadb container, brought to you by LinuxServer.io.