Install NextCloud On Ubuntu 22.04 LTS


In this tutorial, we are going to explain in details how to install nextcloud on Ubuntu 22.04.

Nextcloud is a file hosting system that allows us to store our content like documents, pictures, videos, etc, and share them with others.

Instead of relying on external service providers for our personal and business documents, Nextcloud gives us the freedom to store them on our servers or in trusted data centers.

it’s a self-managed centralized document and file management system. It is Open-Source hence enabling us to use and adapt the application as we need. We have full control over the application. So we can provide our security measures to secure our contents.

Nextcloud installation is easy and straightforward, there are many steps to enhance the functionalities of nextcloud, below, we provided the very basic steps to quickly install Nextcloud on Ubuntu 22.04 LTS.

Step1: Install PHP and MySQL packages

1. Update and Upgrade the Ubuntu Packages

apt update && apt upgrade

2. install Apache and MySQL Server

apt install apache2 mariadb-server

3. Install PHP and other Dependencies and Restart Apache

apt install libapache2-mod-php php-bz2 php-gd php-mysql php-curl \
php-mbstring php-imagick php-zip php-ctype php-curl php-dom \
php-json php-posix php-bcmath php-xml php-intl php-gmp zip unzip wget

4. Enable required Apache modules and restart Apache:

a2enmod rewrite dir mime env headers
systemctl restart apache2

Step2: Configure MySQL Server

1. Login to MySQL Prompt, Just type

mysql

2. Create MySQL Database and User for Nextcloud and Provide Permissions.

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'passw@rd';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
quit;
Please enable JavaScript in your browser to complete this form.

Newsletter

Get Special Free Tips, Tricks & Tutorials

Step3: Download and Install Nextcloud

Now download the latest Nextcloud archive file, Go to the Nextcloud Download Page. Or you can download from this direct link.

1. Download and unzip at the web root (/var/www/html) folder

cd /var/www/html
rm index.html
wget https://download.nextcloud.com/server/releases/latest.zip
unzip latest.zip

2. Move all nextcloud content to the web root (/var/www/html) folder

cd /var/www/html/nextcloud
mv * .* ../

3. Remove the empty nextcloud directory

rmdir /var/www/html/nextcloud

4. Change the ownership of the Nextcloud content directory to the HTTP user.

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

Step4: Finalize Setup from the Browser

Now, Go to the Browser and type http:// [ ip or fqdn ] of the server, The below Nextcloud install page will appear. On the page, we need to provide information for

1. Nextcloud admin username & password
2. Database Credentials (db name, db user and db Password)

After Providing all the information click the Install button. it will install Nextcloud in a minute and provide the recommended app installation page, we can safely cancel the prompt for now.

Our installation and Initial Setup are complete so Next, the Nextcloud Dashboard will appear.

OK, this is it. 🤗

This is the fastest way to install Nextcloud on Ubuntu 22.04, after installation we should take care of the Nextcloud performance and security issues.

If you want to learn more about Nextcloud, you can visit this YouTube Playlist

Now It’s Your Turn

I hope this guide will help you to Install NextCloud On Ubuntu 22.04 LTS. I have tried to show you every step in detail.

If you face any issue or have any drought on any stage, please let me know on the comment section below 👇

Thanks !! ❤️

Rahman Munna
Rahman Munna

Rahman Munna is an accomplished IT professional with over 15 years of experience specializing in System Administration across Linux, Windows, and Virtualization Technologies. With a strong focus on Email and Web Server Administration, Rahman has a proven track record of managing and optimizing complex IT infrastructures for multinational organizations.

Leave a Reply

Your email address will not be published. Required fields are marked *