{"id":3190,"date":"2024-04-29T02:18:06","date_gmt":"2023-06-09T11:51:21","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-nextcloud-with-apache-and-let-039-s-encrypt-ssl-on-ubuntu-22-04-lts","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-nextcloud-with-apache-and-let-039-s-encrypt-ssl-on-ubuntu-22-04-lts\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 Nextcloud with Apache and Let&#039;s Encrypt SSL on Ubuntu 22.04 LTS"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<h1>\u00a0<\/h1>\n<p><strong>Nextcloud<\/strong> 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&#8217;s Encrypt SSL on Ubuntu 22.04 LTS.<\/p>\n<h2>Step 1: Update the System<\/h2>\n<p>Begin by ensuring your system is up-to-date by running the following commands:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n<h2>Step 2: Install Apache Web Server<\/h2>\n<p>Apache is a reliable web server that we will use to serve Nextcloud. To install Apache, run the following command:<\/p>\n<pre><code>sudo apt install apache2<\/code><\/pre>\n<p>Once installed, start and enable Apache:<\/p>\n<pre><code>sudo systemctl start apache2<\/code><\/pre>\n<pre><code>sudo systemctl enable apache2<\/code><\/pre>\n<h2>Step 3: Install PHP and Required Modules<\/h2>\n<p>Nextcloud requires PHP and several additional modules. Install them using the following command:<\/p>\n<pre><code>sudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-curl php-zip php-gd php-intl<\/code><\/pre>\n<h2>Step 4: Install MySQL<\/h2>\n<p>MySQL will serve as the database for Nextcloud. Install MySQL server with the following command:<\/p>\n<pre><code>sudo apt install mysql-server<\/code><\/pre>\n<p>After installation, secure MySQL by running the following:<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>Create a database for Nextcloud:<\/p>\n<pre><code>\r\n    sudo mysql -u root -p\r\n    CREATE DATABASE nextcloud;\r\n    CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password';\r\n    GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';\r\n    FLUSH PRIVILEGES;\r\n    EXIT;\r\n    <\/code><\/pre>\n<h2>Step 5: Download and Install Nextcloud<\/h2>\n<p>Download the latest version of Nextcloud from the official website:<\/p>\n<pre><code>wget https:\/\/download.nextcloud.com\/server\/releases\/latest.tar.bz2<\/code><\/pre>\n<p>Extract the downloaded file and move it to the Apache web root directory:<\/p>\n<pre><code>\r\n    tar -xjf latest.tar.bz2\r\n    sudo mv nextcloud \/var\/www\/html\/\r\n    sudo chown -R www-data:www-data \/var\/www\/html\/nextcloud\r\n    <\/code><\/pre>\n<h2>Step 6: Configure Apache for Nextcloud<\/h2>\n<p>Create a new configuration file for Nextcloud:<\/p>\n<pre><code>sudo nano \/etc\/apache2\/sites-available\/nextcloud.conf<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\n    &lt;VirtualHost *:80&gt;\r\n        ServerAdmin admin@example.com\r\n        DocumentRoot \/var\/www\/html\/nextcloud\r\n        ServerName your_domain.com\r\n\r\n        &lt;Directory \/var\/www\/html\/nextcloud\/&gt;\r\n            Require all granted\r\n            AllowOverride All\r\n            Options FollowSymLinks MultiViews\r\n        &lt;\/Directory&gt;\r\n\r\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n    &lt;\/VirtualHost&gt;\r\n    <\/code><\/pre>\n<p>Enable the Nextcloud site and required modules:<\/p>\n<pre><code>sudo a2ensite nextcloud.conf<\/code><\/pre>\n<pre><code>sudo a2enmod rewrite headers env dir mime<\/code><\/pre>\n<p>Restart Apache:<\/p>\n<pre><code>sudo systemctl restart apache2<\/code><\/pre>\n<h2>Step 7: Secure Nextcloud with Let&#8217;s Encrypt SSL<\/h2>\n<p>To secure your Nextcloud instance, install Certbot for Let&#8217;s Encrypt SSL:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-apache<\/code><\/pre>\n<p>Run the following command to obtain and install the SSL certificate:<\/p>\n<pre><code>sudo certbot --apache<\/code><\/pre>\n<p>Follow the on-screen instructions to complete the installation of the SSL certificate.<\/p>\n<h2>Step 8: Access Nextcloud<\/h2>\n<p>Once the installation is complete, you can access your Nextcloud instance by visiting <code>https:\/\/your_domain.com<\/code> in your web browser and following the setup instructions.<\/p>\n<h2>Conclusion<\/h2>\n<p>You have successfully installed Nextcloud with Apache and secured it using Let&#8217;s Encrypt SSL on Ubuntu 22.04 LTS.<\/p>\n<p>If you&#8217;re looking for a reliable VPS hosting solution to run your Nextcloud instance, consider using <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS <\/a>. <strong>Windows VPS<\/strong> offers great flexibility and performance, perfect for hosting your cloud applications. With options like  and <strong>Windows VPSVirtual Private Servers<\/strong>, you can find a solution that fits your needs.<\/p>\n<p>For larger scale or more demanding projects, consider a <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS<\/a> or <strong>Virtual Private Server Hosting Windows<\/strong>. Whether you&#8217;re looking for <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Microsoft SQL VPS Windows<\/a> or <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">UK VPS Windows<\/a>, you can trust <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS Hosting UK<\/a> for reliable and scalable hosting solutions tailored to your business.<\/p>\n<p>Visit <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">Windows VPS <\/a> today to explore hosting options and find the perfect <strong>Windows VPS<\/strong> for your Nextcloud deployment.<\/p>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 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\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-3190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=3190"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3190\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=3190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=3190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=3190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}