Example installation on Ubuntu 24.04 LTS

You can use .deb packages to install the required and recommended modules for a typical Nextcloud installation, using Apache and MariaDB, by issuing the following commands in a terminal:

sudo apt update && sudo apt upgrade
sudo apt install apache2 mariadb-server libapache2-mod-php php-gd php-mysql \
php-curl php-mbstring php-intl php-gmp php-xml php-imagick php-zip

Now you need to create a database user and the database itself by using the MySQL command line interface. The database tables will be created by Nextcloud when you login for the first time.

To start the MySQL command line mode use the following command:

sudo mysql

Then a MariaDB [root]> prompt will appear. Now enter the following lines, replacing username and password with appropriate values, and confirm them with the Enter key:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

You can quit the prompt by entering:

quit;

Now download the archive of the latest Nextcloud version:

On other HTTP servers it is recommended to install Nextcloud outside of the document root.

Next steps

After installing the prerequisites and extracting the nextcloud directory, you should follow the instructions for Apache configuration at :ref:`apache_configuration_label`. Once Apache is installed, you can optionally follow the :doc:`source_installation` guide from :ref:`pretty_urls_label` until :ref:`other_HTTP_servers_label`