• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Install Nextcloud on Ubuntu 22.04 Server

By Abhishek Ghosh February 27, 2024 4:41 pm Updated on February 27, 2024

How to Install Nextcloud on Ubuntu 22.04 Server

Advertisement

As we have explained in earlier article, Nextcloud is a free web software for storing (and also sharing) files. Nextcloud can be considered an alternative to cloud-based SaaS services including Dropbox and Google Drive. This guide will show you how to install, and configure Nextcloud on Ubuntu 22.04 LTS on own server. As because Nextcloud is PHP MySQL based, the installation is almost like installing WordPress.

You can use VPSDime OpenVZ instances for small to medium websites. 6GB RAM, 10Gbps connection instances will cost you $7.00/mo.

You can login as root user and continue the guide. But we recommend that you need to complete Set up a Passwordless SSH Login in Ubuntu 22.04. Also, it is practical to install and configure Fail2Ban.

Advertisement

---

 

Install MariaDB on Ubuntu 22.04

 

Run these commands:

Vim
1
2
3
4
sudo apt update -y
sudo apt upgrade -y
sudo apt install mariadb-server
sudo mysql_secure_installation

Except for adding a new password, removing the test databases and reloading privileges, you need not change anything. Never change anything related to this root user account. On Debian-based systems, it is risky to disturb it. If you change the password of this root account later, you may face odd errors.

Create a new user with the privileges same as the root user with the name admin:

Vim
1
2
3
4
sudo mariadb
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;

Now, log in as admin to MariaDB:

Vim
1
sudo mysql -u admin -p

Create a database for Nextcloud using the following command. We have named it nextclouddb and the user as nextcloud, but you can use whatever name you like:

Vim
1
2
3
4
5
create database nextclouddb;
create user nextcloud@localhost identified by 'your-password';
grant all privileges on nextclouddb.* to nextcloud@localhost;
flush privileges;
exit;

Check the database and user:

Vim
1
2
3
sudo mysql -u nextcloud -p
show databases;
exit;

We need to tweak the MariaDB settings file for optimal performance. I have an optimized mariadb.cnf file on GitHub for your work. This is intended for a 12GB server.

After altering the file (just replace the content of /etc/mysql/mariadb.cnf) and restarting MySQL (service mysql restart), you can use MySQL Tuner for further optimization.

 

Install PHP and Apache2 on Ubuntu 22.04

 

Run these commands:

Vim
1
2
3
4
5
6
7
8
9
10
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
sudo apt install php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml
sudo apt install apache2 apache2-doc apache2-utils
# required for later steps
sudo apt install unzip
sudo apt install libmagickcore-6.q16-6-extra

Enable the mpm_prefork Apache module and disable mpm_event:

Vim
1
2
3
4
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
# enable these modules
sudo a2enmod dir env headers mime rewrite ssl

Restart Apache using the systemctl utility:

Vim
1
2
sudo systemctl restart apache2
sudo systemctl status apache2

Visit the IP address of the web server and confirm the server is working properly: http://your_IP_address/.

 

Install Nextcloud

 

Visit nextcloud.com/changelog/ to find the latest version. Download it:

Vim
1
wget https://download.nextcloud.com/server/releases/nextcloud-28.0.2.zip

Unzip the archive. This creates a nextcloud folder in the same directory as the zip file.

Vim
1
unzip nextcloud-28.0.2.zip

Delete the archive after unzipping the contents. Change the folder permissions for the nextcloud directory:

Vim
1
sudo chown -R www-data:www-data nextcloud

Move the new directory to the server directory. The server directory usually defaults to /var/www/html on most servers.

Vim
1
sudo mv nextcloud /var/www/html

Disable the default Apache landing page:

Vim
1
sudo a2dissite 000-default.conf

Create a new file in the /etc/apache2/sites-available directory and name the file nextcloud.conf:

Vim
1
sudo nano /etc/apache2/sites-available/nextcloud.conf

The file must include the following information:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<VirtualHost *:80>
    DocumentRoot "/var/www/html/nextcloud"
    ServerName example.com
 
    <Directory "/var/www/html/nextcloud/">
        Options MultiViews FollowSymlinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
 
    TransferLog /var/log/apache2/nextcloud_access.log
    ErrorLog /var/log/apache2/nextcloud_error.log
 
</VirtualHost>

Enable the site:

Vim
1
sudo a2ensite nextcloud.conf

Edit the php.ini file, open with sudo nano /etc/php/8.2/apache2/php.ini (for PHP 8.2) command and change to these:

Vim
1
2
3
4
5
6
7
8
9
10
11
max_execution_time = 360
memory_limit = 512M
post_max_size = 200M
upload_max_filesize = 200M
date.timezone = Asia/Kolkata
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=1
opcache.save_comments=1

`
Restart Apache:

Vim
1
sudo systemctl restart apache2

Point the domain towards the server. Wait for propagation. Visit the domain associated with the server. The Nextcloud configuration page will appear in the browser window:

How to Install Nextcloud on Ubuntu 22-04 Server

Complete the installation. In next step, you need to enable HTTPS. We are not covering that part.

You’ll get more documentation here: https://doc.owncloud.com/server/next/admin_manual/

Tagged With testingbYP4WofR\ OR 446=(SELECT 446 FROM PG_SLEEP(15))-- , testingCptzjiX4\)) OR 386=(SELECT 386 FROM PG_SLEEP(15))-- , testingEp4FWEzW\; waitfor delay \0:0:15\ -- , testingHll061X9\) OR 593=(SELECT 593 FROM PG_SLEEP(15))-- , testingJX64NIB3
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Install Nextcloud on Ubuntu 22.04 Server

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Zend Opcache Optimization for Nginx Ubuntu (HP Cloud)

    Here is Full Guide to Zend Opcache Optimization for Nginx PHP5-FPM for Ubuntu Server Running on HP Cloud. We Suggest to Use Zend Opcache over APC.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

  • How to Install WordPress : Ubuntu 16.04, Nginx, PHP7-FPM

    Here is Step by Step Guide on How to Install WordPress on Ubuntu 16.04, Nginx, PHP7-FPM, memcached & Percona MySQL 5.7 on Cloud Server or VPS.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

vpsdime

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Cloud-Powered Play: How Streaming Tech is Reshaping Online GamesSeptember 3, 2025
  • How to Use Transcribed Texts for MarketingAugust 14, 2025
  • nRF7002 DK vs ESP32 – A Technical Comparison for Wireless IoT DesignJune 18, 2025
  • Principles of Non-Invasive Blood Glucose Measurement By Near Infrared (NIR)June 11, 2025
  • Continuous Non-Invasive Blood Glucose Measurements: Present Situation (May 2025)May 23, 2025
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2026 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy