This guide provides a straightforward approach to installing the
latest version of Nextcloud, a self-hosted productivity platform, on an
Ubuntu server. Nextcloud Hub 6 (27.1.3) offers file hosting,
collaboration, and more, with the flexibility of a private server.
Prerequisites
-
A server running Ubuntu 20.04 LTS or later.
-
Basic familiarity with the command line interface.
Installation Process
Follow these steps to install Nextcloud Hub 6 (27.1.3) on your Ubuntu
server:
Step 1: Update Your
Server
Ensure your server’s package list and the system itself are up to
date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Apache
Web Server
Install Apache, which will serve your Nextcloud files:
sudo apt install apache2 -y
Step 3:
Install PHP and Required PHP Modules
Nextcloud requires PHP to run. Install PHP along with the necessary
modules:
sudo apt install php libapache2-mod-php php-mysql php-dom php-xml php-mbstring php-gd php-curl php-zip -y
Step 4: Install MariaDB
Server
Install MariaDB, a database server to store Nextcloud data:
sudo apt install mariadb-server -y
Step 5: Create a
Database for Nextcloud
First, log in to the MariaDB shell:
sudo mariadb -u root -p
After logging in, create a database for Nextcloud and a user with the
desired credentials:
CREATE DATABASE nextcloud;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'your_desired_username'@'localhost' IDENTIFIED BY 'your_desired_password';
FLUSH PRIVILEGES;
EXIT;
Step 6:
Install Unzip, and Download Nextcloud
Before downloading Nextcloud, make sure you have unzip installed to
extract the downloaded file:
sudo apt install unzip -y
wget https://download.nextcloud.com/server/releases/nextcloud-27.1.3.zip
Step 7:
Extract Nextcloud and Set Permissions
Unzip the Nextcloud package to the web root directory and set the
correct permissions:
unzip nextcloud-27.1.3.zip -d /var/www/html/
sudo chown -R www-data:www-data /var/www/html/nextcloud/
Step 8: Configure
Apache for Nextcloud
Create an Apache configuration file for Nextcloud:
sudo nano /etc/apache2/sites-available/nextcloud.conf
Insert the following configuration and save the file:
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
Enable the new site and rewrite module:
sudo a2ensite nextcloud
sudo a2enmod rewrite
sudo systemctl restart apache2
Step
9: Complete the Installation Through the Web Interface
Open your web browser and navigate to
http://your_server_ip/nextcloud. Complete the setup by
providing the following information:
-
Admin account details: Choose a username and
password for the Nextcloud administrator CD account. -
Data folder: Confirm the path to the data folder
where Nextcloud will store its files. -
Database configuration: Enter the credentials
for the database user and name you created earlier. Use
localhost for the database host unless your database is
on a different server.
After entering the details, click the Finish setup
button to complete the installation and then navigate to
http://your_server_ip/nextcloud/index.php/login if you
didn’t redirect automatically.
You now have a running instance of Nextcloud Hub 6 (27.1.3) on your
Ubuntu server. Begin by exploring the dashboard and configuring your
Nextcloud environment to suit your personal or business needs. If you
need any more information or further assistance, feel free to contact
our support team by submitting a
ticket.