How to Install Nextcloud on Ubuntu 20.04


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Nextcloud on Ubuntu 20.04

Nextcloud is a powerful open-source self-hosted cloud storage solution. It allows you to store, share, and access your files, contacts, calendars, and other data from any device, anywhere. Nextcloud provides a secure and private cloud environment while offering similar features to popular cloud storage services like Google Drive and Dropbox.

Here is a step-by-step guide to installing Nextcloud on Ubuntu 20.04:

Step 1: Update System Packages

Before proceeding with any installation, it's always recommended to update your system packages to the latest versions. Open your Terminal and run the following command:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

Nextcloud requires some dependencies for proper functioning. Install them by running the following command:

sudo apt install apache2 mariadb-server libapache2-mod-php7.4 \
php7.4-gd php7.4-json php7.4-mysql php7.4-curl php7.4-mbstring \
php7.4-intl php7.4-imagick php7.4-xml php7.4-zip -y

Step 3: Configure the Database

Nextcloud utilizes a database to store its data. In this step, we'll configure and secure a database for Nextcloud.

Start the MariaDB database server by running the following command:

sudo systemctl start mariadb

Secure the database installation by running:

sudo mysql_secure_installation

During the process, you will be asked to set a password for the MariaDB root user and answer a few security-related questions. Follow the prompts to complete the security setup.

Next, we'll create a new database and user for Nextcloud:

sudo mysql -u root -p

Enter your MariaDB root password when prompted, then run the following SQL commands:

GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password';

Make sure to replace 'password' with a strong password of your choice. Remember this password as you'll need it in later steps.

Step 4: Configure Apache Web Server

Nextcloud runs on the Apache web server. We'll configure Apache to serve Nextcloud.

Disable the default Apache site and enable the necessary modules by running the following commands:

sudo a2dissite 000-default
sudo a2enmod rewrite headers env dir mime setenvif ssl

Create a new Apache configuration file for Nextcloud:

sudo nano /etc/apache2/sites-available/nextcloud.conf

Insert the following content in the file:

Alias /nextcloud "/var/www/html/nextcloud/"

  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews

    Dav off

Save the file and exit the text editor.

Create a symbolic link to enable the Nextcloud site:

sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf

Reload the Apache service to apply the changes:

sudo systemctl reload apache2

Step 5: Download and Install Nextcloud

Next, we'll download the latest version of Nextcloud and install it.

Move to the document root of the Apache webserver:

cd /var/www/html/

Download the Nextcloud archive:

sudo wget https://download.nextcloud.com/server/releases/latest.zip

Unzip the archive:

sudo unzip latest.zip

Change the ownership of the Nextcloud directory:

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

Step 6: Configure Nextcloud

Now, we'll configure Nextcloud through the web-based setup wizard.

Open your web browser and enter your server's IP address or domain followed by '/nextcloud' in the address bar.

Follow the on-screen instructions to complete the installation. During the setup, provide the database credentials you created earlier (database name, username, and password).

Once the installation is finished, you'll be required to create an admin account for Nextcloud.

Step 7: Finalize the Installation

After creating the admin account, you can log in to your Nextcloud instance and start using it as your private cloud storage solution.

Remember to secure your Nextcloud installation by enabling SSL, implementing strong passwords, and regularly updating the system and Nextcloud software.

Congratulations! You have successfully installed Nextcloud on Ubuntu 20.04.

Refer A Friend
Get $25

Installing Nextcloud
Nextcloud installation
Nextcloud Ubuntu 20.04
Nextcloud setup
Nextcloud server installation
Nextcloud on Ubuntu
Nextcloud installation guide
Nextcloud tutorial
How to install Nextcloud on Ubuntu 20.04
Nextcloud installation steps

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.