Privacy notice This website only uses technically necessary cookies. Statistics, marketing and external services are not loaded without JavaScript. Learn more in our Privacy Policy.

Halloween at Nexthosting: 10% off game servers with the code – until November 1

Back to the blog
Nexthosting Guide

2 CPU, 4 GB: Installing Nextcloud on a VPS, AIO or Manual?

A practical guide to choosing AIO or manual for Nextcloud on a VPS. AIO cuts maintenance but exposes the Docker socket. Includes hardening and backups.

Aug 31, 2026 151 views
2 CPU, 4 GB: Installing Nextcloud on a VPS, AIO or Manual?

For most readers, Nextcloud AIO is the recommended method for installing Nextcloud on a VPS. The reason is the combination of Docker, a preconfigured Redis, and automatic backups, which rules out many sources of error from the start. If, on the other hand, you need full control over individual software versions, an existing reverse proxy, or a specific MariaDB configuration, you should choose the manual installation.


In short:

  • For low maintenance effort and ease of use, Nextcloud AIO is the better choice because it offers automatic updates and ready-made all-in-one containers.
  • If you have specific requirements for PHP, database, or proxy configurations, a manual installation with your own components is the better fit.
  • Before installing, check the operating system, resources, domain, SSH access, snapshots, and backups to avoid errors.
  • The Docker installation requires setting up the master container with full access to the Docker socket, which can pose security risks.
  • For optimal performance, Redis caching, PHP OPcache, tuned database settings, and fast NVMe SSDs are recommended.

Table of Contents

Installing Nextcloud on a VPS: AIO or Manual Method?

Both routes lead to the same goal, but they differ significantly in effort and in the control you have afterward. Nextcloud All-In-One bundles the web server, database, Redis, Collabora Online, and a backup tool into one master container and can be updated through a web interface. The manual route using LAMP or nginx with PHP-FPM, on the other hand, gives you control over every individual component, but in return you have to take care of updates, compatibility, and security vulnerabilities yourself.

Maintenance is where the biggest difference shows: AIO notifies you of new versions in its web interface and updates most containers with a few clicks. With a manual installation, you have to maintain PHP, the web server, and the database separately, which takes more time but also allows finer control.

In terms of security, AIO has one particularity: the master container mounts the Docker socket in order to control other containers. This is functionally necessary, but a real risk if the container is compromised. Manual setups do not have this risk, but other pitfalls lurk there, such as incorrectly set file permissions or open ports that you have to secure yourself.

In practice:

  • AIO fits if you have little time for maintenance and need an instance for yourself, your family, or a small team.
  • A manual installation fits if you already run a reverse proxy, need specific PHP or database versions, or have to meet compliance requirements.
  • Resource requirements: because of its multiple containers, AIO uses slightly more RAM at idle, but it scales cleanly once you enable Collabora or Talk.

What Do You Need Before Installing Nextcloud on a VPS?

Before you get started, you should work through a short checklist. Missing preparation is the most common reason an installation gets stuck halfway through.

  1. Choose an operating system: Debian or Ubuntu in the current LTS release are the most common base for Nextcloud and are covered by most guides.
  2. Estimate resources: For a personal or small team instance, 2 CPU cores and 4 GB of RAM are usually enough. For AIO with Collabora and several active users, you should plan for closer to 8 GB of RAM and sufficient SSD storage. A VPS Standard offers enough headroom for this.
  3. Check SSH access: A user with sudo privileges, a current SSH key, and a working firewall (UFW) are mandatory before you open any ports.
  4. Prepare a domain: Without your own domain, AIO can only be operated to a limited extent. If you do not want to register one, you can for testing purposes rely on your own domain or fall back on dynamic DNS or Tailscale.
  5. Create a snapshot or backup: Before you install packages or set up Docker, a snapshot of the VPS is worthwhile. In case of an error, it saves you a complete reinstall.

If you clarify these five points in advance, you will get through the actual installation much faster, whether you choose AIO or the manual variant.

Installing Nextcloud AIO: How to Start the Master Container

The Docker-based installation is now the method recommended by Nextcloud itself and takes just a few clearly defined steps.

First, you need Docker on your VPS. Use docker --version to check whether it is already installed; otherwise, install it from the official Docker repository for Debian or Ubuntu. Then create a working directory where the configuration data will be stored later:

mkdir -p /opt/nextcloud-aio
cd /opt/nextcloud-aio

The actual start is done with a single docker run command that creates the master container:

sudo docker run \
  --init \
  --sig-proxy=false \
  --name nextcloud-aio-mastercontainer \
  --restart always \
  --publish 8080:8080 \
  --env APACHE_PORT=11000 \
  --env APACHE_IP_BINDING=0.0.0.0 \
  --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

