Nextcloud aio and nginx (in docker on ubuntu on OIC)

Dear folks,

On OIC I’ve installed Ubuntu on which I’ve installed Docker.

More and more I’m reading about Nginx and reversed proxy. This is because normally only one webservice/website can be listening on port 443 (https).

Question: Is it possible with Nginx to create the following:

when visitors go to my.domain.com/nextcloud they get nextcloud
if visitors go to my.domain.com/otherservice they get some other service

I’m asking because I still have a little trouble grasping what reverse proxy all entails.

Hello,

yes, that’s exactly what a reverse proxy is for.

You define the target, which is specified by the web address, yourself. You can do this either via IP address, for example, if you run multiple web servers on your network. Or you can point to subfolders on your web server where the respective application/website should run.

For example:

https://www.your.domain/nextcloud = IP-Adresse/nextcloud

https://www.your.domain/wordpress = IP-Adresse/wordpress

If you have everything on one server, you need to ensure that you adjust ports 80/443 accordingly during the installation and configuration of your services/websites. Each port can only be used once on a server.

Then, for example, for Nextcloud, port 443 would point to port 444 externally, and for WordPress, port 445.

For example:

https://www.your.domain/nextcloud = IP-Adresse/nextcloud Port 444

https://www.your.domain/wordpress = IP-Adresse/wordpress Port 445

In my opinion, the easiest option for beginners is to use something like Nginx Proxy Manager. Its graphical interface makes it easy to use and configure.

Hi,

From what you described, the main issue is the URL structure.

According to the official Nextcloud AIO (All-in-One) documentation on GitHub, running AIO in a subdirectory like:

https://www.your-domain.com/nextcloud

is not supported and will not be added. The documentation explicitly states:

“Can I run AIO in a subdirectory on my domain?”
No. Please use a dedicated (sub-)domain for Nextcloud.

AIO expects Nextcloud to be available on the root of a domain or subdomain. Putting it behind /nextcloud typically causes issues with redirects, login flow, generated URLs, WebDAV endpoints and client apps.

The correct and supported approach is to use a dedicated subdomain, for example:

https://nextcloud.your-domain.com

and then forward that subdomain via reverse proxy to the AIO backend container.

Since you’re just getting started, I would strongly recommend using Nginx Proxy Manager (NPM) instead of writing raw nginx configs. It gives you a simple web UI to:

  • create a proxy host

  • request and manage SSL certificates (Let’s Encrypt)

  • map subdomains to internal Docker services

It also makes your setup future-proof. Once NPM is in place, you can easily run additional services alongside Nextcloud AIO, for example:

  • vaultwarden.your-domain.com

  • uptime.your-domain.com

  • monitoring.your-domain.com

  • etc.

Each service just gets its own subdomain and proxy entry. Much cleaner and more scalable than trying to put everything under paths.

If you want a concrete step-by-step example (including NPM configuration, ports and SSL), you can follow this guide:

https://help.nextcloud.com/t/proxmox-nginx-nextcloud-aio-watchtower-deployment-guide/233643?u=vawaver

The relevant section shows exactly how AIO should be placed behind NPM in a supported way.


Thank you very much for your answer. I also checked your tutorial/instructions you referred to.

I learned from frontend html css, that nesting is a bad thing.

EDIT: containerization has its benefits. Beneath an overview of the to accomplish structure:

  • Proxmox
    • Virtual 1
      • Ubuntu
        • Docker
          • Nginx
    • Virtual 2
      • Ubuntu
        • Docker
          • Nextcloud AIO

Why exactly do you want to install an Ubuntu operating system and then a Proxmox server on top of it?

Why don’t you just install the Proxmox server as the operating system? Running an Ubuntu system underneath it makes no sense.

Or have I misunderstood something?

You don’t need a VM for the Nginx Proxy Manager; a lightweight LXC container variant is perfectly sufficient.

I think there is a misunderstanding here.

The guide I linked is a comprehensive homelab deployment example, written for a specific physical environment (bare-metal server at home). It is not meant as a universal architecture blueprint for every scenario.

