How to Install Nextcloud on Proxmox in an LXC with Docker

  • Post author:Frank Joseph
  • Post published:
  • Post last modified:
  • Post category:Proxmox
  • Reading time:8 mins read

You can install Nextcloud on Proxmox in an unprivileged LXC container running Docker, with Nextcloud and MariaDB deployed from one Docker Compose file. The steps use Proxmox VE 9.2 and the Debian 13 template (current as of September 2026), then cover trusted domains, HTTPS and storing the data on a NAS.

To be clear, my own Nextcloud is Nextcloud AIO in a Docker VM, and it’s what replaced Synology Drive when I moved off a Synology NAS. A Proxmox Nextcloud LXC is the lighter option, though, and on a mini PC that matters.

LXC or VM for Nextcloud on Proxmox

On a mini PC or a device with minimal resources, the Nextcloud Proxmox container this guide builds is a great fit, but on a full home server with plenty of resources, I’d use a VM. A container shares the host kernel and uses way less resources than a VM, but Docker needs its restrictions loosened: Nesting, which Proxmox VE 9.2 ticks by default, and keyctl, which it doesn’t. Proxmox’s container documentation, writing about its new application-container support, still says nesting containers inside a VM “remains a recommended practice” for “use cases demanding maximum isolation and the ability to live-migrate.”

That split has been my advice since August 2025, when I’d run Docker in a Linux container on Proxmox for years without problems and said the resource utilization on a mini PC is very, very low. In February 2026, I put it the same way: you can certainly use an LXC, but from a recommendation perspective, a VM is the way to go.

What I run is Nextcloud AIO as a Portainer stack on a Proxmox VM running Docker.

The community-scripts helper scripts can also build a NextCloudPi or native Nextcloud LXC, and TurnKey has a Nextcloud template (a Debian release behind as of September 2026). They’re quicker, but none use Docker, so you maintain a native install instead of one compose file.

Create the Nextcloud LXC Container

If Proxmox isn’t installed yet, start with How to Install Proxmox VE.

1. Select your storage (usually local), then CT Templates, and finally, Templates.

The local storage in Proxmox with CT Templates selected and the Templates button at the top.

2. Search for debian, select debian-13-standard, and select Download.

3. Select Create CT in the top right.

The Create CT button beside Create VM in the top right of the Proxmox web interface.

4. On General, enter a Hostname and root Password. Leave Unprivileged container and Nesting ticked (the Proxmox VE 9.2 defaults), then select Next.

The General tab of the Create: LXC Container wizard with the hostname docker, a root password, and Unprivileged container and Nesting both ticked.

5. On Template, select the debian-13-standard template, then select Next.

6. Set the Disk size (GiB) and select Next. Size it for your files unless they’ll live on a NAS.

The Disks tab with the root disk on local-lvm and the Disk size (GiB) field.

7. Enter the Cores and select Next.

The CPU tab of the Create: LXC Container wizard with the Cores field.

8. Set the Memory (MiB), then select Next.

The Memory tab with the Memory (MiB) and Swap (MiB) fields.

9. On Network, select DHCP for IPv4. Leave IPv6 on Static unless your network runs DHCPv6, then select Next until you reach Confirm.

10. Select Finish to create the container.

11. Select the container, then Options, select Features, and finally, Edit.

The container's Options page with the Features row selected, showing nesting=1.

12. Tick keyctl, check that Nesting is ticked, select OK, and start the container.

The Edit: Features dialog with keyctl and Nesting both ticked.

Install Docker in the LXC Container

Open the container’s Console, log in as root, and update the system.

apt update && apt upgrade -y

Then install Docker Engine using Docker’s Debian install instructions, minus sudo since you’re already root.

apt install ca-certificates curl -y
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/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/debian
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 -y
docker run hello-world
ip -brief address

If the last two commands print Docker’s hello message and eth0’s address (your [CONTAINER_IP], without the /24), Docker is working. Reserve that address on your router, since Nextcloud trusts the address you install it on.

Install Portainer (Optional)

For a GUI, install Portainer with the command from Portainer’s install docs, then open https://[CONTAINER_IP]:9443.

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts

It asks for the setup token, which the command below prints on its setup_token= line, and an admin user with a 12-character or longer password. Select Skip on Edge Compute, then Get Started.

docker logs portainer

Install Nextcloud on Proxmox with Docker Compose

Nextcloud runs as two containers, the app and a MariaDB database, from a compose file based on Nextcloud’s official Docker image README.

1. Create a folder and a compose file.

mkdir -p /opt/nextcloud && cd /opt/nextcloud
apt install nano -y
nano compose.yaml

2. Paste this in, change the root password and the nextcloud password (it appears twice), and save the file.

services:
  db:
    image: mariadb:11.8
    restart: always
    command: --transaction-isolation=READ-COMMITTED
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=change-this-root-password
      - MYSQL_PASSWORD=change-this-password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud:35-apache
    restart: always
    ports:
      - 8080:80
    depends_on:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=change-this-password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

volumes:
  nextcloud:
  db:
  • MYSQL_PASSWORD must match in both services. With all four database variables set, the installer won’t ask for database details.
  • mariadb:11.8 is the version Nextcloud’s system requirements recommend for Nextcloud 35. Don’t use mariadb:latest, which pulled MariaDB 13 in September 2026, a version Nextcloud doesn’t support.
  • nextcloud:35-apache pins the major version, because Nextcloud can only upgrade one major version at a time.