Three things matter here: the volume nextcloud_aio_mastercontainer stores the configuration persistently, the docker.sock mount allows the master container to control other containers, and port 8080 opens the setup interface. This socket mount is exactly the point where Nextcloud itself openly acknowledges that the master container thereby gains far-reaching privileges on the host. This is not a bug but architecture, yet you should be aware of it before you set up AIO on a server used in production.

After the start, open https://your-server-ip:8080, enter your domain, and follow the guided setup. AIO takes care of the Let’s Encrypt certificate on its own, provided the domain points correctly to your server.

  • If a web server is already running on port 80 or 443, AIO reports this during setup. In that case, the command sudo ss -tulpn | grep -E '443|80|8080' helps you find the blocking process.
  • To run behind an existing reverse proxy, set APACHE_PORT to an internal port such as 11000 and let your proxy handle TLS termination.
  • If certificate issuance fails, it is almost always due to incorrect DNS records or to port 80 being occupied during the HTTP challenge.

Pro tip: Place the Docker volume for the master container on a separate, regularly backed-up partition from the start. If the container is lost, the entire AIO configuration is gone with it, not just the Nextcloud data itself.

Installing Nextcloud Manually: LAMP Stack Step by Step

If you prefer full control, you build Nextcloud the classic way on a web server, PHP-FPM, and a database. The following sequence follows the official Nextcloud Administration Manual and works almost identically on Debian and Ubuntu.

  1. Update the system and install packages: First update with apt update && apt upgrade, then install nginx or Apache as well as PHP-FPM with the required extensions, such as php-gd, php-mysql, php-curl, php-mbstring, php-intl, php-imagick, and php-redis.
  2. Set up the database: Install MariaDB (or PostgreSQL), create a dedicated database and a dedicated user with a strong password, for example with CREATE DATABASE nextcloud; CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'YourPassword';.
  3. Deploy the Nextcloud files: Download the current Nextcloud archive from the official site, extract it to /var/www/nextcloud, and set the ownership to the web server user, usually www-data.
  4. Configure the web server: Set up a virtual host for your domain that points to the Nextcloud directory, and enable the required modules for PHP-FPM.
  5. Set up TLS with Certbot: Install Certbot and request a certificate via the HTTP challenge, for example with certbot --nginx -d your-domain.com. Certbot automates both the issuance and the later renewal of the certificate.
  6. Configure Redis: Install Redis locally and enter the connection details in config.php so that Nextcloud uses it for file locking and caching instead of the slower database variant.
  7. Set up cron: Add a cron job that runs occ with the cron job every five minutes, since Nextcloud otherwise falls back to the slower AJAX mode.

This sequence is deliberately chosen so that each component builds on the previous one. If you skip a step, such as Redis, you will notice it at the latest when several users are active at the same time, through noticeably slower load times in the interface.

Domain, DNS, and TLS: Which Reverse Proxy Option Fits?

Without a working domain, neither AIO nor a manual installation can get a valid certificate. A standard domain with an A record pointing to the VPS IP is the simplest way. Alternatively, dynamic DNS works if your IP address changes occasionally. If you do not want public accessibility, you can run Nextcloud via Tailscale or a Cloudflare Tunnel instead and thereby avoid opening ports 80 and 443 altogether.

The Certbot workflow runs via an HTTP challenge: Let’s Encrypt checks whether your server is reachable at the specified domain before it issues the certificate. If that fails, it is almost always due to an incorrect DNS record or a port 80 that is already in use.

For operation behind a reverse proxy, you have several options:

  • Caddy handles TLS certificates automatically and works well for simple setups with a few services.
  • Nginx as a proxy in front of AIO or the manual installation gives you more control over headers and caching rules.
  • Traefik is a good fit if you manage several Docker containers and domains at the same time.

If AIO runs behind your own proxy, you must set APACHE_PORT to an internal port and must not let the master container additionally occupy ports 80/443. If you open ports directly on the router or in the firewall, you should generally only allow 80 and 443; all other services are better left hidden behind the firewall.

How Do You Harden Nextcloud After Installation?

A freshly installed Nextcloud instance is functional but not yet production-ready. Security headers such as HSTS are often missing by default, as are correctly set file permissions. Practical guides stress that a secure Nextcloud does not come about automatically but needs active hardening, such as HSTS headers, restrictive file permissions, and protection against brute-force login attempts.

