Configuration steps for installing Nextcloud on Ubuntu 20.04 LTS

 

Tired of Big Tech Controlling Your Cloud Storage? Take Back Your Data with Nextcloud!

In today's digital age, we entrust mountains of personal and professional data to cloud storage providers. But what if you could ditch the limitations and privacy concerns of these big tech companies? Enter Nextcloud: an open-source self-hosted cloud storage solution that puts you back in control.

Imagine having a private cloud storage system that:

  • Respects your privacy: With Nextcloud, your data stays securely on your own server, shielded from prying eyes.
  • Offers flexibility: Nextcloud is endlessly customizable. Install apps to add features like collaborative editing, document scanning, or music streaming – all on your terms.
  • Empowers you: Unlike closed cloud platforms, Nextcloud grants you complete control over your data. Access, manage, and share your files however you see fit.

Nextcloud goes beyond simple storage, offering a suite of powerful features:

  • File Sharing and Collaboration: Securely share files and folders with colleagues, friends, or family. Real-time collaboration tools let you work together seamlessly on documents.
  • Mobile Access: Access your cloud storage on the go with Nextcloud mobile apps for iOS, Android, and other platforms.
  • Calendar and Contacts: Manage your schedule and contacts directly within your Nextcloud environment.
  • End-to-End Encryption: Protect your most sensitive data with an extra layer of security using optional end-to-end encryption.

Nextcloud is perfect for:

  • Individuals: Take back control of your personal data and ditch the limitations of free cloud storage tiers.
  • Families: Create a central hub for shared photos, videos, and documents accessible to everyone in the family.
  • Businesses: Securely store and collaborate on business-critical documents with a private cloud solution that scales with your needs.

Prerequisites:

  • A server running Ubuntu 20.04 LTS (64-bit).
  • A non-root user with sudo privileges.
  • A domain name pointed to your server's IP address (optional, but recommended for production use).

Step 1: Update and Upgrade System

Begin by updating the system's package lists and upgrading any existing packages:

Bash
sudo apt update && sudo apt upgrade -y

Step 2: Install LAMP Stack

Nextcloud requires a LAMP (Linux, Apache, MySQL, PHP) stack for its operation. Install the necessary packages:

Bash
sudo apt install apache2 mariadb-server php-fpm php-mysqli php-imagick php-gd php-zip unzip curl -y

Step 3: Secure MySQL

Once the installation is complete, secure the MySQL database server by running the following command and following the on-screen prompts to set a strong root password for MySQL:

Bash
sudo mysql_secure_installation

Step 4: Create a Database for Nextcloud

  1. Log in to the MySQL server using the root user and password you set in the previous step:
Bash
sudo mysql -u root -p
  1. Create a database named nextcloud for Nextcloud:
SQL
CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  1. Create a database user named nextclouduser and grant it full access to the nextcloud database. Replace your_strong_password with a strong password:
SQL
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
  1. Exit the MySQL shell:
quit;

Step 5: Download Nextcloud

Download the latest stable version of Nextcloud from the official website:

Bash
wget https://download.nextcloud.com/server/releases/latest.tar.bz2

Step 6: Extract Nextcloud

Extract the downloaded archive to the web server's document root directory, which is typically /var/www/html:

Bash
sudo tar -xvf latest.tar.bz2 -C /var/www/html

Step 7: Set Permissions

Set ownership of the Nextcloud directory and its contents to the web server user (usually www-data):

Bash
sudo chown -R www-data:www-data /var/www/html/nextcloud

Step 8: Configure Apache

  1. Create a new virtual host configuration file for Nextcloud using your preferred text editor (e.g., nano):
Bash
sudo nano /etc/apache2/sites-available/nextcloud.conf
  1. Add the following configuration to the file, replacing <your_domain> with your actual domain name or server's IP address:
Apache
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName <your_domain>
    DocumentRoot /var/www/html/nextcloud

    <Directory /var/www/html/nextcloud/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/apache2/nextcloud_error.log
    CustomLog /var/log/apache2/nextcloud_access.log combined
</VirtualHost>
  1. Enable the virtual host configuration:
Bash
sudo a2ensite nextcloud.conf
  1. Restart Apache:
Bash
sudo systemctl restart apache2

Step 9: Access Nextcloud Web Interface

Open a web browser and navigate to your Nextcloud server's address (e.g., http://<your_domain> or http://<server_ip>). You should see the Nextcloud welcome screen.

Step 10: Complete the Nextcloud Setup

Follow the on-screen instructions to complete the Nextcloud setup process. This includes setting an admin username and password, choosing a storage location for your data, and configuring any additional options.

Additional Notes:

  • It's recommended to enable HTTPS encryption for your Nextcloud installation to secure communication. You can follow guides available online to set up Let's Encrypt SSL certificates for your server.
  • Nextcloud offers various apps and features that can be installed to extend its functionality. You can explore the app

VCF 9 Home Lab | Embedded vIDM (viDB) --- AD Integration, Users, Groups & NSX SSO

VCF 9 Home Lab | Embedded vIDM (viDB) — AD Integration, Users, Groups & NSX SSO 📅 May 2026  |  🏷️ VCF 9 Home Lab Series  ...