Why Run Your Own Cloud Storage
Google Drive, Dropbox, and OneDrive are convenient until they are not. Storage limits tighten, subscription prices climb, and every file you upload sits on hardware you do not control, governed by terms of service you probably never read. Nextcloud Hub offers a different arrangement: you own the server, you set the rules, and your files stay where you put them.
Nextcloud Hub is the full-stack edition of the open-source Nextcloud platform, bundling file storage with integrated apps for office editing, video calls, calendar, contacts, and task management. It is not just a file sync tool. It is a self-hosted collaboration suite that competes directly with Google Workspace on features while giving you complete control over your data.
This guide walks through installing Nextcloud Hub on a Linux server using the recommended LAMP stack, configuring it for external access, and tightening it down so it is actually usable in production.

What You Need Before You Start
You need a Linux server running Ubuntu 22.04 LTS or Debian 12. A VPS from any major provider works fine, and so does a spare machine at home. The minimum specs Nextcloud lists are 2 CPU cores and 4GB of RAM for a small team setup, though a single-user instance runs adequately on 2GB. Storage depends entirely on how much you plan to keep – the OS and Nextcloud installation itself needs around 2GB, so plan your disk around actual file volume.
A domain name pointed at your server is required if you want HTTPS, which you do. Nextcloud will generate warnings and restrict certain features when running over plain HTTP, and browser security policies increasingly block functionality on unencrypted origins. If you are running this at home behind a consumer router, you will need to forward ports 80 and 443 to your server’s internal IP address before the SSL certificate step will work. Dynamic DNS services like DuckDNS are a free option if your home IP changes regularly.
You should also have a non-root sudo user on the server and a working knowledge of the command line. This is not a one-click installer process, but nothing here requires deep Linux expertise. If you plan to access Nextcloud remotely through a private network rather than exposing it publicly, setting up Tailscale beforehand gives you a cleaner access model without opening firewall ports.
Installing the LAMP Stack and Nextcloud
Start by updating your package list and installing Apache, MariaDB, and PHP 8.1 along with the modules Nextcloud requires. Run sudo apt update && sudo apt upgrade -y, then install with sudo apt install apache2 mariadb-server php8.1 php8.1-{gd,mysql,curl,mbstring,intl,gmp,bcmath,xml,imagick,zip,bz2,apcu} libapache2-mod-php8.1 -y. Enable the necessary Apache modules with sudo a2enmod rewrite headers env dir mime and restart Apache.
Set up your MariaDB database by running sudo mysql_secure_installation to lock it down, then log in with sudo mysql -u root -p and create a dedicated database and user. The commands are: CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; followed by CREATE USER ‘ncuser’@’localhost’ IDENTIFIED BY ‘your_strong_password’; and then GRANT ALL PRIVILEGES ON nextcloud.* TO ‘ncuser’@’localhost’; FLUSH PRIVILEGES;. Keep those credentials – you will enter them in the Nextcloud setup wizard. Download the latest Nextcloud Hub release from nextcloud.com/install, unzip it into /var/www/html/nextcloud, and set ownership with sudo chown -R www-data:www-data /var/www/html/nextcloud.
Create an Apache virtual host config file at /etc/apache2/sites-available/nextcloud.conf. Set the DocumentRoot to /var/www/html/nextcloud, add the standard Nextcloud Directory block with AllowOverride All, and point your ServerName to your actual domain. Enable the site with sudo a2ensite nextcloud.conf and reload Apache. Then run Certbot to provision your SSL certificate: sudo apt install certbot python3-certbot-apache -y followed by sudo certbot –apache -d yourdomain.com. Certbot will automatically modify your virtual host to redirect HTTP to HTTPS.

First-Run Configuration and Performance Tuning
Navigate to your domain in a browser and the Nextcloud setup wizard loads. Enter your chosen admin username and password, then fill in the database fields using the credentials you created in MariaDB – database name nextcloud, username ncuser, and the password you set. Leave the database host as localhost. You can also specify a data directory here; the default is inside the web root, but a better practice is to store user files outside it, such as /var/nextcloud/data, to reduce exposure. Click install and wait roughly two minutes while Nextcloud initializes.
After the first login, open Settings > Administration > Overview. Nextcloud runs a self-check here and will flag configuration issues with red or yellow warnings. Common ones include missing PHP memory limits, an unconfigured background job runner, and absent Redis caching. Fix PHP memory by editing /etc/php/8.1/apache2/php.ini and setting memory_limit = 512M. For background jobs, set the cron method in Admin settings to “Cron” and add a system crontab entry: /5 * www-data php -f /var/www/html/nextcloud/cron.php. This keeps file indexing, notifications, and activity logging running without relying on browser sessions.
Redis caching is not optional if you care about performance. Install it with sudo apt install redis-server php8.1-redis -y, then add these lines to your nextcloud/config/config.php inside the config array: ‘memcache.local’ => ‘\OC\Memcache\APCu’, ‘memcache.locking’ => ‘\OC\Memcache\Redis’, and the Redis connection block pointing to 127.0.0.1 on port 6379. APCu handles local caching for single-server installs; Redis handles file locking, which prevents corruption when multiple clients write simultaneously. Without locking enabled, sync conflicts on the desktop client become a real problem under normal use.

Getting the Most Out of Nextcloud Hub
The default installation is functional but bare. Nextcloud Hub’s value comes from its app ecosystem, accessible through Apps in the admin menu. Nextcloud Office integrates Collabora Online directly into the browser for real-time document, spreadsheet, and presentation editing – this is the Google Docs equivalent, and it works entirely on your server with no calls to external services. Talk adds encrypted audio and video calls. Deck provides kanban-style project boards. Calendar and Contacts sync over CalDAV and CardDAV, which means your phone can talk to your self-hosted Nextcloud the same way it would talk to Google. Installing the Nextcloud client apps on your desktop and mobile devices completes the loop – files sync automatically, photos upload in the background, and the experience becomes nearly indistinguishable from commercial alternatives, except nothing leaves your hardware.
One detail worth getting right immediately: enable two-factor authentication for the admin account under Settings > Security before exposing the instance to the internet. A Nextcloud instance with a weak or reused admin password and no 2FA is a liability, not an asset.