3. Start the stack.

docker compose up -d

Using a Portainer Stack Instead

1. Select the local environment, then Stacks, and finally, Add stack.

The Portainer Stacks page with the Add stack button in the top right.

2. Name the stack nextcloud and paste the compose file into the Web editor.

The Portainer Create stack page with the stack name set to nextcloud.

3. Select Deploy the stack to create both containers.

The Deploy the stack button under Access control on Portainer's Create stack page.

If you deploy it this way, make the compose changes below in the stack’s Editor and select Update the stack, with Re-pull image and redeploy on when you update.

Run the Nextcloud Installer

If your files will live on a NAS, do Store the Data on a NAS below first.

1. Open the LXC container’s IP address on port 8080, enter an Administration account name and Administration account password, then select Install.

http://[CONTAINER_IP]:8080

2. Select Install recommended apps or Skip.

Nextcloud's Recommended apps screen listing Calendar, Contacts, Mail, Nextcloud Office and Talk, with Skip and Install recommended apps buttons.

3. Nextcloud is ready to use!

The Nextcloud dashboard header after the install finished.

After the Install: Trusted Domains, HTTPS and Storage

Add a Trusted Domain

Nextcloud only answers on the addresses in its trusted_domains list in config.php, and anything else gets an “Access through untrusted domain” page. Add one from the container’s console. The installer already put the address you used at 0, so use 1 for the next one.

echo 'alias occ="docker exec -u www-data nextcloud-app-1 php occ"' >> ~/.bashrc && . ~/.bashrc
occ config:system:set trusted_domains 1 --value=nextcloud.example.com

HTTPS with a Reverse Proxy

You could port forward to a reverse proxy and make Nextcloud accessible to the world, but I don’t want to do that, so I run an internal reverse proxy server instead: Nginx Proxy Manager with a local DNS record and a Let’s Encrypt wildcard certificate, with no ports opened. Local SSL for Home Lab Services with Nginx Proxy Manager shows how.

Point the proxy host at http://[CONTAINER_IP]:8080, then set these, with your proxy’s IP and your domain.

occ config:system:set trusted_proxies 0 --value=192.168.1.10
occ config:system:set overwriteprotocol --value=https
occ config:system:set overwritehost --value=nextcloud.example.com
occ config:system:set overwrite.cli.url --value=https://nextcloud.example.com

For access from outside your network, my Nextcloud AIO guide covers how I use Twingate.

Store the Data on a NAS

I like to offload the computing resources to Proxmox if I can, as opposed to running Nextcloud directly on my NAS. For an LXC, Proxmox’s documented route is to mount the share on the host and bind it into the container. Do this before you run the installer, because Nextcloud only reads NEXTCLOUD_DATA_DIR on its first install.

1. Select Datacenter, then Storage, and finally, Add, then NFS, and give it the ID nas. Proxmox mounts it at /mnt/pve/nas/ on the host.

2. From the host’s Shell, create the data folder, give it to Nextcloud’s user, and bind it into the container, using your container ID. If your NAS squashes root, create the folder on the NAS with owner 100033, then run only the pct set line.

mkdir -p /mnt/pve/nas/nextcloud
chown 100033:100033 /mnt/pve/nas/nextcloud
chmod 770 /mnt/pve/nas/nextcloud
pct set 100 -mp0 /mnt/pve/nas/nextcloud,mp=/mnt/nextcloud-data

3. Back in the container’s console, in /opt/nextcloud/compose.yaml, add – /mnt/nextcloud-data:/mnt/nextcloud-data under the app service’s volumes and – NEXTCLOUD_DATA_DIR=/mnt/nextcloud-data under its environment, then start it again before you open the installer.

cd /opt/nextcloud && docker compose up -d

Nextcloud’s www-data user (uid 33) is uid 100033 on the host. Mount NFS on the host rather than inside the container, too, as Proxmox says that “can block the host’s I/O completely.”

Updates and Backups

To update, run these from /opt/nextcloud. For a new major, change 35 to 36 in compose.yaml first, one major at a time.

docker compose pull
docker compose up -d

A Proxmox backup of the LXC covers the container and its Docker volumes, but not the contents of bind mounts, so data on a NAS needs the NAS’s own snapshots.

Final Thoughts on Nextcloud on Proxmox

Nextcloud is great, though it isn’t nearly as user-friendly to set up or maintain as Synology Drive was. On a mini PC, the LXC above keeps it light, but with the resources for it, I’d put Docker in a VM and run Nextcloud AIO like I do. Either way, keep it behind an internal reverse proxy. Security changes all the time, so nothing here is guaranteed.

Frank Joseph

I'm Frank, founder of WunderTech. I've been working in enterprise IT for 15+ years and running home labs for nearly a decade — every tutorial on this site is tested on hardware I actually own, including Synology NAS units, a DIY TrueNAS server, a Proxmox cluster, a full UniFi network, and more. I hold a BS in Computer Information Systems and an MBA, but most of what you'll read here comes from my home lab, not a classroom. You can also find video versions of these tutorials on my YouTube channel.