In that guide:

  • Proxmox runs directly on physical hardware.

  • VMs are created for service separation.

  • NPM and AIO are isolated for operational clarity and easier maintenance.

This makes sense in a self-hosted homelab context.

However, the original question here is about Oracle Cloud Infrastructure (OCI). In that scenario, you already have a virtual machine provided by the cloud. Installing Proxmox inside an Ubuntu VM on OCI would indeed make no sense.

On OCI (or any VPS/cloud VM), the simple and correct approach is:

  • One Ubuntu VM

  • Docker support

  • Nginx Proxy Manager container

  • Nextcloud AIO installation (containers)

All containers run side by side on the same host. No nested virtualization. No Proxmox. No extra VM layers.

So the principle stays the same (reverse proxy + dedicated subdomain), but the infrastructure layer changes depending on whether you’re on bare metal or cloud.

The Proxmox part of my guide applies only to physical self-hosted setups — not to OCI or other cloud providers.

Dear Vawaver & Thomas, thanks for your replies. You cleared something up. I must’ve read something wrong. I will edit my earlier reply (so others wont get the wrong idea).

I’m building up the courage to follow the instructions vawaver referred to.

That said, those instructions seem to take off from “You have proxmox installed“.

I don’t have Proxmox installed yet. Do you have (a link to) instructions to properly install Proxmox?

Hi, no problem at all. But please note that Proxmox VE is a complete server operating system. This means it doesn’t run on virtual or cloud systems. It’s designed for you to set up your own server at home.

Installation is very simple and takes only three or four steps. Configuration is also very easy these days, and once you understand the principle, operation is straightforward.

First, I would recommend watching a video on YouTube in your language that explains the function and operation of Proxmox VE.

For further information, I recommend visiting the official website. There you will also find instructions on how to perform the installation.

Later you will find information about pre-built VMs and LXC containers on the Helper Scripts page.

Just to clarify this once again to avoid confusion:

Proxmox only makes sense if you are running your own PHYSICAL SERVER (bare metal). It is used as a virtualization layer when you manage multiple VMs or containers on your own hardware.

If you are using a VPS or cloud VM (like Oracle Cloud Infrastructure), installing Proxmox there would simply BE POINTLESS. You already have a virtual machine provided by the cloud platform, so adding another virtualization layer on top of it brings no benefit.

So first it’s important to decide which path you are actually taking:

  • Own physical hardware → Proxmox makes sense

  • Cloud / VPS (OCI) → no Proxmox, just run the services directly

If you stay with the OCI approach from your original post, then the setup should simply be:

  • Ubuntu server (your OCI VM)

  • Docker SUPPORT

  • Nginx Proxy Manager

  • Nextcloud AIO

Both containers can run directly on the same Ubuntu host.

PS: One more thing from my side: I personally do not recommend using helper scripts to install Nextcloud AIO. They are not an officially supported installation method. If something breaks, you will most likely have to contact the author of that script instead of getting help through the normal Nextcloud support channels. This has already been discussed multiple times on the forum.

Thanks for the replies again!

I wont run it on OCI (nor AWS, etc.) I have a free tier OCI (1 GB ram?) on which I manually installed OpenVPN server. Then I came with the brilliant plan to install docker engine with a nextcloud AIO on it. This was (way) too much and I couldn’t even SSH into it anymore. Rebooting (even forcefully) would just cause it to get stuck again. I had to terminate that instance.

Back to the homelab-plan: I’m thinking of using an old laptop (i3-6100, 8 GB DDR3, 250 GB SSD) without a screen. At the moment it runs Windows 10 with WSL2 for Docker Desktop, with nextcloud AIO on it. I also have an old Dell laptop (i5-4600, 8 GB DDR3, 250 GB SSD, 1600x900). For the setup a screen might come in handy :wink:

That makes more sense now.

Both laptops you mentioned should be capable of running Nextcloud AIO for a small personal setup (on Ubuntu server). Those CPUs are 2 cores / 4 threads, which is more than enough for a small homelab Nextcloud instance, and 8 GB RAM is a reasonable starting point.

