Skip to main content
  1. Building Your Own Server/

Nextcloud - Self-Hosted Personal Cloud

·968 words·5 mins

Nextcloud Hub is a modern digital workspace that integrates key productivity and collaboration tools in one unified, modular platform. Unlike commercial cloud services that require subscriptions, track your file access, and use your data to train AI models, Nextcloud keeps your files private and under your control. This replaces Google Drive and gives your home a full office suite of programs.

This is an advanced installation. If you are looking to leave Gmail for privacy reasons, but aren’t ready to tackle this project, I recommend you check out Proton.

Why Nextcloud:

  • Your Files, Your Control: No corporate servers, no data mining, no subscriptions. Your files belong to you, not a corporation.
  • Privacy First: Your documents, photos, and personal files stay on your own server. No one else can access your documents or build profiles about your habits
  • Sync & Share: Access your files from any device and share with others securely. Your files won’t disappear if a service shuts down or changes terms
  • Open Source: Transparent, community-driven, and free to use

Resources
#

Installation Prep
#

Before installing Nextcloud, ensure you have the following ready:

  • Operating System: Linux Mint
  • Container Runtime: Docker & Docker Compose
  • Storage: 50GB+ Disk Space (depends on file volume) A NAS is preferred.
  • Network: Accessible from your local network (for web access)
  • Domain (Optional): A domain name for HTTPS access (You need to know what you are doing before you try this.)

Time to Complete
#

  • Total Time: ~60 minutes
    • 10 min: File system prep
    • 10 min: Docker setup
    • 15 min: Download Nextcloud images
    • 15 min: Initial setup and configuration
    • 10 min: Migration from cloud providers
  • Difficulty: Advanced
  • Note: This is an advanced setup requiring familiarity with Docker and system administration.

Understanding Nextcloud
#

Nextcloud is more than just file storage - it’s a complete collaboration platform:

  • Files: Sync and share documents, photos, and videos
  • Calendar: Manage your events and share calendars
  • Contacts: Sync your address book across devices
  • Talk: Video conferencing and chat
  • Tasks: Manage your to-do lists
  • Notes: Take and sync notes
  • Deck: Kanban-style project management

Architecture:

/home/USER/docker/nextcloud/
├── app/                    # Nextcloud application files
├── data/                   # Your actual files (mounted volume)
├── config/                 # Nextcloud configuration
├── mysql/                  # Database files
└── redis/                  # Redis cache data

Installation
#

Step 1: File System Prep
#

We need to create the directories to keep the docker-compose file and your data.

Create the Nextcloud directory

mkdir -p ~/docker/nextcloud/

Create the folders where your data will live:

mkdir -p ~/docker/nextcloud/{app,data,config,mysql,redis}

This creates the following structure:

/home/USER/docker/nextcloud/app/      # Nextcloud application
/home/USER/docker/nextcloud/data/     # Your files (will be mounted)
/home/USER/docker/nextcloud/config/   # Configuration
/home/USER/docker/nextcloud/mysql/    # Database
/home/USER/docker/nextcloud/redis/     # Cache

Step 2: Docker Setup
#

Make sure you are in your Nextcloud directory:

cd ~/docker/nextcloud

To double check you are in the right place, type pwd to see your current directory.

Create the docker-compose.yaml file:

sudo touch docker-compose.yaml

Use the nano program to edit the file:

sudo nano docker-compose.yaml

Step 3: docker-compose file
#

Copy the following text into the docker-compose file:

version: "3.8"

services:
  nextcloud-db:
    image: postgres:15
    container_name: nextcloud-db
    restart: unless-stopped
    volumes:
      - ./mysql:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=your_strong_database_password
      - POSTGRES_USER=nextcloud
      - POSTGRES_DB=nextcloud
    networks:
      - nextcloud-network

  nextcloud-redis:
    image: redis:7
    container_name: nextcloud-redis
    restart: unless-stopped
    volumes:
      - ./redis:/data
    networks:
      - nextcloud-network

  nextcloud-app:
    image: nextcloud:latest
    container_name: nextcloud-app
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - ./app:/var/www/html
      - ./data:/var/www/html/data
      - ./config:/var/www/html/config
    environment:
      - POSTGRES_HOST=nextcloud-db
      - POSTGRES_PASSWORD=your_strong_database_password
      - POSTGRES_USER=nextcloud
      - POSTGRES_DB=nextcloud
      - REDIS_HOST=nextcloud-redis
      - NEXTCLOUD_ADMIN_USER=admin
      - NEXTCLOUD_ADMIN_PASSWORD=your_strong_admin_password
      - TRUSTED_PROXIES=192.168.99.1
      - OVERWRITEPROTOCOL=http
      - OVERWRITEHOST=192.168.99.1:8080
    depends_on:
      - nextcloud-db
      - nextcloud-redis
    networks:
      - nextcloud-network

networks:
  nextcloud-network:
    driver: bridge

Important: Replace your_strong_database_password and your_strong_admin_password with strong, unique passwords.

Save and exit the file by pressing Ctrl+X and saying Y to save.

Step 4: Start Nextcloud
#

Now you can download and start Nextcloud:

sudo docker-compose pull
sudo docker-compose up -d

Once the pull is complete, verify the containers are running:

docker ps

You should see nextcloud-app, nextcloud-db, and nextcloud-redis all running.

Step 5: Complete Web Installation
#

  1. Open your browser and navigate to:
http://192.168.99.1:8080
  1. Create Admin Account

    • Enter admin username and password (from docker-compose)
    • Click Finish Setup
  2. Database Configuration

    • Database user: nextcloud
    • Database password: your_strong_database_password
    • Database name: nextcloud
    • Database host: localhost
    • Click Finish Setup

Initial Setup and Configuration
#

This can be a large undertaking depending on your configuration. It can be anything from adding users to setting up external network access. For this guide, we are sticking with a local installation. There are many, many guides out there that can walk you through the more advanced setup.

Using Nextcloud Desktop Client
#

For ongoing sync:

  1. Download Client

  2. Connect to Server

    • Server URL: http://192.168.99.1:8080
    • Username and password
  3. Select Folders to Sync

    • Choose which folders to sync locally

Usage
#

Web Interface
#

The Nextcloud web interface (http://192.168.99.1:8080) provides:

  • Files: Browse, upload, download, and share files
  • Calendar: Manage events and share calendars
  • Contacts: Manage your address book
  • Talk: Video calls and chat
  • Tasks: Manage to-do lists
  • Notes: Take and sync notes
  • Deck: Project management with Kanban boards

Common Tasks
#

Upload Files:

  1. Click Files in the sidebar
  2. Click Upload or drag and drop files
  3. Files are now available on all connected devices

Share Files:

  1. Right-click on a file or folder
  2. Click Share
  3. Choose sharing options:
    • Link (with or without password)
    • User/Group
    • Set permissions (view, edit, delete)

Create Folders:

  1. Click Files in the sidebar
  2. Click New folder
  3. Enter folder name

Sync with Desktop:

  1. Install Nextcloud desktop client
  2. Connect to your server
  3. Select folders to sync
  4. Files sync automatically

Mobile App
#

Nextcloud has official apps for iOS and Android:

  1. Install the App

  2. Connect to Server

    • Server URL: http://192.168.99.1:8080
    • Username and password
  3. Configure Sync

    • Enable photo backup for automatic uploads
    • Configure file sync preferences