{"id":3829,"date":"2023-11-22T15:46:50","date_gmt":"2023-11-22T07:46:50","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3829"},"modified":"2025-12-26T15:39:18","modified_gmt":"2025-12-26T07:39:18","slug":"nextcloud-guide-to-setting-up-server-gigabit","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/nextcloud-guide-to-setting-up-server-gigabit","title":{"rendered":"Guide to Setting up Server Gigabit for Nextcloud"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3830\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-300x169.jpeg\" alt=\"Nextcloud\" width=\"836\" height=\"471\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/aaaaaa-390x219.jpeg 390w\" sizes=\"(max-width: 836px) 100vw, 836px\" \/><\/p>\n<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<p>Nextcloud is a popular self-hosted productivity platform that provides a secure and private way to store, share, and collaborate on files and documents. It is a great alternative to cloud-based services like Dropbox and Google Drive.<\/p>\n<p><a href=\"https:\/\/servergigabit.com\/\">Server Gigabit<\/a> is a fantastic option for hosting Nextcloud, a highly popular open-source productivity platform. This comprehensive tutorial covers every step required to install Nextcloud on your Server Gigabit, equipped with Debian 11 as the operating system and Apache2 serving as a reverse-proxy for the web server.<\/p>\n<h2 data-sourcepos=\"5:1-5:41\"><strong>Installations<\/strong><\/h2>\n<h4 data-sourcepos=\"5:1-5:41\"><strong>What\u2019s Required to Install Nextcloud?<\/strong><\/h4>\n<p data-sourcepos=\"7:1-7:175\">To install Nextcloud, you\u2019ll need a Linux server with root access. For this tutorial, I\u2019m going to deploy Nextcloud on a Server Gigabit with Debian 11 as the operating system.<\/p>\n<p data-sourcepos=\"9:1-9:152\">And for the web server, I\u2019m using Apache2 (it\u2019ll be used as a reverse-proxy). Moreover, it\u2019s required to have a domain already connected to your server.<\/p>\n<p>Firstly, ensure your Server Gigabit is up to date by logging in as root and executing the following command:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt update &amp;&amp; apt upgrade \u2013y<\/code><\/pre>\n<\/div>\n<\/div>\n<h4><strong>Step 1: Installing Necessary Programs<\/strong><\/h4>\n<p>Begin by installing essential programs like Apache2, PHP, and database software with this command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt install apache2 unzip wget curl mariadb-client mariadb-server nano\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 2: PHP8.0 Installation<\/strong><\/h4>\n<p>PHP8.0 installation requires adding the repository and installing the necessary modules. Follow these sub-steps:<\/p>\n<p><strong>2A: Adding PHP8.0 Repository<\/strong><\/p>\n<p>Execute these commands in sequence:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt-get install ca-certificates apt-transport-https software-properties-common -y\r\necho \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | tee \/etc\/apt\/sources.list.d\/sury-php.list\r\napt install gnupg gnupg2 gnupg1 -y\r\nwget -qO - https:\/\/packages.sury.org\/php\/apt.gpg | apt-key add -\r\napt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n<\/div>\n<div class=\"bg-black rounded-md\"><\/div>\n<p><strong>2B: Installing PHP8.0 &amp; Modules<\/strong><\/p>\n<p>Install PHP8.0 and its required modules using:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt install php8.0 -y\r\napt install libapache2-mod-php8.0 php8.0-{zip,xml,mbstring,gd,curl,imagick,intl,bcmath,gmp,cli,mysql,apcu,redis}\r\n<\/code><\/pre>\n<\/div>\n<p><strong>2C: Adjusting php.ini<\/strong><\/p>\n<p>Configure the PHP settings by editing the php.ini file:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">nano \/etc\/php\/8.0\/apache2\/php.ini\r\n<\/code><\/pre>\n<\/div>\n<p>Modify parameters like <code>memory_limit<\/code>, <code>upload_max_filesize<\/code>, <code>post_max_size<\/code>, and <code>date.timezone<\/code> as needed.<\/p>\n<h4><strong>Step 3: Database Setup<\/strong><\/h4>\n<p>Create a <a href=\"https:\/\/mariadb.org\/\" target=\"_blank\" rel=\"noopener\">MariaDB<\/a> database for Nextcloud:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">mysql \u2013u root \u2013p\r\nCREATE DATABASE nextcloud;\r\nCREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'PASSWORD';\r\nGRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';\r\nFLUSH PRIVILEGES;\r\nexit;\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 4: Download Nextcloud Files<\/strong><\/h4>\n<p>Download and set up Nextcloud&#8217;s files:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">cd \/tmp &amp;&amp; wget https:\/\/download.nextcloud.com\/server\/releases\/latest.zip\r\nunzip latest.zip\r\nrm latest.zip\r\nmv nextcloud \/var\/www\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 5: Apache2 Configuration<\/strong><\/h4>\n<p>Configure Apache2 by activating necessary modules and setting up a reverse-proxy:<\/p>\n<p><strong>5A: Activate Modules<\/strong><\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">a2enmod rewrite headers env dir mime\r\n<\/code><\/pre>\n<\/div>\n<p><strong>5B: Reverse-Proxy Setup<\/strong><\/p>\n<p>Create a configuration file for Nextcloud:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">nano \/etc\/apache2\/sites-available\/nextcloud.conf\r\n<\/code><\/pre>\n<\/div>\n<p>Paste the provided VirtualHost configuration into the file and replace placeholders with your details. Save and exit.<\/p>\n<p>Activate the configuration and restart Apache2:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">a2ensite nextcloud.conf\r\nsystemctl restart apache2\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 6: Optional Data Folder Creation<\/strong><\/h4>\n<p>If desired, create a separate location for uploaded data:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">mkdir \/home\/data\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 7: Permission Adjustments<\/strong><\/h4>\n<p>Ensure proper permissions for Nextcloud files and, if applicable, the uploaded data folder:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">chown -R www-data:www-data \/var\/www\/nextcloud\r\nchmod -R 755 \/var\/www\/nextcloud\r\nchown \u2013R www-data:www-data \/home\/data # Adjust if using a different location\r\n<\/code><\/pre>\n<\/div>\n<h4><strong>Step 8: SSL Certificate Installation<\/strong><\/h4>\n<p>For enhanced security, install an SSL certificate using <a href=\"https:\/\/certbot.eff.org\/\" target=\"_blank\" rel=\"noopener\">Certbot<\/a>:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt install certbot python3-certbot-apache -y\r\ncertbot --apache\r\n<\/code><\/pre>\n<\/div>\n<p>Follow the prompts to install the certificate for your domain.<\/p>\n<h4><strong>Step 9: Finalize Installation in Browser<\/strong><\/h4>\n<p>Access your (sub)domain in the browser and complete the installation steps:<\/p>\n<ol>\n<li>Create an admin account.<\/li>\n<li>(Optional) Specify the path if using a separate location for uploaded data.<\/li>\n<li>Enter database credentials:\n<ul>\n<li>User: nextcloud<\/li>\n<li>Password: PASSWORD<\/li>\n<li>Name: nextcloud<\/li>\n<\/ul>\n<\/li>\n<li>Click &#8220;Install&#8221; to complete the setup.<\/li>\n<\/ol>\n<h2 data-sourcepos=\"7:1-7:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"9:1-9:52\">Congratulations on successfully installing Nextcloud on your Server Gigabit! You now have a secure and private cloud storage solution that you can use to store, share, and collaborate on your files. With Nextcloud&#8217;s extensive app ecosystem, you can add even more functionality to your cloud storage solution. We hope this tutorial has been helpful, and we encourage you to explore Nextcloud&#8217;s many features and possibilities.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Nextcloud is a popular self-hosted productivity platform that provides a secure and private way to store, share, and collaborate on files and documents. It is a great alternative to cloud-based services like Dropbox and Google Drive. Server Gigabit is a fantastic option for hosting Nextcloud, a highly popular open-source productivity platform. This comprehensive tutorial covers every step required to install&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1153],"class_list":["post-3829","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-nextcloud"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3829"}],"version-history":[{"count":3,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3829\/revisions"}],"predecessor-version":[{"id":4253,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3829\/revisions\/4253"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3829"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3829"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}