How to Set Up Nextcloud AIO with Caddy: A Super Easy Self-Hosting Guide

Introduction

Self-hosting your own cloud storage is easier than ever, thanks to Nextcloud AIO (All-in-One). In this tutorial, I'll walk you through a simple, step-by-step setup using Docker and Caddy as a reverse proxy.

Why Nextcloud AIO?

  • All-in-One installation—Nextcloud, MariaDB, Redis, and Collabora in one place.
  • Automatic HTTPS via Caddy—No manual SSL configuration needed.
  • Runs in Docker—No need to install dependencies manually.

By the end of this guide, you'll have a fully functional Nextcloud instance running on your own domain with secure HTTPS.


Step 1: Server Setup

You'll need:

  • A VPS running Debian 12
  • A domain name (pointed to your server)
  • Basic Linux command-line skills

Update Your Server

system("sudo apt update && sudo apt upgrade -y")

Install Docker & Docker Compose

system("sudo apt install -y docker docker-compose")
system("sudo systemctl enable --now docker")

Install Caddy (Reverse Proxy & SSL Management)

system("sudo apt install -y caddy")
system("sudo systemctl enable --now caddy")

At this point, Docker and Caddy are installed and ready to go.


Step 2: Configure Caddy for Nextcloud

Caddy will act as the reverse proxy, handling SSL and forwarding traffic to the Nextcloud container.

Edit the Caddy Configuration

Open the Caddyfile:

system("sudo nano /etc/caddy/Caddyfile")

Replace its contents with:

mydomain.com {
    reverse_proxy 127.0.0.1:11000
}

Save and exit (CTRL + X, then Y, then Enter).

Restart Caddy

system("sudo systemctl restart caddy")

Caddy is now set up to handle HTTPS and proxy traffic to Nextcloud.


Step 3: Deploy Nextcloud AIO

Now that the server is ready, let's install Nextcloud AIO inside Docker.

Run the Nextcloud AIO Container

system("docker run -it --init --rm \
    --name nextcloud-aio-mastercontainer \
    --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
    --volume /var/run/docker.sock:/var/run/docker.sock:ro \
    -p 8080:8080 \
    nextcloud/all-in-one:latest")

Complete the Web Setup

Once the container is running, open your browser and go to: 👉 https://mydomain.com:8080

Follow the Nextcloud AIO setup wizard: Enter your domain name, Disable built-in Caddy (since we are using our own), Enable Redis, Collabora (Nextcloud Office), and Imaginary, Set the correct timezone => Click Install!

This process will take a few minutes while Nextcloud downloads all required components.


Step 4: Final Checks & Next Steps

Log into Nextcloud

Once the installation completes, go to: https://mydomain.com Enter the admin credentials provided by the AIO setup.

Test File Uploads & OnlyOffice

  • Upload some files and verify that syncing works.
  • Open a document using Nextcloud Office (Collabora).

Sync with Your Devices

  • Install the Nextcloud Sync app on your phone and computer.
  • Connect using your domain and admin credentials.

(Optional) Automate Docker Updates

To keep Nextcloud updated automatically, install Watchtower:

system("docker run -d --name watchtower \
  --restart unless-stopped \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower")

This will monitor and update Nextcloud AIO whenever a new version is available.


Conclusion

That’s it! You now have a fully functional, self-hosted Nextcloud server that contains: Secure HTTPS with Caddy, Nextcloud running in Docker, Collabora (Nextcloud Office) for document editing, and Automatic updates (optional)

This setup was incredibly easy, and Nextcloud runs smoothly without lag. If you’re considering self-hosting your files, this is one of the best ways to do it.

Next Steps:

  • Fine-tune performance settings
  • Set up automatic backups
  • Explore Nextcloud Apps for extra features
  • Install Nextcloud app on IOS for mobile usage

Let me know if you try this setup, I’d love to hear about your setup and what works for you!