However, with hardware like that I would not complicate things by installing Proxmox. Proxmox makes sense when you have a more powerful server and you want to run multiple VMs or build a larger homelab environment.

Regarding the OCI attempt you mentioned earlier: if the instance only had around 1 GB RAM, then trying to run Nextcloud AIO there was simply unrealistic from a hardware perspective. AIO runs several containers (Nextcloud, database, redis, etc.), so anything below roughly 8 GB RAM is generally not a good candidate for a stable AIO deployment. That explains why the system became unresponsive and you could not even SSH into it anymore.

So from a hardware perspective your homelab plan with the laptops makes much more sense.

Whole thing is that I really want to get familiar with stuff that can make it possible to have multiple websites/webservices connectable via https (port 443), all on 1 device.

I’m really curious about a thing that welcomes all visitors and takes care of the https and the certificates, and then ‘directs‘ them to the correct website/-service (like nextcloud op port 11000).

I would’ve loved if Nginx had been just a little more powerfull and could also ‘re-route‘ my,domain,com/person1/nextcloud to a certain Nextcloud-instance that thinks it’s running on localhost:11000. Then my,domain,com/person2/nextcloud would be ‘re-routed’ to a Nextcloud instance running on localhost:11001. While I’m typing this I realize Nextcloud is a bad example, because it supports multiple users.

What you want to do is easily possible with Nginx. Because that’s exactly what it’s designed for.

Nextcloud is a really bad example, because that’s exactly what it’s designed for. :grin:

But most other services also have personal profiles. This means that everyone can access the same content on their respective app (BookStack, Wiki, etc.) via the same web address.

As a basic system for something like this, you can either use a Linux server that uses Apache to point to different websites and works according to the ports.

Alternatively, you could use a server system like Proxmox, where each service runs in its own virtual system. This is the system I prefer because it makes switching or testing very easy.

You can also run a Linux server system with Docker. It’s a bit easier on the hardware, but I find backup strategies somewhat more difficult. However, this is a matter of personal preference.

Look at the differences between Linux with Apache, with Docker, or with Proxmox and understand how they work. Then you’ll find a way that suits you and your needs.

I have a Proxmox server running Nginx as the central hub for all web services, making approximately 10 different virtual systems accessible with Nextcloud, Docker, and much more.

Ok, question. You have Proxmox with a VM for Nginx (in docker?). Is that Nginx capable of ‘re-routing‘ a visitor to another VM on that same Proxmox?

So, to make it a bit more illustrative, here is a graphic of how it works for me.

My Proxmox server has its own IP range 192.168.177.x in my local network.
And all my virtual systems have their own fixed IP within this IP range.

Whether you use a VM or an LXC container is either a matter of personal preference or depends on the requirements. LXC containers use a pared-down system as a base, but are sufficient for most tasks. For more intensive tasks or specific hardware requirements, you then need a VM.

The Nginx Proxy Manager is basically the gateway from the outside into your system. All requests arrive here and are forwarded accordingly. You can set different variants of hosts. As you can see on the right side, each request is forwarded to its own IP address. Behind each of these is a separate container/a separate system on the Proxmox server.

The IP addresses could also point to a server on which, for example, Docker is running. Then the respective IP addresses would be used there. However, if you use a Proxmox server and only run a VM or a container on it where Docker is running, you would not need a Proxmox server. You could then set this up on a Linux server (e.g., Ubuntu Server). On this, you could also create an Nginx container that forwards your web traffic to the corresponding Docker containers.

So you have to see what you are planning and what hardware you have available. For the laptop you mentioned, it would be recommended to use an Ubuntu Server with Docker.

Personally, I like Proxmox mainly because the systems all run individually. You can create and restore a backup for each system (container or VM) individually. And if something goes wrong (updates, configuration, etc.), you can restore everything individually and very quickly. With a Linux server and Docker as a container system, it’s all somewhat different and sometimes more complicated.

