Skip to content

How to install Nextcloud on your server with Docker?

Updated 3 min read

Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

The easiest supported way to run Nextcloud with Docker is Nextcloud All-in-One (AIO), which sets up Nextcloud, its database, Redis, backups and HTTPS for you.

Install Docker Engine (official repository)

Ubuntu 24.04 / Debian 12:

apt install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

On Debian, use https://download.docker.com/linux/debian in both the key URL and URIs.

AlmaLinux 9 / Rocky Linux 9:

dnf install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl enable --now docker

Test with docker run hello-world. Compose is available as docker compose.

Start Nextcloud AIO

docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always \
  --publish 80:80 --publish 8080:8080 --publish 8443:8443 \
  --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
  --volume /var/run/docker.sock:/var/run/docker.sock:ro \
  ghcr.io/nextcloud-releases/all-in-one:latest

Open https://SERVER-IP:8080, note the passphrase shown, enter your domain (its DNS must point to the server) and let AIO start the containers.

Open the firewall

ufw allow 80,443,8080,8443/tcp                 # Ubuntu / Debian with UFW
firewall-cmd --permanent --add-port={80,443,8080,8443}/tcp && firewall-cmd --reload   # AlmaLinux / Rocky

Nextcloud itself is served on port 443. If you enable Nextcloud Talk, also open port 3478 (TCP and UDP). After setup you can limit port 8080 to your own IP.

Tip: Plan enough disk space for your files, and enable AIO's built-in backups.

Before you start

  • A VPS with at least 2 GB RAM (4 GB or more if you enable Office, Talk or full-text search) and enough disk space for your files.
  • A domain or subdomain (for example cloud.example.com) with an A record pointing to the server.
  • Nothing else listening on ports 80 or 443. If the server already runs a web server, follow the AIO reverse proxy documentation instead.

After installation

  • Log in to Nextcloud at your domain with the admin password shown in the AIO interface.
  • Update Nextcloud and all its containers from the AIO interface: it stops the containers, takes a backup if you have set one up, and starts the new versions.
  • Set up the built-in backup (BorgBackup) to a separate disk or mounted storage, and test a restore.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket