In this guide, we’ll walk through a powerful and scalable way to self-host Nextcloud All-in-One (AIO). Nextcloud AIO comes with an installer wizard to help us install all necessary parts as Docker container.
We will install it in a Proxmox virtual machine with an iSCSI LUN on my Synology.
We’ll cover everything from the Synology LUN creation to the final Nextcloud setup behind an Nginx reverse proxy.
Part 1: Configuring the Storage Backend#
The foundation of this setup is reliable, block-level storage. We’ll achieve this by creating an iSCSI LUN on the Synology NAS.
Step 1: Create the Synology iSCSI LUN and Target#
First, log in to your Synology DSM and open the iSCSI Manager. The iSCSI wizard will guide us through creating the iSCSI target, the LUN and LUN mapping.
Create a new iSCSI Target to expose the LUN over the network. If you have an existing target, you can use that as well.

Choose LUN mapping. Here I want to create a new LUN.

Create a new LUN. It’s highly recommended to use Thick Provisioning. This allocates all the disk space immediately, leading to better performance and reliability compared to thin provisioning. However, I’m using Thin Provisioning because I will be using it alone without any other users and performance is not my main goal. For me flexibility is more important.

Take note of the Target’s IQN (iSCSI Qualified Name). You will need this in Proxmox.

Part 2: Proxmox Host Configuration#
Now we’ll connect Proxmox to our newly created iSCSI storage.
Step 2: Add the iSCSI LUN to Proxmox#
In the Proxmox web UI, navigate to Datacenter -> Storage -> Add -> iSCSI.
- Portal: Enter the IP address or hostname of your Synology NAS.
- Target: Proxmox should discover the target automatically. Select the correct IQN you noted earlier.

After adding the storage, you can head back to your Synology’s iSCSI Manager. You should now see a connection from your Proxmox server, confirming everything is working.

Step 3: Create a Volume Group and LVM Storage#
With the iSCSI disk available to the host, we’ll format it as an LVM storage pool. This allows for flexible volume management.
- Navigate to Datacenter -> Storage -> Add -> LVM.
- ID: Give your new storage a descriptive name (e.g.,
syn-nextcloud-lvm). - Base storage: Select the newly attached iSCSI LUN.
- Volume group: Select “Create new volume group” and give it a name (e.g.,
vg-nextcloud). - Shared: Tick this box if you are running a Proxmox cluster and want to use this storage for live migrations.

Part 3: Creating the Nextcloud VM#
Step 4: Choose an Isolation Method: VM vs. LXC#
For running a multi-service stack like Nextcloud, the choice between a full Virtual Machine and a Linux Container is important.
- VM: Provides full kernel-level isolation and better security. It behaves like a completely separate machine. This is the recommended approach for Nextcloud.
- LXC: Is more lightweight and less resource-intensive as it shares the host kernel. However, running Docker inside an LXC container requires special configuration (e.g., nesting, privileged mode) which can complicate the setup and reduce the security benefits.
We will proceed with a Virtual Machine.
Step 5: Create and Configure the VM#
Create a new VM with a standard Ubuntu Server installation.
- OS Storage: Install the operating system on your local Proxmox storage (e.g.,
local-lvm). A disk size of 32 GB is plenty for the OS and Docker images. - CPU: Allocate at least 2 cores.
- RAM: Allocate at least 4 GB.
After the VM is created, attach the data disk from our iSCSI LUN.
- Select the VM and go to its Hardware tab.
- Click Add -> Hard Disk.
- Storage: Select the LVM storage pool you created earlier (
syn-nextcloud-lvm). - Disk size: Use the desired size for your Nextcloud data.
- Important: In the “Advanced” options, uncheck “Backup”. This prevents Proxmox from including this large data disk in the VM’s snapshot backups. You should have a separate strategy to back up the data itself, either at the Synology or data level.

Step 6: Install Ubuntu Server and Prepare the Data Disk#
Start the VM and proceed with the Ubuntu Server installation.
When you get to storage configuration, only select the internal 32 GB disk for the OS installation. Leave the large data disk untouched for now.

The Ubuntu installer gives us a convenient option to format and mount the second disk. Choose to format the data disk.

For the filesystem, I chose Btrfs to experiment with its advanced features like snapshots and data-integrity checksums. Another performant and stable choice would be ext4. Both are excellent options. Mount it at a memorable location, like
/mnt/data.During the installation, you’ll be prompted to install featured server snaps. Do not install the Nextcloud snap. Instead, for convenience install the Docker snap. Alternatively, you can install Docker after the VM is running.

Step 7: Configure Networking (DHCP Reservation & DNS)#
For easy management, it’s best to assign a static IP to your Nextcloud VM. The easiest way is via a DHCP reservation in your DHCP server, for me that is UniFi. While you’re there, create a local DNS record (e.g., nextcloud.your.lan) that points to this new IP. This allows you to easily SSH into the machine by name.

Part 4: Reverse Proxy and Nextcloud AIO#
Step 8: Configure the Nginx Reverse Proxy#
Nextcloud can be set up to either expose the HTTP ports directly or to run behind a reverse proxy, which will handle SSL termination and present a clean URL to the world. We will set it up to run behind an external Nginx server.
Here is a sample Nginx configuration. You’ll need to create a new config file (e.g., in /etc/nginx/sites-available/) on your separate Nginx server.
server {
listen 443 ssl http2;
server_name next.your-public-domain.com; # Your public domain
# SSL configuration (Certbot, etc.) goes here
# ssl_certificate /path/to/your/fullchain.pem;
# ssl_certificate_key /path/to/your/privkey.pem;
error_log /var/log/nginx/nextcloud.error.log warn;
access_log /var/log/nginx/nextcloud.access.log;
location / {
proxy_pass http://nextcloud.your.lan:11000; # The local DNS name and port for Nextcloud
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Make sure your public DNS records are pointing next.your-public-domain.com to your Nginx server’s public IP.
Step 9: Install Nextcloud AIO with Docker#
With all the groundwork laid, installing Nextcloud AIO is straightforward. SSH into your new VM and run the following Docker command. We’ve modified the official AIO command to suit our setup.
Key changes:
--env APACHE_PORT=11000: This tells AIO’s internal Apache webserver to listen on port 11000, which is what our reverse proxy is pointing to.--env NEXTCLOUD_DATADIR="/mnt/data": This is the most important part. It tells Nextcloud to store all of its data on our mounted Btrfs/ext4 filesystem, which resides on the iSCSI LUN.
sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 8080:8080 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=0.0.0.0 \
--env NEXTCLOUD_DATADIR="/mnt/data" \
ghcr.io/nextcloud-releases/all-in-one:latest
Step 10: The Web-Based Setup#
Now open a web browser and navigate to https://<ip-of-vm>:8080 or https://nextcloud.your.lan:8080. You’ll be greeted by the AIO setup interface.
For this step it is recommended to use the IP address to reduce the risk of running into problems with HSTS, if you are using Nextcloud without a reverse proxy.

Enter your public domain name (next.public.domain). Since our reverse proxy and DNS are already configured, the domain validation should pass without issue.

Click “Download and start containers.” AIO will now pull all the necessary Docker images and configure them.

Once it’s finished, you’ll be given your initial admin password. Save this password securely.

Congratulations! Your Nextcloud instance is fully installed and operational.
Part 5: Final Steps#
Change the Admin Password#
Log in to your new Nextcloud instance using the provided credentials. The first thing you should do is change your password. Go to Personal Settings -> Security to set a new, strong password.

Create Users#
To create new user accounts, click your profile icon in the top right and select Administration settings -> Users. For more detailed information on user management, refer to the official documentation.

And that’s it! You now have a secure, scalable, and feature-rich Nextcloud setup!