But as I said, that’s purely a matter of taste. If your laptop has 8GB of RAM, it is enough to run Nextcloud without problems. It depends on how many people access it at the same time and how much traffic is used. My Nextcloud system on the Proxmox server only has 4GB of RAM available. But only 3 people access it.

Other systems on the server, for example, have 2GB of RAM available. But it is never heavily used at the same time, so the load is distributed very well, and overall, in reality, not as much is needed as I theoretically provide to all systems.

I have found a YouTube tutorial where someone has Ubuntu installed (will ask if it’s the ‘Server‘ edition or just the regular ‘24.04 LTS’). On this he runs a yml file with which has a
ports:
- “8020:80” in it. Then he installs nginx and certbot, creates a certificate for the sub,mydomain,com and it all seems to work. The nginx file has proxy_pass localhost:8020; in it. (b.t.w. he has differences in the code he’s using in the video, and in the yml file he’s sharing, which I pointed out to him, with a hint to harmonize those)

Question. Can I then run some other webservice-compose.yml file with, let’s say, a
ports:
- “8030:80” in it, and make nginx ’guide’ sub2,mydomain,com that service with proxy_pass localhost:8030;?

If so, then it very much looks like I don’t need Proxmox (yet).

I also have a raspberry-pi 4b 4GB b.t.w., which I configured to boot from USB, so I can hang a 2,5” SSD from it, because I read Pi’s can vastly short the lifetime of micro-SD’s. Probably better to use one of the laptops.

Yes, the general idea is correct.

NGINX works as a reverse proxy. It listens on ports 80 and 443 and forwards the traffic to the correct internal service based on the subdomain that was requested.

So for example:

nextcloud.your-domain.com → Nextcloud AIO
vaultwarden.your-domain.com → Vaultwarden
someapp.your-domain.com → another service

Each service simply runs on its own internal port, and nginx routes the request to the correct container. This is exactly how you can run multiple services alongside Nextcloud AIO on the same machine.

Regarding the hardware you mentioned: the laptops with 8 GB RAM are a good starting point for a small homelab setup.

I would be more cautious with the Raspberry Pi. While it can run many services, the environment is not always as straightforward as a standard Ubuntu server, and some containers behave differently depending on the architecture. For someone just starting out, using one of the laptops will usually lead to a much smoother experience.

Also, please read the guide I linked earlier carefully, especially the section near the end about Watchtower configuration.

This is important because Nextcloud AIO must not be updated via Watchtower. If Watchtower updates the AIO containers, it can break the installation. The guide explains how to configure Watchtower correctly so that it updates other containers but excludes Nextcloud AIO.

Ah, many thanks for the warning about Watchtower. At the moment the screenless laptop runs Windows 10 Enterprise IoT 2021 LTSC (so it gets updates till 2032) with WSL2 and Docker Desktop holding a container for Nextcloud AIO. I’m quite certain I didn’t make any special tweaks to disable Watchtower, so I’m getting close to wipe that thing and start with Ubuntu server.

Oh, on the laptop is a external USB 3 harddisk of 14 TB with filesystem NTFS. Can Ubuntu Server read that? Or won’t I be able to add the external hdd altogether or share some folders off of it?

Ubuntu can read NTFS, so the disks will be visible and usable. However, if those disks do not contain important data, I would personally recommend not keeping them formatted as NTFS.

NTFS is primarily a Windows filesystem, and on Linux it is handled through a compatibility layer. While it generally works, it is still not a native Linux filesystem and can introduce limitations in areas like permissions handling, performance, and long-term reliability compared to filesystems designed for Linux.

On Ubuntu the standard filesystem is EXT4, which is very stable and widely used. However, as I mentioned in my guide, if you plan to store large files such as multimedia, I personally prefer XFS, because it handles large files and large volumes very efficiently.

So if those disks are empty, the cleanest approach would be to reformat them to a native Linux filesystem before using them with your server. Of course, that is just my personal opinion based on experience, but it usually makes the setup simpler and avoids potential issues later.