How to install the latest version of Nextcloud on Ubuntu Server 22.04


Jack Wallen takes a slightly easier route to installing the latest version of the Nextcloud cloud platform.

Image: Ar_TH/Adobe Stock

For those not in the know, Nextcloud is a cloud-based suite of tools that includes things like document and file management, calendar, chat (video and audio), email, forms and contacts. In fact, for those interested, Nextcloud could easily replace Google Workspace or Microsoft 365. I’ve been using Nextcloud since its inception and I’m convinced that almost anyone can benefit from this platform. .

I want to show you how to install the latest version of Nextcloud (v24) on Ubuntu Server 22.04. This time, however, I’m going to use their install script. Although this script does not remove some of the manual installation steps, it does make it slightly easier.

That said, let’s get to the installation.

SEE: Recruitment Kit: Cloud Engineer (TechRepublic Premium)

What you will need

You will only need two things for this to work: a running instance of Ubuntu Server 22.04 and a user with sudo privileges. That’s it – let’s do like Kate Bush and do some cloudbusting.

How to install the necessary dependencies

The install script doesn’t handle installing dependencies, so we need to take care of that first. To begin, let’s install the full LAMP stack. Connect to your Ubuntu server and run the command:

sudo apt-get install lamp-server^ -y

Once this installation is complete, take care of the PHP requirements with:

sudo apt-get install php zip libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp zip -y

Restart Apache with:

sudo systemctl restart apache2

Next, we will secure the database installation with:

sudo mysql_secure_installation

Make sure the document root belongs to the Apache group with:

sudo chown -R www-data.www-data /var/www/html

How to create the database

Next, we need to create a database. Log in to the MySQL console with:

sudo mysql -u root -p

Create the database with:


Then create the Nextcloud database user with the command:

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

Where PASSWORD is a unique/strong password.

We now need to give the nextcloud user the necessary permissions with the command:

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

Dump the privileges and exit the console with the two commands:



How to download the installation script

Switch to the document root with:

cd /var/www/html

Download the installer with the command:


How to run the installer

Open a web browser and point it to http://SERVER/setup-nextcloud.phpwhere SERVER is the IP address or domain of the hosting server. You will be greeted by the first window of the installation wizard. Click Next and you should see a window stating that all dependency checks were successful (Figure A), which allows you to set the document root for installation.

Figure A

The Nextcloud 24 dependencies check window allows you to set the document root for the installation.

You can either create a new Nextcloud home directory (by typing the name field) or type a . to install it in the document root of the web server. Do one or the other, then click Next and the script will download and unzip everything needed. This will take two to 10 minutes depending on the speed of your network connection and the power of your server.

Once Nextcloud is installed, you will be prompted to click Next again, where you will be taken to the Database configuration window (Figure B).

Figure B

Database configuration for Nextcloud.

First, create an administrator user and make sure to select MySQL/MariaDB as the database. You will then fill in the database information as such:

  • Database user: nextcloud
  • Database password: the password you created when creating the database user in the MySQL console.
  • Name of the data base: nextcloud

Leave localhost as is, then click Install. Once the database is taken over, you will be asked if you want to install the recommended applications (Figure C).

Figure C

Installation of recommended applications for Nextcloud 24.

Click on Install recommended apps, and when it is done, the Nextcloud main window will appear (Figure D).

Figure D

Nextcloud’s main window is ready to allow you to customize your installation.

Now you can further customize your setup by installing more apps or just start working with your new Nextcloud cloud platform. Congratulations on taking your productivity to the next level.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech tips for professionals from Jack Wallen.


About Author

Comments are closed.