Google Drive is convenient until it isn’t – until you hit a storage cap, get hit with a price hike, or simply decide that a tech giant having access to your files is a trade-off you no longer want to make. Nextcloud offers a genuinely capable alternative: a self-hosted file sync and sharing platform you run on your own server, with no subscription fees and no third-party access to your data.

What You Need Before You Start
Nextcloud can run on a surprisingly modest machine. A spare Linux server, a VPS from any hosting provider, or even a Raspberry Pi 4 with a large SD card or attached USB drive will work. The minimum practical setup is a server running Ubuntu 22.04 or Debian 12, at least 2GB of RAM, and enough storage for whatever files you plan to keep. If you want to serve Nextcloud over the internet rather than just your local network, you will also need a domain name pointed at your server’s IP address.
On the software side, Nextcloud runs on the LAMP or LEMP stack – Linux, Apache or Nginx, MySQL or MariaDB, and PHP. The current stable release of Nextcloud requires PHP 8.1 or higher, and it works best with MariaDB for the database layer. Before touching Nextcloud itself, make sure your server is fully updated. Run sudo apt update && sudo apt upgrade -y and reboot if any kernel updates were applied.
You will also want to install Certbot for SSL certificates if your server is internet-facing. Nextcloud over plain HTTP is functional for local testing but unsuitable for production use – the desktop and mobile sync clients will refuse to connect without HTTPS by default. Certbot with the Nginx or Apache plugin handles Let’s Encrypt certificate issuance and auto-renewal in a few commands.
One decision to make early is whether to use the traditional manual installation or the Nextcloud All-in-One (AIO) Docker image. The Docker approach is faster and handles most configuration automatically, while the manual install gives you more control over each component. This guide covers the manual method, which is more instructive and easier to troubleshoot later.
Installing and Configuring Nextcloud
Start by installing the required dependencies. On Ubuntu or Debian, the full command is: sudo apt install apache2 mariadb-server libapache2-mod-php php php-gd php-mysql php-curl php-mbstring php-intl php-gmp php-bcmath php-xml php-imagick php-zip php-bz2 unzip wget -y. After installation, enable Apache’s required modules with sudo a2enmod rewrite headers env dir mime and restart Apache with sudo systemctl restart apache2.
Next, secure the MariaDB installation by running sudo mysql_secure_installation and following the prompts. Then log into MariaDB as root with sudo mysql -u root -p and create a dedicated database and user for Nextcloud. Run these three commands inside the MariaDB shell: CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; then CREATE USER ‘nextclouduser’@’localhost’ IDENTIFIED BY ‘your_password’; then GRANT ALL PRIVILEGES ON nextcloud.* TO ‘nextclouduser’@’localhost’;. Finish with FLUSH PRIVILEGES; and exit.
Download the latest Nextcloud release from nextcloud.com/install and verify the checksum before extracting. The standard commands are: wget https://download.nextcloud.com/server/releases/latest.zip then unzip latest.zip and sudo mv nextcloud /var/www/html/nextcloud. Set ownership so Apache can read and write the files: sudo chown -R www-data:www-data /var/www/html/nextcloud. This step is often skipped by first-timers and causes confusing permission errors during setup.

Create an Apache virtual host configuration file at /etc/apache2/sites-available/nextcloud.conf. The configuration block should point the document root to /var/www/html/nextcloud, set AllowOverride All inside the Directory block, and include your domain name in the ServerName directive. Enable the site with sudo a2ensite nextcloud.conf, disable the default site with sudo a2dissite 000-default.conf, then reload Apache. If your server is internet-facing, run Certbot at this point: sudo certbot –apache -d yourdomain.com. Certbot will obtain the certificate and automatically modify your virtual host to redirect HTTP to HTTPS.
Now open your domain in a browser. The Nextcloud setup wizard will prompt you to create an admin account, enter your database credentials, and specify the data directory where user files will be stored. The default data directory is inside the web root, which works but is not ideal for security. A better approach is to move it outside – for example to /var/nextcloud-data – and give that directory the correct ownership with sudo chown -R www-data:www-data /var/nextcloud-data before running the wizard. Complete the wizard, let it run for a minute, and you will land on a working Nextcloud dashboard.
Making It Usable Day to Day
A fresh Nextcloud install works but needs a few adjustments before it matches the experience of a managed cloud service. Go to Settings – Administration – Overview and work through any warnings Nextcloud lists. Common ones include missing PHP modules, a missing cron job, and Redis not being configured for memory caching. Setting up a proper cron job is straightforward: run sudo crontab -u www-data -e and add the line /5 * php -f /var/www/html/nextcloud/cron.php. This replaces the default AJAX-based background task runner with a proper system cron, which Nextcloud strongly prefers for reliability. Redis caching requires installing the php-redis package, running a Redis server, and adding a few lines to Nextcloud’s config/config.php file – the Nextcloud documentation covers the exact configuration block. If you are also running a self-hosted photo library, PhotoPrism can be pointed at your Nextcloud data directory to give you AI-powered photo organization on top of the same files.

The desktop sync client is available for Windows, macOS, and Linux and works identically to the Google Drive desktop app – you choose a local folder, it stays in sync with your server. Mobile apps for iOS and Android handle file access, automatic camera uploads, and offline access. The real differentiator over raw file storage is Nextcloud’s app ecosystem: Nextcloud Talk for video calls, Nextcloud Calendar and Contacts for CalDAV and CardDAV sync, Collabora Online or OnlyOffice for browser-based document editing, and Nextcloud Notes for basic markdown notes. Each is installed from the Apps section of the admin panel in a single click. The one question worth sitting with before you go fully all-in: who is responsible for backups? With Google Drive, that answer is implicit. With Nextcloud, it is entirely yours.
Frequently Asked Questions
Can I run Nextcloud on a Raspberry Pi?
Yes. A Raspberry Pi 4 with 4GB of RAM and a fast USB drive or SSD works well for personal or small household use.
Do I need a domain name to use Nextcloud?
Not for local network access. A domain name is required if you want to access Nextcloud over the internet and use HTTPS with a valid certificate.
Is Nextcloud free to use?
The community edition is fully open-source and free. You pay only for your server hardware or VPS hosting costs.
Can Nextcloud replace Google Docs for editing?
With the Collabora Online or OnlyOffice integration installed, you can edit documents, spreadsheets, and presentations directly in the browser.





