Nextcloud is a popular, open-source platform for hosting your own cloud storage services. In this guide, we will walk through the installation of Nextcloud with Apache web server and secure it using Let's Encrypt SSL on Ubuntu 22.04 LTS.
Step 1: Update the System
Begin by ensuring your system is up-to-date by running the following commands:
sudo apt update && sudo apt upgrade
Step 2: Install Apache Web Server
Apache is a reliable web server that we will use to serve Nextcloud. To install Apache, run the following command:
sudo apt install apache2
Once installed, start and enable Apache:
sudo systemctl start apache2
sudo systemctl enable apache2
Step 3: Install PHP and Required Modules
Nextcloud requires PHP and several additional modules. Install them using the following command:
sudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-curl php-zip php-gd php-intl
Step 4: Install MySQL
MySQL will serve as the database for Nextcloud. Install MySQL server with the following command:
sudo apt install mysql-server
After installation, secure MySQL by running the following:
sudo mysql_secure_installation
Create a database for Nextcloud:
sudo mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 5: Download and Install Nextcloud
Download the latest version of Nextcloud from the official website:
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
Extract the downloaded file and move it to the Apache web root directory:
tar -xjf latest.tar.bz2
sudo mv nextcloud /var/www/html/
sudo chown -R www-data:www-data /var/www/html/nextcloud
Step 6: Configure Apache for Nextcloud
Create a new configuration file for Nextcloud:
sudo nano /etc/apache2/sites-available/nextcloud.conf
Add the following configuration:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/nextcloud
ServerName your_domain.com
<Directory /var/www/html/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable the Nextcloud site and required modules:
sudo a2ensite nextcloud.conf
sudo a2enmod rewrite headers env dir mime
Restart Apache:
sudo systemctl restart apache2
Step 7: Secure Nextcloud with Let's Encrypt SSL
To secure your Nextcloud instance, install Certbot for Let's Encrypt SSL:
sudo apt install certbot python3-certbot-apache
Run the following command to obtain and install the SSL certificate:
sudo certbot --apache
Follow the on-screen instructions to complete the installation of the SSL certificate.
Step 8: Access Nextcloud
Once the installation is complete, you can access your Nextcloud instance by visiting https://your_domain.com
in your web browser and following the setup instructions.
Conclusion
You have successfully installed Nextcloud with Apache and secured it using Let's Encrypt SSL on Ubuntu 22.04 LTS.
If you're looking for a reliable VPS hosting solution to run your Nextcloud instance, consider using Windows VPS UK. Windows VPS offers great flexibility and performance, perfect for hosting your cloud applications. With options like VPS UK Windows and Windows Virtual Private Servers, you can find a solution that fits your needs.
For larger scale or more demanding projects, consider a Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're looking for Windows VPS Italy or UK VPS Windows, you can trust Windows VPS Hosting UK for reliable and scalable hosting solutions tailored to your business.
Visit Windows VPS UK today to explore hosting options and find the perfect Windows VPS for your Nextcloud deployment.