How to Install Nextcloud on Ubuntu 20.04 Server

Welcome to our step-by-step guide on installing Nextcloud on your Ubuntu 20.04 server. Nextcloud is a powerful open-source platform that allows you to store, share, and collaborate on your files and content securely. By following these instructions, you’ll have your own private cloud server up and running in no time!

Step 1: Update and Upgrade Ubuntu

Before installing any new software, it’s always a good idea to ensure your system is up to date. Open a terminal window and run the following commands:

sudo apt update

sudo apt upgrade

Step 2: Install Apache, MariaDB, and PHP

Nextcloud requires a web server, database management system, and PHP. Install the necessary packages using the following commands:

  • sudo apt install apache2
  • sudo apt install mariadb-server
  • sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-json php-mbstring php-intl php-imagick php-xml php-zip

Step 3: Configure MariaDB

Next, secure your MariaDB installation and create a new database and user for Nextcloud:

sudo mysql_secure_installation

sudo mysql -u root -p

Once logged into MariaDB, create the database and user:

CREATE DATABASE nextcloud;

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';

FLUSH PRIVILEGES;

Step 4: Download and Install Nextcloud

Download the latest version of Nextcloud from the official website:

wget https://download.nextcloud.com/server/releases/nextcloud-21.0.1.zip

Extract the downloaded zip file and move it to the desired location:

sudo unzip nextcloud-21.0.1.zip -d /var/www/html/

Set the correct permissions for Nextcloud:

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

Step 5: Complete the Installation through the Web Browser

Now, open your web browser and navigate to http://your-server-IP/nextcloud. Follow the on-screen instructions to complete the setup process. Enter the database user credentials created earlier and choose a username and password for the admin account. Once done, you’ll have your Nextcloud server ready for use!

That’s it! You’ve successfully installed Nextcloud on your Ubuntu 20.04 server. Enjoy secure file storage, sharing, and collaboration with your very own private cloud solution. If you encounter any issues during the installation process, feel free to consult the official Nextcloud documentation or seek assistance from the vibrant Nextcloud community.