Right after the installation, you should work through the following points:

  • Set security headers (HSTS, X-Content-Type-Options, X-Frame-Options) in the web server or reverse proxy.
  • Restrict file permissions in the Nextcloud directory to the web server user, and do not assign 777 permissions.
  • Enable brute-force protection via the built-in Nextcloud app, which delays failed logins.
  • Run occ security:setupchecks and work through the warnings in the admin area systematically.
  • After hardening, run an external check via Scan to have your own configuration assessed objectively.

Backup is where most self-hosters fail. Many only back up the data directory and overlook the database and the config.php, which in an emergency results in an unusable backup. A complete backup strategy covers three things: the data directory with the actual files, a dump of the database, and the configuration file. For automation, a tool such as Borg is suitable, which AIO already includes; with manual installations, you set it up separately via a cron job.

The order matters when restoring: first you restore the database dump, then you copy the data directory, and finally you check the config.php for consistency. If you swap this order, you risk an instance that starts but can no longer bring files and database together.

How Do You Optimize Nextcloud on a VPS for Better Performance?

Performance problems almost always come from the same two causes: missing Redis caching and untuned database settings. AIO comes with Redis preconfigured out of the box; with manual installations, you have to set it up yourself and link it in the config.php.

For a noticeably more responsive instance, the following adjustments are worthwhile:

  • Enable PHP OPcache and size it generously; this speeds up every page load noticeably.
  • Install recommended PHP extensions such as imagick so that preview images are generated quickly.
  • For MariaDB, set innodb_buffer_pool_size to about 50 to 70% of the available RAM, provided the database runs alone on the server.
  • Plan for sufficient NVMe SSD storage, since Nextcloud benefits greatly from fast storage performance when handling many small file accesses.

When it comes to maintenance, AIO and the manual installation differ significantly: AIO shows new versions in the web interface and updates most components automatically, whereas with a manual installation you have to keep PHP, the web server, and the database up to date separately. In both cases, plan fixed maintenance windows in which you apply updates, and enable automatic security updates at the operating system level so that critical vulnerabilities do not stay open for days.

Pro tip: After every major update, check the status with occ status and occ security:setupchecks. This way you find configuration problems before they turn into real outages.

Why a German VPS Makes Sense for Nextcloud

Running Nextcloud on a rented VPS spares you the network connectivity, power supply, and redundancy that your own hardware at home never offers at the same quality. A server location in Germany reduces latency for users in the region and simplifies data protection questions, especially when customers or employees access the instance. Nexthosting offers VPS plans with NVMe SSD storage and DDoS protection, suitable both for a personal AIO instance and for a manually set up Nextcloud with several active users.

— Erik

The Right VPS for Your Nextcloud Installation

Whether you choose Nextcloud AIO or the manual installation, the foundation stays the same: a reliable VPS with enough RAM, fast SSD storage, and a stable connection. This is exactly where the difference lies between a VPS you find somewhere on offer and one designed specifically for responsive operation. Nexthosting offers VPS servers with NVMe SSD and DDoS protection, plus a control panel that lets you manage Docker containers and classic LAMP setups alike.

For a small personal instance with AIO, the VPS Einfach is often enough. If you plan on Collabora Online, Talk, or several active users, you will find more headroom in RAM and compute power with the VPS Standard or the more powerful VPS Pro. If you are still missing a suitable domain for your Let’s Encrypt certificate, it can be set up directly when you order the server. Take a look at the VPS offers from Nexthosting and choose the plan that fits your expected number of users, or contact support directly if you have questions.

Sources

FAQ

Is Nextcloud AIO or a manual installation better for beginners?

AIO is clearly the easier choice for beginners because Docker, Redis, and backup come preconfigured. A manual installation mainly makes sense if you already have experience with web servers and databases.

How much RAM does a VPS need for Nextcloud?

For a small personal or team instance, a modest amount of RAM is usually enough. For AIO with Collabora Online or several active users, you should plan for more RAM. The exact requirement depends heavily on the number of users and the additional services you enable.

Does Nextcloud AIO strictly require its own domain?

In practice, yes, because AIO obtains a valid certificate for the domain you enter. Alternatives are dynamic DNS or a tunnel service such as Tailscale if you do not want to use a public domain.

How do I back up a Nextcloud installation properly?

A complete backup covers three things: the data directory, a dump of the database, and the config.php file. If you only back up the files, a database failure still costs you all metadata and user accounts.

Can I install Nextcloud on any VPS?

In principle, yes, as long as the VPS offers enough RAM and storage and runs a current Debian or Ubuntu release. A VPS with NVMe SSD storage and a stable network connection, such as one from Nexthosting, noticeably improves response times when many users are connected at the same time.