Skip to content

netzint/nextcloud-cli

Repository files navigation

Setting Up and Using Python Virtual Environment (venv)

Table of Contents

  1. System Preparation
  2. Installing the Script
  3. Installing Nextcloud
  4. Updating Nextcloud

System Preparation

Requirements

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)

Installing Docker

Run the following script to install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Partitioning and Mounting the Secondary Disk

Checking Available Disks

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

Formatting the Disk

mkfs.ext4 /dev/sdb

Retrieving the UUID

blkid

Example output:

/dev/sdb: UUID="f0fe2cb4-7dc2-4221-b2d7-43dca43a3151" BLOCK_SIZE="4096" TYPE="ext4"

Adding to fstab

Edit /etc/fstab:

nano /etc/fstab

Add the following line:

UUID=f0fe2cb4-7dc2-4221-b2d7-43dca43a3151 /srv/docker/nextcloud ext4 defaults 0 2

Mounting the Disk

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

Removing lost+found Directory

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


Installing the Script

Creating a Virtual Environment

python3 -m venv env

Activating the Virtual Environment

source env/bin/activate  # Linux/macOS
env\Scripts\activate     # Windows

Installing Dependencies

pip install -r requirements.txt

Running the Script

python nextcloud-cli.py

Deactivating the Virtual Environment

deactivate

Installing Nextcloud

Automated Installation

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/

Manual Installation

  1. Clone the repository
    git clone https://github.com/netzint/nextcloud-cli.git /srv/docker/nextcloud
  2. Copy Configuration File
    cp /srv/docker/nextcloud/nextcloud.env.example /srv/docker/nextcloud/nextcloud.env
  3. 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
    
  4. Configure Trusted Domains Open /srv/docker/nextcloud/nextcloud.env and set NEXTCLOUD_TRUSTED_DOMAINS:
    NEXTCLOUD_TRUSTED_DOMAINS=your.domain.com
    
  5. Start the containers
    cd /srv/docker/nextcloud
    docker-compose up -d

Updating Nextcloud

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •