Published On Apr 18, 2024
Join me in this comprehensive guide as we set up Nextcloud in an LXC container using Docker Compose on Proxmox. I'll walk you through each step, ensuring you can follow along and get your private cloud up and running in no time.
📝 Commands used in the video:
```bash
sudo apt-get update
sudo apt upgrade
sudo apt install curl
sudo apt install docker.io
sudo apt-get install gnupg
Overwrite the existing Docker GPG key just in case
curl -fsSL https://download.docker.com/linux/ubu... | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Add the Docker repository with the correct Ubuntu version codename
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list
Update your package database
sudo apt-get update
Install Docker, Docker CLI, containerd, and Docker Compose
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
sudo systemctl start docker
docker-compose up -d
docker exec -u root nextcloud chown -R www-data:www-data /var/www/html/data
sudo systemctl start docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
📄 Docker Compose YML:
services:
nextcloud:
image: nextcloud
container_name: nextcloud
restart: unless-stopped
networks:
cloud
depends_on:
nextclouddb
redis
ports:
8080:80
volumes:
./html:/var/www/html
./custom_apps:/var/www/html/custom_apps
./config:/var/www/html/config
./data:/var/www/html/data
environment:
PUID=1000
PGID=1000
TZ=TZ='Asia/Hong_Kong'
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
MYSQL_PASSWORD=dbpassword
MYSQL_HOST=nextclouddb
REDIS_HOST=redis
nextclouddb:
image: mariadb
container_name: nextcloud-db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
networks:
cloud
volumes:
./nextclouddb:/var/lib/mysql
environment:
PUID=1000
PGID=1000
TZ='Asia/Hong_Kong'
MYSQL_RANDOM_ROOT_PASSWORD=true
MYSQL_PASSWORD=dbpassword
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
collabora:
image: collabora/code
container_name: collabora
restart: unless-stopped
networks:
cloud
environment:
PUID=1000
PGID=1000
TZ='Asia/Hong_Kong'
password=password
username=nextcloud
domain=example.com
extra_params=--o:ssl.enable=true
ports:
9980:9980
redis:
image: redis:alpine
container_name: redis
volumes:
./redis:/data
networks:
cloud
nginx-proxy:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy
environment:
PUID=1000
PGID=1000
TZ='Asia/Hong_Kong'
restart: unless-stopped
ports:
'80:80'
'81:81'
'443:443'
volumes:
./data:/data
./letsencrypt:/etc/letsencrypt
networks:
cloud:
name: cloud
driver: bridge