{"id":1330,"date":"2019-01-10T21:31:20","date_gmt":"2019-01-10T21:31:20","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=1330"},"modified":"2021-11-14T20:37:12","modified_gmt":"2021-11-14T20:37:12","slug":"install-nextcloud-nginx-ubuntu","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/","title":{"rendered":"How to Install NextCloud with Nginx, PHP7.3 &#038; Let&#8217;s Encrypt Free SSL\/TLS Certificates on Ubuntu 18.04 Server"},"content":{"rendered":"<p>In this tutorial we&#8217;ll be installing the latest version of NextCloud (<strong>15<\/strong> at the time of writing) on an Ubuntu 18.04 server, with <strong>Nginx<\/strong> and <strong>PHP7.3<\/strong>. We&#8217;ll also secure our NextCloud installation with free SSL\/TLS certificates provided by Let&#8217;s Encrypt.<\/p>\n<p>NextCloud is a free and open-source self-hosted cloud storage solution, that&#8217;s a fork of <a href=\"https:\/\/owncloud.org\/\" target=\"_blank\" rel=\"noopener\">ownCloud<\/a>. Not only is NextCloud a free and great alternative to many of the paid cloud storage services. It not only features file storage, but also <strong>calendar and contacts<\/strong>, <a href=\"https:\/\/nextcloud.com\/talk\" target=\"_blank\" rel=\"noopener\">secure video and audio calls<\/a>, <a href=\"https:\/\/nextcloud.com\/blog\/nextcloud-introduces-easy-website-builder-for-education-edition-with-picocms\/\" target=\"_blank\" rel=\"noopener\">website creation and hosting<\/a> and <a href=\"https:\/\/nextcloud.com\/collaboraonline\" target=\"_blank\" rel=\"noopener\">collaborative document viewing and editing<\/a>.<\/p>\n<p>Having said that, let&#8217;s get to installing it.<\/p>\n\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<p>Before installing NextCloud, do consider that we assume the following:<\/p>\n<ul>\n<li>You&#8217;re have a local machine remote server running Ubuntu 18.04<\/li>\n<li>You are acting as a <code>non-root sudo user<\/code>. While this is not absolutely necessary, we do recommend it. If you don&#8217;t have one set up, you can follow our <a href=\"https:\/\/draculaservers.com\/tutorials\/create-sudo-user-ubuntu\/\" target=\"_blank\" rel=\"noopener\">tutorial on setting up sudo users on Ubuntu 18.04<\/a><\/li>\n<li>You have LEMP Stack installed on your Ubuntu 18.04 machine. It you do not have it set up, you can follow our tutorial <a href=\"https:\/\/draculaservers.com\/tutorials\/install-linux-nginx-mariadb-php-lemp-stack-on-an-ubuntu-18-04-vps\/\" target=\"_blank\" rel=\"noopener\">Install Linux, Nginx, MariaDB &amp; PHP7.3 (LEMP Stack) on an Ubuntu 18.04 VPS<\/a><\/li>\n<\/ul>\n<div class=\"container custom-content-block\" style=\"background-color: #282a36; border-radius: 3px; padding: 20px 25px 35px 25px !important; margin-top: 60px; margin-bottom: 60px;\">\r\n<div class=\"row\">\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #74fa7a; font-weight: bold !important; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Get a High RAM VPS at Entry-level Pricing<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #ffffff; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Starting with 2GB RAM at $6.99\/month<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #60709f; font-size: 1em; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Take your pick from our KVM VPS that offer a generous amount of RAM at an affordable price. We've got 5 plans for you to choose from, our cheapest featuring 2GB RAM at $6.99\/mo.<\/p>\r\n\r\n<div style=\"font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important; font-size: 14px; color: #74fa7a;\"><span style=\"color: #ffffff;\">[Main Features]<\/span>\r\n- SSD Drives\r\n- KVM Virtualization\r\n- 1Gbps Shared Uplink\r\n- Location: Chicago, IL<\/div>\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #ffffff; font-weight: bold !important; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Pick one of our KVM plans<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\"><a class=\"btn btn-primary btn-lg\" style=\"background-color: #58689e; color: #ffffff; box-shadow: 0 2px 2px 0 #3F51B5, 0 3px 1px -2px #3F51B5, 0 1px 5px 0 #3F51B5; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important; font-weight: bold !important;\" role=\"button\" href=\"https:\/\/draculaservers.com\/kvm.php#choose-plan\" target=\"_blank\" rel=\"noopener\" aria-pressed=\"true\">Get started now<\/a><\/div>\r\n<\/div>\r\n<\/div>\n<p>Having those requirements fulfilled, we can proceed to going through the steps of installing the latest version of NextCloud. At the time of writing, the latest version is NextCloud 15.<\/p>\n<h2 id=\"step-1-download-nextcloud-15-on-ubuntu-18-04\">Step 1 \u2013 Download NextCloud 15 on Ubuntu 18.04<\/h2>\n<p>To download NextCloud 15 on your Ubuntu 18.04 server, change into the <code>\/tmp<\/code> folder, to keep things clean, and use <code>wget<\/code> to download the archive:<\/p>\n<pre><code>$ cd \/tmp\n$ wget https:\/\/download.nextcloud.com\/server\/releases\/nextcloud-15.0.0.zip<\/code><\/pre>\n<blockquote class=\"note\"><p><small><strong>NOTE: <\/strong> At the time of writing, the latest version is <strong>NextCloud 15<\/strong>. To download the latest version go to <a href=\"https:\/\/nextcloud.com\/install\/#instructions-server\" target=\"_blank\" rel=\"noopener\">https:\/\/nextcloud.com\/install\/#instructions-server<\/a> and retrieve the download link for NextCloud.<\/small><\/p><\/blockquote>\n<p>With the archive downloaded, now unzip it. We&#8217;ll also attempt to install <code>unzip<\/code>, in case you don&#8217;t have it installed already. The <code>-d<\/code> switch specifies the target directory, so the archive will be extracted in <code>\/var\/www\/html\/nextcloud<\/code>:<\/p>\n<pre><code>$ sudo apt install unzip\n$ sudo unzip nextcloud-15.0.0.zip -d \/var\/www\/html<\/code><\/pre>\n<p>Now we&#8217;ll have to change the owner of <code>\/var\/www\/html\/nextcloud<\/code> so that Nginx can write to it:<\/p>\n<pre><code>$ sudo chown www-data:www-data \/var\/www\/html\/nextcloud -R<\/code><\/pre>\n<h2 id=\"step-2-install-php-require-modules\">Step 2 \u2013 Install PHP Require Modules<\/h2>\n<p>NextCloud requires additional PHP modules. To install them, run the following command:<\/p>\n<pre><code>$ sudo apt install php-imagick php7.3-common php7.3-gd php7.3-json php7.3-curl php7.3-zip php7.3-xml php7.3-mbstring php7.3-bz2 php7.3-intl<\/code><\/pre>\n<h2 id=\"step-3-create-user-database-for-nextcloud\">Step 3 \u2013 Create User &amp; Database for NextCloud<\/h2>\n<p>NextCloud will need a database and a user to access it. To create them, first log into MariaDB. Since <code>MariaDB<\/code> now uses the <code>unix_socket<\/code> authentication plugin for login, you don&#8217;t need to enter the <code>root<\/code> password:<\/p>\n<pre><code>$ sudo mariadb<\/code><\/pre>\n<blockquote class=\"note\"><p><small><strong>NOTE: <\/strong> If you&#8217;re using <code>MySQL<\/code> then just use <code>sudo mysql<\/code> <\/small><\/p><\/blockquote>\n<p>Now you should be logged in.<\/p>\n<p>Next, create a database for NextCloud. You can name it whatever you want, but in this tutorial we&#8217;ll name it <code>nextcloud_db<\/code>. To create the database, run the following command:<\/p>\n<pre><code>create database nextcloud_db;<\/code><\/pre>\n<p>Create the database user and give it a password. Name it whatever you&#8217;d like and give it what password you prefer, but in this tutorial we&#8217;ll call it <code>nextcloud_user<\/code> and assign it the password <code>_C@stl3br@n<\/code>:<\/p>\n<pre><code>create user nextcloud_user@localhost identified by '_C@stl3br@n';<\/code><\/pre>\n<p>Grant all privileges to <code>nextcloud_user<\/code> to <code>nextcloud_db<\/code>:<\/p>\n<pre><code>grant all privileges on nextcloud_db.* to nextcloud_user@localhost identified by '_C@stl3br@n';<\/code><\/pre>\n<p>Finally flush privileges and exit:<\/p>\n<pre><code>flush privileges;<\/code><\/pre>\n<pre><code>exit;<\/code><\/pre>\n<h2 id=\"step-4-configure-nginx-for-nextcloud\">Step 4 \u2013 Configure Nginx for NextCloud<\/h2>\n<p>Next, we&#8217;ll create the configuration file to serve NextCloud.<\/p>\n<p>First, use your favorite text editor to open a file in <code>\/etc\/nginx\/sites-available\/<\/code>. I prefer to name it <code>nextcloud<\/code> , but you can name it whatever you want:<\/p>\n<pre><code>$ sudo nano \/etc\/nginx\/sites-available<\/code><\/pre>\n<p>Now add the following contents, replacing <code>nextcloud.dracula.host<\/code> with your own domain\/subdomain. Additionally, please don&#8217;t forget to set an A record for your chosen domain to point at your server.<\/p>\n<pre><code>server {\n    listen 80;\n    server_name nextcloud.dracula.host;\n\n    # Add headers to serve security related headers\n    add_header X-Content-Type-Options nosniff;\n    add_header X-XSS-Protection \"1; mode=block\";\n    add_header X-Robots-Tag none;\n    add_header X-Download-Options noopen;\n    add_header X-Permitted-Cross-Domain-Policies none;\n\n    #This header is already set in PHP, so it is commented out here.\n    #add_header X-Frame-Options \"SAMEORIGIN\";\n\n    # Path to the root of your installation\n    root \/var\/www\/html\/nextcloud\/;\n\n    location = \/robots.txt {\n        allow all;\n        log_not_found off;\n        access_log off;\n    }\n\n    # The following 2 rules are only needed for the user_webfinger app.\n    # Uncomment it if you're planning to use this app.\n    #rewrite ^\/.well-known\/host-meta \/public.php?service=host-meta last;\n    #rewrite ^\/.well-known\/host-meta.json \/public.php?service=host-meta-json\n    # last;\n\n    location = \/.well-known\/carddav {\n        return 301 $scheme:\/\/$host\/remote.php\/dav;\n    }\n    location = \/.well-known\/caldav {\n       return 301 $scheme:\/\/$host\/remote.php\/dav;\n    }\n\n    location ~ \/.well-known\/acme-challenge {\n      allow all;\n    }\n\n    # set max upload size\n    client_max_body_size 512M;\n    fastcgi_buffers 64 4K;\n\n    # Disable gzip to avoid the removal of the ETag header\n    gzip off;\n\n    # Uncomment if your server is build with the ngx_pagespeed module\n    # This module is currently not supported.\n    #pagespeed off;\n\n    error_page 403 \/core\/templates\/403.php;\n    error_page 404 \/core\/templates\/404.php;\n\n    location \/ {\n       rewrite ^ \/index.php$uri;\n    }\n\n    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {\n       deny all;\n    }\n    location ~ ^\/(?:\\.|autotest|occ|issue|indie|db_|console) {\n       deny all;\n     }\n\n    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|core\/templates\/40[34])\\.php(?:$|\/) {\n       include fastcgi_params;\n       fastcgi_split_path_info ^(.+\\.php)(\/.*)$;\n       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n       fastcgi_param PATH_INFO $fastcgi_path_info;\n       #Avoid sending the security headers twice\n       fastcgi_param modHeadersAvailable true;\n       fastcgi_param front_controller_active true;\n       fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n       fastcgi_intercept_errors on;\n       fastcgi_request_buffering off;\n    }\n\n    location ~ ^\/(?:updater|ocs-provider)(?:$|\/) {\n       try_files $uri\/ =404;\n       index index.php;\n    }\n\n    # Adding the cache control header for js and css files\n    # Make sure it is BELOW the PHP block\n    location ~* \\.(?:css|js)$ {\n        try_files $uri \/index.php$uri$is_args$args;\n        add_header Cache-Control \"public, max-age=7200\";\n        # Add headers to serve security related headers (It is intended to\n        # have those duplicated to the ones above)\n        add_header X-Content-Type-Options nosniff;\n        add_header X-XSS-Protection \"1; mode=block\";\n        add_header X-Robots-Tag none;\n        add_header X-Download-Options noopen;\n        add_header X-Permitted-Cross-Domain-Policies none;\n        # Optional: Don't log access to assets\n        access_log off;\n   }\n\n   location ~* \\.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {\n        try_files $uri \/index.php$uri$is_args$args;\n        # Optional: Don't log access to other assets\n        access_log off;\n   }\n}<\/code><\/pre>\n<blockquote class=\"note\"><p><small><strong>NOTE:<\/strong> If you had chosen a different location for NextCloud, then you should also adjust the <strong>path to the root of your installation<\/strong> in this file. Basically replace <code>\/var\/www\/html\/nextcloud\/<\/code> with where you installed NextCloud.<\/small><\/p><\/blockquote>\n<p>Save and close the file when you&#8217;re done.<\/p>\n<p>After configuring the <code>server block<\/code> above, enable it by creating a symbolic link of it into <code>\/etc\/nginx\/sites-enabled\/<\/code> using the following command:<\/p>\n<pre><code>$ sudo ln -s \/etc\/nginx\/sites-available\/nextcloud \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Test the Nginx configuration to be sure everything is in order and reload Nginx for the changes to take effect:<\/p>\n<pre><code>$ sudo nginx -t\n$ sudo systemctl reload nginx<\/code><\/pre>\n<h2 id=\"step-5-enable-ssl-for-nextcloud\">Step 5 \u2013 Enable SSL for NextCloud<\/h2>\n<p>At this point you&#8217;ve installed NextCloud on your Ubuntu 18.04 server, but the connection is not secure.<\/p>\n<p>If you visit the domain for your NextCloud installation and you&#8217;ll be greeted by the install wizard, but you&#8217;ll notice the your browser saying your connection isn&#8217;t secure:<\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1473\" height=\"998\" class=\"aligncenter size-full wp-image-1347\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured.jpg\" alt=\"nextcloud_not_secured\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured.jpg 1473w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured-300x203.jpg 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured-1024x694.jpg 1024w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_not_secured-768x520.jpg 768w\" sizes=\"auto, (max-width: 1473px) 100vw, 1473px\" \/><\/a><\/p>\n<p>For this reason, let&#8217;s go through one last step before finalizing the installation.<\/p>\n<p>We can obtain free SSL\/TLS certificates using Let&#8217;s Encrypt. We can easily do this by using the client provided by Let&#8217;s Encrypt, called <code>certbot<\/code>. You can install <code>certbot<\/code> on Ubuntu 18.04 by running the following command:<\/p>\n<pre><code>$ sudo apt install certbot python3-certbot-nginx<\/code><\/pre>\n<p>That command installed <code>certbot<\/code> along with the Nginx plugin <code>python3-certbot-nginx<\/code>.<\/p>\n<p>To obtain a free SSL\/TLS certificate from Let&#8217;s Encrypt for our domain, run the following command, replacing the <strong>EMAIL<\/strong> and <strong>DOMAIN<\/strong> with your own:<\/p>\n<pre><code>$ sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email hello@dracula.host -d nextcloud.your-domain.com<\/code><\/pre>\n<p>Option explanation:<\/p>\n<p><code>--nginx<\/code> &#8211; Use the <strong>Nginx<\/strong> authenticator and installer<\/p>\n<p><code>--agree-tos<\/code> &#8211; Agree to the Terms of Service<\/p>\n<p><code>--redirect<\/code> &#8211; Enable 301 redirection from <code>http:\/\/<\/code> to <code>https:\/\/<\/code><\/p>\n<p><code>--hsts<\/code> &#8211; <strong>HTTP Strict Transport Security<\/strong> tells the browser to never request content from your site using HTTP<\/p>\n<p><code>--staple-ocsp<\/code> &#8211; Enable <a href=\"https:\/\/en.wikipedia.org\/wiki\/Online_Certificate_Status_Protocol\" target=\"_blank\" rel=\"noopener\">Online Certificate Status Protocol<\/a> (OCSP) stapling, which is a safe and quick way of determining if an SSL certificate is valid or not.<\/p>\n<p><code>--email<\/code> &#8211; Your email where you&#8217;ll receive emails regarding the status of your certificate, and if you want you can also receive updates from the <a href=\"https:\/\/www.eff.org\/\" target=\"_blank\" rel=\"noopener\">Electronic Frontier Foundation<\/a><\/p>\n<p><code>-d<\/code> &#8211; The domain for which you&#8217;re requesting the certificate. You can add up to 100 domains after it.<\/p>\n<p>After running the command you&#8217;ll be asked if you&#8217;d like to received emails from the Electronic Frontier Foundation.<\/p>\n<pre><code>-------------------------------------------------------------------------------\nWould you be willing to share your email address with the Electronic Frontier\nFoundation, a founding partner of the Let's Encrypt project and the non-profit\norganization that develops Certbot? We'd like to send you email about EFF and\nour work to encrypt the web, protect its users and defend digital rights.\n-------------------------------------------------------------------------------<\/code><\/pre>\n<p>Whether you say <code>Y<\/code> or <code>N<\/code> your certificate will be obtained and configured for you.<\/p>\n<pre><code>Obtaining a new certificate\nPerforming the following challenges:\nhttp-01 challenge for nextcloud.dracula.host\nWaiting for verification...\nCleaning up challenges\nDeploying Certificate to VirtualHost \/etc\/nginx\/sites-enabled\/nextcloud\n\nFailed ensure-http-header for nextcloud.dracula.host\nUnable to set enhancement ensure-http-header for nextcloud.dracula.host\n\nProblem in \/etc\/nginx\/sites-enabled\/nextcloud: tried to insert directive \"['add_header', 'Strict-Transport-Security', '\"max-age=31536000\"', 'always']\" but found conflicting \"['add_header', 'X-Content-Type-Options', 'nosniff']\".\n\nIMPORTANT NOTES:\n - We were unable to set up enhancement ensure-http-header for your\n   server, however, we successfully installed your certificate.\n - Congratulations! Your certificate and chain have been saved at:\n   \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/fullchain.pem\n   Your key file has been saved at:\n   \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/privkey.pem\n   Your cert will expire on 2019-04-10. To obtain a new or tweaked\n   version of this certificate in the future, simply run certbot again\n   with the \"certonly\" option. To non-interactively renew *all* of\n   your certificates, run \"certbot renew\"\n - Your account credentials have been saved in your Certbot\n   configuration directory at \/etc\/letsencrypt. You should make a\n   secure backup of this folder now. This configuration directory will\n   also contain certificates and private keys obtained by Certbot so\n   making regular backups of this folder is ideal.<\/code><\/pre>\n<p>Since are Nginx configuration file is a little too customized from the standard one, <code>certbot<\/code> didn&#8217;t know how to configure <strong>redirection<\/strong> (<code>--redirect<\/code>) and add the <strong>HTTP Strict Transport Security<\/strong> headers (<code>--hsts<\/code>), but we can easily do that ourselves.<\/p>\n<h3 id=\"enable-https-and-hsts\">Enable HTTPS and HSTS<\/h3>\n<p>To do this, we&#8217;ll have to edit our <strong>Nginx configuration file<\/strong> for NextCloud, that we created earlier, <code>\/etc\/nginx\/sites-available\/nextcloud<\/code>.<\/p>\n<p>Open it up using your favorite text editor:<\/p>\n<pre><code>$ sudo nano \/etc\/nginx\/sites-available\/nextcloud<\/code><\/pre>\n<p><strong>Next, make the following edits:<\/strong><\/p>\n<ol>\n<li>First of all, we&#8217;ll have to configure <strong>redirecting from http to https<\/strong>. To do this, we&#8217;ll simply add the following block at the top of the file. <strong>Be sure to replace my domain with yours<\/strong>:\n<pre><code>server {\n    listen 80;\n    server_name nextcloud.dracula.host;\n    return 301 https:\/\/nextcloud.dracula.host$request_uri;\n}<\/code><\/pre>\n<p>What we&#8217;re telling Nginx to do, is whenever someone visites <code>http:\/\/nextcloud.dracula.host<\/code>, to redirect it permanently to <code>https:\/\/nextcloud.dracula.host<\/code>.<\/li>\n<li>Now, in the existing server block, if you scroll all the way to the bottom of the server block, you&#8217;ll see a few lines added by <code>certbot<\/code>, that look something like this:\n<pre><code>listen 443 ssl;\nssl_certificate \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/fullchain.pem; # managed by Certbot\nssl_certificate_key \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/privkey.pem; # managed by Certbot\ninclude \/etc\/letsencrypt\/options-ssl-nginx.conf; # managed by Certbot\nssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem; # managed by Certbot<\/code><\/pre>\n<p>To keep things tidy, cut them from there, and move them to the top of the server block, right after <code>server {<\/code>.<\/li>\n<li>Additionally, under <code># Add headers to serve security related headers<\/code>, you can add the <code>--hsts<\/code> header that <code>certbot<\/code> failed to add:\n<pre><code>add_header Strict-Transport-Security \"max-age=31536000\" always;<\/code><\/pre>\n<\/li>\n<li>Lastly, change <code>listen 443 ssl;<\/code> to <code>listen 443 ssl http2<\/code> to enable HTTP\/2.<\/li>\n<\/ol>\n<p><strong>In case the last few instructions are confusing<\/strong>, here&#8217;s how you&#8217;ll want the file to look, <strong>replacing <code>dracula.host<\/code><\/strong> with your own domain, and replacing <code>\/var\/www\/html\/nextcloud\/<\/code> in case you changed the path to your NextCloud installation.<\/p>\n<pre><code>server {\n    listen 80;\n    server_name nextcloud.dracula.host;\n    return 301 https:\/\/nextcloud.dracula.host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2; # managed by Certbot\n    ssl_certificate \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/fullchain.pem; # managed by Certbot\n    ssl_certificate_key \/etc\/letsencrypt\/live\/nextcloud.dracula.host\/privkey.pem; # managed by Certbot\n    include \/etc\/letsencrypt\/options-ssl-nginx.conf; # managed by Certbot\n    ssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem; # managed by Certbot\n\n    server_name nextcloud.dracula.host;\n\n    # Add headers to serve security related headers\n    add_header Strict-Transport-Security \"max-age=31536000\" always;\n    add_header X-Content-Type-Options nosniff;\n    add_header X-XSS-Protection \"1; mode=block\";\n    add_header X-Robots-Tag none;\n    add_header X-Download-Options noopen;\n    add_header X-Permitted-Cross-Domain-Policies none;\n\n    #This header is already set in PHP, so it is commented out here.\n    #add_header X-Frame-Options \"SAMEORIGIN\";\n\n    # Path to the root of your installation\n    root \/var\/www\/html\/nextcloud\/;\n\n    location = \/robots.txt {\n        allow all;\n        log_not_found off;\n        access_log off;\n    }\n\n    # The following 2 rules are only needed for the user_webfinger app.\n    # Uncomment it if you're planning to use this app.\n    #rewrite ^\/.well-known\/host-meta \/public.php?service=host-meta last;\n    #rewrite ^\/.well-known\/host-meta.json \/public.php?service=host-meta-json\n    # last;\n\n    location = \/.well-known\/carddav {\n        return 301 $scheme:\/\/$host\/remote.php\/dav;\n    }\n    location = \/.well-known\/caldav {\n       return 301 $scheme:\/\/$host\/remote.php\/dav;\n    }\n\n    location ~ \/.well-known\/acme-challenge {\n      allow all;\n    }\n\n    # set max upload size\n    client_max_body_size 512M;\n    fastcgi_buffers 64 4K;\n\n    # Disable gzip to avoid the removal of the ETag header\n    gzip off;\n\n    # Uncomment if your server is build with the ngx_pagespeed module\n    # This module is currently not supported.\n    #pagespeed off;\n\n    error_page 403 \/core\/templates\/403.php;\n    error_page 404 \/core\/templates\/404.php;\n\n    location \/ {\n       rewrite ^ \/index.php$uri;\n    }\n\n    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {\n       deny all;\n    }\n    location ~ ^\/(?:\\.|autotest|occ|issue|indie|db_|console) {\n       deny all;\n     }\n\n    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|core\/templates\/40[34])\\.php(?:$|\/) {\n       include fastcgi_params;\n       fastcgi_split_path_info ^(.+\\.php)(\/.*)$;\n       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n       fastcgi_param PATH_INFO $fastcgi_path_info;\n       #Avoid sending the security headers twice\n       fastcgi_param modHeadersAvailable true;\n       fastcgi_param front_controller_active true;\n       fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n       fastcgi_intercept_errors on;\n       fastcgi_request_buffering off;\n    }\n\n    location ~ ^\/(?:updater|ocs-provider)(?:$|\/) {\n       try_files $uri\/ =404;\n       index index.php;\n    }\n\n    # Adding the cache control header for js and css files\n    # Make sure it is BELOW the PHP block\n    location ~* \\.(?:css|js)$ {\n        try_files $uri \/index.php$uri$is_args$args;\n        add_header Cache-Control \"public, max-age=7200\";\n        # Add headers to serve security related headers (It is intended to\n        # have those duplicated to the ones above)\n        add_header X-Content-Type-Options nosniff;\n        add_header X-XSS-Protection \"1; mode=block\";\n        add_header X-Robots-Tag none;\n        add_header X-Download-Options noopen;\n        add_header X-Permitted-Cross-Domain-Policies none;\n        # Optional: Don't log access to assets\n        access_log off;\n   }\n\n   location ~* \\.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {\n        try_files $uri \/index.php$uri$is_args$args;\n        # Optional: Don't log access to other assets\n        access_log off;\n   }\n\n}<\/code><\/pre>\n<p>When you&#8217;re done save and close the file.<\/p>\n<p>Now test Nginx to be sure everything is OK and there are no conflicts and then reload Nginx for the changes to take effect:<\/p>\n<pre><code>$ sudo nginx -t\n$ sudo systemctl reload nginx<\/code><\/pre>\n<p>Now visit your NextCloud domain and you should see that it&#8217;s a secured:<\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1474\" height=\"455\" class=\"aligncenter size-full wp-image-1349\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud.png\" alt=\"ssl_setup_nextcloud\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud.png 1474w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud-300x93.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud-1024x316.png 1024w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/ssl_setup_nextcloud-768x237.png 768w\" sizes=\"auto, (max-width: 1474px) 100vw, 1474px\" \/><\/a><\/p>\n<p>Additionally, you can check how well we configured SSL, by <a href=\"https:\/\/www.ssllabs.com\/ssltest\/index.html\" target=\"_blank\" rel=\"noopener\">testing your domain at SSLabs<\/a>.<\/p>\n<p>You should get an <code>A+<\/code>:<\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"538\" class=\"aligncenter size-full wp-image-1348\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a.png\" alt=\"nextcloud_sslabs_ssl_test_a+\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a.png 1099w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a-300x147.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a-1024x501.png 1024w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_sslabs_ssl_test_a-768x376.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/a><\/p>\n<h2 id=\"step-6-complete-nextcloud-installation\">Step 6 \u2013 Complete NextCloud Installation<\/h2>\n<p>Now we&#8217;ve got everything set up to finish installing NextCloud.<\/p>\n<p>Visit your NextCloud domain in your browser and you should be presented with a for to fill:<\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1469\" height=\"1011\" class=\"aligncenter size-full wp-image-1350\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard.jpg\" alt=\"nextcloud_wizard\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard.jpg 1469w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard-300x206.jpg 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard-1024x705.jpg 1024w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/nextcloud_wizard-768x529.jpg 768w\" sizes=\"auto, (max-width: 1469px) 100vw, 1469px\" \/><\/a><\/p>\n<p>Here&#8217;s what to do next:<\/p>\n<p><strong>Create an admin account<\/strong><\/p>\n<p>Here you enter your desired <code>user<\/code> and <code>password<\/code>. Be sure to use a strong password, for security reasons.<\/p>\n<p><strong>Data folder<\/strong><\/p>\n<p>This is where data will be stored. It is considered good practice to set the data directory outside of the NextCloud root directory.<\/p>\n<p>As such, we can create a different directory such as <code>\/var\/www\/html\/nextcloud-data<\/code>:<\/p>\n<pre><code>$ sudo mkdir \/var\/www\/html\/nextcloud-data<\/code><\/pre>\n<p>We then have to make sure that we change the owner so Nginx can write to the folder:<\/p>\n<pre><code>$ sudo chown www-data:www-data \/var\/www\/html\/nextcloud-data -R<\/code><\/pre>\n<p>Now you can fill in <code>\/var\/www\/html\/nextcloud-data<\/code> in the <strong>Data folder<\/strong> field in the installation form.<\/p>\n<p><strong>Configure the database<\/strong><\/p>\n<p>Here&#8217;s where you&#8217;ll fill in your database user, password, and database name, that you created earlier.<\/p>\n<p>If you created the database on the server on which you installed NextCloud, then leave <code>localhost<\/code>, otherwise, if you&#8217;re keeping the database on a different server, replace <code>localhost<\/code> with the remote database.<\/p>\n<p>Finally, you can click on <strong>Finish setup<\/strong> and you&#8217;re done!<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Well done. Hopefully, you&#8217;ve succeeded in installing NextCloud on your Ubuntu 18.04 server with Nginx, PHP7.3 and Let&#8217;s Encrypt SSL\/TLS free certificates, and you now have your own elegant Dropbox solution.<\/p>\n<p>If you&#8217;ve encountered any issues, feel free to let us know in the comment section or by contacting us via email or social media.<\/p>\n<div class=\"container custom-content-block\" style=\"background-color: #282a36; border-radius: 3px; padding: 20px 25px 35px 25px !important; margin-top: 60px; margin-bottom: 60px;\">\r\n<div class=\"row\">\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #74fa7a; font-weight: bold !important; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Get a High RAM VPS at Entry-level Pricing<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #ffffff; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Starting with 2GB RAM at $6.99\/month<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #60709f; font-size: 1em; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Take your pick from our KVM VPS that offer a generous amount of RAM at an affordable price. We've got 5 plans for you to choose from, our cheapest featuring 2GB RAM at $6.99\/mo.<\/p>\r\n\r\n<div style=\"font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important; font-size: 14px; color: #74fa7a;\"><span style=\"color: #ffffff;\">[Main Features]<\/span>\r\n- SSD Drives\r\n- KVM Virtualization\r\n- 1Gbps Shared Uplink\r\n- Location: Chicago, IL<\/div>\r\n<\/div>\r\n<div class=\"col-lg-12\">\r\n<p style=\"color: #ffffff; font-weight: bold !important; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important;\">Pick one of our KVM plans<\/p>\r\n\r\n<\/div>\r\n<div class=\"col-lg-12\"><a class=\"btn btn-primary btn-lg\" style=\"background-color: #58689e; color: #ffffff; box-shadow: 0 2px 2px 0 #3F51B5, 0 3px 1px -2px #3F51B5, 0 1px 5px 0 #3F51B5; font-family: Droid Sans Mono,'DroidSansMonoRegular','Courier New',monospace !important; font-weight: bold !important;\" role=\"button\" href=\"https:\/\/draculaservers.com\/kvm.php#choose-plan\" target=\"_blank\" rel=\"noopener\" aria-pressed=\"true\">Get started now<\/a><\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we&#8217;ll be installing the latest version of NextCloud (15 at the time of writing) on an Ubuntu 18.04 server, with Nginx and PHP7.3. We&#8217;ll also secure our NextCloud installation with free SSL\/TLS certificates provided by Let&#8217;s Encrypt. NextCloud is a free and open-source self-hosted cloud storage solution, that&#8217;s a fork of ownCloud. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1354,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,22],"tags":[38,77,15,78,34],"class_list":["post-1330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source","category-ubuntu","tag-lets-encrypt","tag-nextcloud","tag-nginx","tag-storage","tag-ubuntu"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png",1024,512,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04-300x150.png",300,150,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04-768x384.png",768,384,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png",1024,512,false],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png",1024,512,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png",1024,512,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>In this tutorial we&#8217;ll be installing the latest version of NextCloud (15 at the time of writing) on an Ubuntu 18.04 server, with Nginx and PHP7.3. We&#8217;ll also secure our NextCloud installation with free SSL\/TLS certificates provided by Let&#8217;s Encrypt. NextCloud is a free and open-source self-hosted cloud storage solution, that&#8217;s a fork of ownCloud. Not only is NextCloud a free and great alternative to many of the paid cloud storage services. It not only features file storage, but also calendar and contacts, secure video and audio calls, website creation and hosting and collaborative document viewing and editing. Having said&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/open-source\/\" rel=\"category tag\">Open-source<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/ubuntu\/\" rel=\"category tag\">Ubuntu<\/a>","author_info_v2":{"name":"Vlad","url":"https:\/\/draculaservers.com\/tutorials\/author\/vlad\/"},"comments_num_v2":"1 comment","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install NextCloud with Nginx, PHP7.3 &amp; TLS\/SSL on Ubuntu 18.04<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install NextCloud with Nginx, PHP7.3 &amp; TLS\/SSL on Ubuntu 18.04\" \/>\n<meta property=\"og:description\" content=\"In this tutorial we&#8217;ll be installing the latest version of NextCloud (15 at the time of writing) on an Ubuntu 18.04 server, with Nginx and PHP7.3. We&#8217;ll also secure our NextCloud installation with free SSL\/TLS certificates provided by Let&#8217;s Encrypt. NextCloud is a free and open-source self-hosted cloud storage solution, that&#8217;s a fork of ownCloud. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-10T21:31:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-14T20:37:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vlad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vlad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/\"},\"author\":{\"name\":\"Vlad\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\"},\"headline\":\"How to Install NextCloud with Nginx, PHP7.3 &#038; Let&#8217;s Encrypt Free SSL\\\/TLS Certificates on Ubuntu 18.04 Server\",\"datePublished\":\"2019-01-10T21:31:20+00:00\",\"dateModified\":\"2021-11-14T20:37:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/\"},\"wordCount\":1437,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png\",\"keywords\":[\"Let's Encrypt\",\"NextCloud\",\"nginx\",\"Storage\",\"Ubuntu\"],\"articleSection\":[\"Open-source\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/\",\"name\":\"How to Install NextCloud with Nginx, PHP7.3 & TLS\\\/SSL on Ubuntu 18.04\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png\",\"datePublished\":\"2019-01-10T21:31:20+00:00\",\"dateModified\":\"2021-11-14T20:37:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png\",\"width\":1024,\"height\":512,\"caption\":\"install_nextcloud_nginx_ubuntu\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nextcloud-nginx-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install NextCloud with Nginx, PHP7.3 &#038; Let&#8217;s Encrypt Free SSL\\\/TLS Certificates on Ubuntu 18.04 Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\",\"name\":\"Vlad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"caption\":\"Vlad\"},\"description\":\"Tech Support\",\"sameAs\":[\"https:\\\/\\\/draculaservers.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install NextCloud with Nginx, PHP7.3 & TLS\/SSL on Ubuntu 18.04","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install NextCloud with Nginx, PHP7.3 & TLS\/SSL on Ubuntu 18.04","og_description":"In this tutorial we&#8217;ll be installing the latest version of NextCloud (15 at the time of writing) on an Ubuntu 18.04 server, with Nginx and PHP7.3. We&#8217;ll also secure our NextCloud installation with free SSL\/TLS certificates provided by Let&#8217;s Encrypt. NextCloud is a free and open-source self-hosted cloud storage solution, that&#8217;s a fork of ownCloud. [&hellip;]","og_url":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2019-01-10T21:31:20+00:00","article_modified_time":"2021-11-14T20:37:12+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png","type":"image\/png"}],"author":"Vlad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vlad","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/"},"author":{"name":"Vlad","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e"},"headline":"How to Install NextCloud with Nginx, PHP7.3 &#038; Let&#8217;s Encrypt Free SSL\/TLS Certificates on Ubuntu 18.04 Server","datePublished":"2019-01-10T21:31:20+00:00","dateModified":"2021-11-14T20:37:12+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/"},"wordCount":1437,"commentCount":1,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png","keywords":["Let's Encrypt","NextCloud","nginx","Storage","Ubuntu"],"articleSection":["Open-source","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/","url":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/","name":"How to Install NextCloud with Nginx, PHP7.3 & TLS\/SSL on Ubuntu 18.04","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png","datePublished":"2019-01-10T21:31:20+00:00","dateModified":"2021-11-14T20:37:12+00:00","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2019\/01\/How-to-Install-Nextcloud-with-Nginx-and-PHP7.3-on-Ubuntu-18.04.png","width":1024,"height":512,"caption":"install_nextcloud_nginx_ubuntu"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/install-nextcloud-nginx-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Install NextCloud with Nginx, PHP7.3 &#038; Let&#8217;s Encrypt Free SSL\/TLS Certificates on Ubuntu 18.04 Server"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e","name":"Vlad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","caption":"Vlad"},"description":"Tech Support","sameAs":["https:\/\/draculaservers.com"]}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1330"}],"version-history":[{"count":2,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1330\/revisions"}],"predecessor-version":[{"id":2156,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1330\/revisions\/2156"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/1354"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}