Euro-Office comes to your desktop with the Nextcloud Office Desktop app
The Euro-Office desktop app is here. Learn about the app’s features, how to install it, and how to co-edit files with your team through Nextcloud Hub.
Read More
Explore what’s new in the release blog!
Read moreDeploying an air-gapped cloud keeps your collaboration off the public internet, so files, chats, and documents never leave your infrastructure and are protected from outside attacks.
Because Nextcloud is self-hosted software rather than a service, you decide when, where, and how it runs, and Nextcloud Files, Talk, Office, Groupware, and Flow all keep working without an outside connection. Even Nextcloud Assistant can be run air-gapped, as long as you use a locally hosted AI model.
This guide walks you through planning, installing, configuring, and maintaining Nextcloud in an air-gapped environment.
Table of contents
“Air-gapped” can mean different levels of isolation, and Nextcloud works with all of them:
First, decide how clients will reach the system. Three network layouts are common:
Nextcloud doesn’t dictate how you manage your network, so pick the model that fits your security requirements.
For an individual or an organization with fewer than around 500 users, a single server running all components is usually enough. At larger scale, you need to run Nextcloud on several web servers rather than one. Putting a load balancer in front of them spreads incoming user requests across the servers, so none of them gets overloaded and Nextcloud stays available if one fails.
Break the rest of the system down into its components so you can deploy and scale each one separately:
The Nextcloud software doesn’t have to live on the web servers themselves. Mounting it from an NFS share lets you swap web servers in and out and keeps Nextcloud upgrades independent of operating system upgrades.
If your users work from several locations, latency depends mostly on your infrastructure and your network bandwidth, not on Nextcloud. Disk performance often matters more than network latency, so prefer SSDs over single hard drives. Even a home instance on a 16 Mbit/s down and 3 Mbit/s up connection remains usable from the other side of the world, so solid infrastructure with decent bandwidth comfortably supports users in different regions.
Clients need these ports to reach your deployment:
If you run Nextcloud Talk or Nextcloud Office, these ports need to be reached as well:
Nextcloud Office and Nextcloud Talk need direct access. Their backends run in parallel to Nextcloud rather than behind it, so every client device, whether a laptop, tablet, or phone, must be able to connect straight to the document server and the Talk backend, not just to the Nextcloud web servers. Nextcloud and the Nextcloud Office server must also be able to reach each other, so documents can be opened in the editor and changes saved back. Whether these backends sit behind your load balancer is up to you. The database and storage, by contrast, can stay fully behind Nextcloud.
If your firewall can’t allow port 3478 to the Talk backend, add a TURN server. It relays call audio and video when participants can’t connect to each other directly, for example behind strict firewalls or NAT. For deployments beyond roughly 100 users, run the Talk backend on its own server.
Finally, plan your SSL certificates. Avoid self-signed certificates, even in a fully air-gapped deployment, because they force users to accept them manually. Use valid certificates and schedule their renewal: expiry is easy to overlook in air-gapped and on-premises environments, and an expired certificate can suddenly lock users out.
There are two ways to install Nextcloud in an air-gapped environment.
Deploy Nextcloud in an environment that still has internet access, so it can download its package dependencies. Once Nextcloud is installed and configured, restrict the network.
With virtual machines, install everything before any user data or accounts exist, then shut the VMs down, copy their images (for example, QCOW2 or VMDK files) into your production environment, and start them up there. If the machines already sit where they’ll run in production, you may not need to move anything at all: simply tighten the network rules after setup.
If the environment must be completely isolated from the start, you can set up a local package mirror. Nextcloud’s PHP dependencies come from your operating system’s package repositories, so mirror those for your distribution. For example, Ubuntu offers robust tooling for running your own mirror. Then download the Nextcloud release archive on a connected machine, transfer it, and deploy it directly in the isolated environment.
The Nextcloud AIO (All-in-One) Docker image isn’t designed for air-gapped installations, so use a package-based installation instead.
Adjust a few settings in config.php, which lives in the config folder of your Nextcloud installation, for example /var/www/nextcloud/config/config.php.
Setting has_internet_connection to “false” stops Nextcloud from trying to reach external services such as the app store, which would otherwise wait for connections that time out. Disabling updatechecker stops update checks.
Nextcloud Enterprise customers should also set has_valid_subscription to “true” in config.php, and they can apply their subscription key without internet access by using occ, Nextcloud’s command-line tool. Run it from the Nextcloud installation folder as the web server user, for example sudo -E -u www-data php occ on Debian or Ubuntu. To set the key, run occ config:app:set support potential_subscription_key --value <your-key>, or enter it in the “Support” section of the administration settings.
Additional apps and integrations with other systems are installed via the Nextcloud App Store, which an air-gapped instance cannot reach.
Here’s what you’ll need to do instead:
occ app:enable <app-id>.If you keep a connected copy of your server, such as a cloned VM, you can also update apps there and then copy their folders into the apps, 3rdparty, or custom_apps directory of your air-gapped instance.
Most hardening happens within Nextcloud itself. The built-in check in the “Overview” section of the administration settings reviews your instance and recommends ways to improve its security. Enterprise customers will find further guidance on the Nextcloud Portal and, depending on their plan, can also book an installation review by one of Nextcloud’s Sales Engineers to make sure best practices are followed.
Pick an update strategy that fits your isolation model:
Whichever you choose, back up your database regularly, and always before you change or update the database servers, with mysqldump for MySQL or MariaDB and pg_dump for PostgreSQL.
When you replace the Nextcloud files during an update, always keep the config and data directories. Because apps are harder to download again in an air-gapped environment, also keep the apps, 3rdparty, and custom_apps directories where applicable. If you set a separate data directory or a remote mount during initial setup, make sure it isn’t overwritten.
Always upgrade one major version at a time. For example, go from Nextcloud 34 to 35, never straight from 34 to 36. The admin interface usually shows the available upgrade path, but on an air-gapped instance it may not be visible, so check it yourself. If Nextcloud can’t find some files after the upgrade, which is rare, run occ files:scan to rescan them.
For step-by-step upgrade instructions, see the manual upgrade guide in the Nextcloud administration manual. Nextcloud Enterprise customers will also find upgrade guides, including one on upgrading offline (air-gapped) installations, and recommended occ commands on the Nextcloud Portal.
Curious what an air-gapped Nextcloud looks like in practice? In our on-demand webinar, we cut a Nextcloud server off from the internet completely: a ping to Google goes nowhere, yet browsing files, opening spreadsheets, and creating new documents work just as they always do. The session also includes a Q&A with practical answers on updates, installing apps offline, and running Nextcloud Talk behind a firewall.

An air gap isolates a system from untrusted networks such as the internet, so attackers can’t reach it remotely and data can’t leave it unnoticed.
It’s a collaboration platform, with file storage, chat, video calls, and document editing, that runs entirely inside an isolated network. All servers and data stay within infrastructure you control.
It removes the remote attack surface, keeps your data away from third-party services, and gives you full control over what enters your environment, which also makes strict compliance requirements easier to meet. However, it doesn’t replace hardening and regular updates.
Strictly speaking, yes. In practice, the term also covers setups that only limit internet traffic or allow access through a VPN. Nextcloud works with all of them.
An on-premises cloud runs on your own servers but is usually still connected to the internet. An air-gapped cloud is also cut off from outside networks, so updates and apps have to be brought in manually.