Self-Host Nextcloud on Windows Using Docker

Introduction

Welcome to Agam's Tech Tricks! In this tutorial, we'll walk you through the process of self-hosting Nextcloud, a file hosting and sharing service, on Windows using Docker.

Overview of Docker and Nextcloud

Prerequisites

Step 1: Enable Required Windows Features

  1. Open Windows Features:
    • Go to Turn Windows features on or off.
  2. Enable Features:
    • Check the following options:
      • Windows Subsystem for Linux
      • Virtual Machine Platform
  3. Apply Changes:
    • Click OK.
    • Restart your computer if prompted.

Step 2: Install Docker Desktop

  1. Download Docker Desktop:
  2. Run Installer:
    • Open the downloaded file.
    • Allow the installer to make changes to your system by clicking Yes in the User Account Control prompt.
  3. Follow Installation Prompts:
    • Select options to install required components for WSL 2.
    • Choose to add a shortcut to the desktop if desired.
  4. Complete Installation:
    • Docker Desktop will install. You may need to log out and log back in or close the installer.

Step 3: Set Up Docker Desktop

  1. Open Docker Desktop:
    • Launch Docker Desktop from your Start Menu or desktop shortcut.
    • Wait for Docker Desktop to initialize.
  2. Verify Installation:
    • Ensure Docker Desktop is running and no containers are pulled initially.

Step 4: Install Nextcloud

  1. Prepare Command:
  2. Run Command:
    • Open PowerShell or another terminal.
    • Copy and paste the provided command to download and start the Nextcloud Docker image.
    • Example command: docker run -d -p 8080:80 nextcloud
    • Wait for the image to download and start.

Step 5: Access and Configure Nextcloud

  1. Check Docker Desktop:
    • Open Docker Desktop to confirm that Nextcloud is running.
  2. Access Nextcloud:
    • Open a web browser and go to http://localhost:8080.
  3. Set Up Admin Account:
    • Create an admin account by entering the username and password.
    • Choose the database setup (e.g., SQLite).
    • Click Install to complete the setup.

Conclusion

Congratulations! You've successfully set up Nextcloud on Windows using Docker. Enjoy your self-hosted file-sharing service!