Sitemap

Running Nextcloud AIO Alongside Coolify: A Practical Guide

Tim Koch
1 min readDec 29, 2024

Coolify provides a built-in template for Nextcloud with PostgreSQL, which works perfectly fine. However, if you want to use Nextcloud’s official AIO solution (which includes optimized configurations, automatic updates, and integrated backup solutions), you’ll need a different approach. The AIO solution uses a master container that orchestrates other containers (Nextcloud, database, backup, etc.) — a pattern that sits outside Coolify’s usual management model.

The Setup

1. Port Configuration

Since Coolify already uses a reverse proxy (Traefik/Caddy), we need to configure Nextcloud AIO to use different ports. The AIO container defaults to ports 80/443, but we’ll adjust this:

sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 33001:8080 \
--env APACHE_PORT=33000 \
--env APACHE_IP_BINDING=0.0.0.0 \
--env SKIP_DOMAIN_VALIDATION=true \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest

Note: Don’t let the APACHE_PORT name confuse you — it’s simply defining the port where Nextcloud should listen, not specifically related to Apache.

2. Initial Setup

After running the container, access the AIO interface at https://your-server-ip:33001/. You'll see a TLS warning because this is the AIO's self-signed certificate - you can safely ignore it for this initial setup.

3. Domain Configuration

To make Nextcloud accessible through your domain:

  • Set up a Cloudflare tunnel pointing your domain (e.g., nextcloud.yourdomain.com) to http://localhost:33000
  • In Coolify, create a new Cloudflared service using your Cloudflare tunnel token. You can simply deploy Coolify’s Cloudflared service template.

Responses (2)

Write a response

Hey Tim, danke für dein Script. Leider bekomme ich immer ein Bad Gateway. Habe ich bei der Einrichtung was übersehen?
Viele Grüße
Roland

Hello, thanks for this explanation, I don't understand how the domain configuration work :/ How to use cloudflare ? This service is really new for me, sorry ^^