Before proceeding, ensure you are using Ubuntu with the following requirements:
- Primary disk: 50GB
- Secondary disk: At least 250GB (adjust as needed for your storage requirements)
Run the following script to install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Run the following command to list available disks:
fdisk -l
Example output:
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk /dev/sdb: 250 GiB, 268435456000 bytes, 524288000 sectors
mkfs.ext4 /dev/sdb
blkid
Example output:
/dev/sdb: UUID="f0fe2cb4-7dc2-4221-b2d7-43dca43a3151" BLOCK_SIZE="4096" TYPE="ext4"
Edit /etc/fstab
:
nano /etc/fstab
Add the following line:
UUID=f0fe2cb4-7dc2-4221-b2d7-43dca43a3151 /srv/docker/nextcloud ext4 defaults 0 2
mkdir -p /srv/docker/nextcloud
mount -a
Check if the disk is mounted correctly:
df -h
Example output:
/dev/sdb 246G 28K 233G 1% /srv/docker/nextcloud
After mounting, the lost+found
directory is automatically created on ext4 filesystems. It should be removed before proceeding:
rm -rf /srv/docker/nextcloud/lost+found
If you want to install the container manually you can continue with manual install
python3 -m venv env
source env/bin/activate # Linux/macOS
env\Scripts\activate # Windows
pip install -r requirements.txt
python nextcloud-cli.py
deactivate
python nextcloud-cli.py
This will set up the following directory structure:
/srv/docker/nextcloud/
├── docker-compose.yml
├── nextcloud.env
├── nextcloud-nginx/
│ ├── nginx.conf
│ ├── Dockerfile
├── data/
│ ├── nc_postgres/
│ ├── nc_redis/
│ ├── nc_html/
│ ├── nc_config/
│ ├── nc_custom_apps/
│ ├── nc_data/
│ ├── nginx_conf/
- Clone the repository
git clone https://github.com/netzint/nextcloud-cli.git /srv/docker/nextcloud
- Copy Configuration File
cp /srv/docker/nextcloud/nextcloud.env.example /srv/docker/nextcloud/nextcloud.env
- Modify Passwords in nextcloud.env
Edit
/srv/docker/nextcloud/nextcloud.env
and change:POSTGRES_PASSWORD=YOUR_SECURE_PASSWORD NEXTCLOUD_DB_PASSWORD=YOUR_SECURE_PASSWORD REDIS_PASS=YOUR_SECURE_PASSWORD NEXTCLOUD_ADMIN_PASSWORD=YOUR_SECURE_PASSWORD
- Configure Trusted Domains
Open
/srv/docker/nextcloud/nextcloud.env
and setNEXTCLOUD_TRUSTED_DOMAINS
:NEXTCLOUD_TRUSTED_DOMAINS=your.domain.com
- Start the containers
cd /srv/docker/nextcloud docker-compose up -d
python nextcloud-cli.py
The script will:
- Detect the currently installed Nextcloud version
- Fetch and update to the latest version
- Offer optional updates for PostgreSQL, Redis, and Nginx
- Restart Nextcloud automatically