Friday, July 2, 2021

How to install Nextcloud server on Windows 10

 

How to install Nextcloud server on Windows 10


NextCloud, a perfect alternative to Owncloud cloud storage software. It has both opensource community edition plus enterprise edition, needless to say, paid.  The NextCloud also provides a server-client architecture exactly like OwnCloud and why not, it is a fork of it but with wide extensions support. Users can install the NextCloud community server edition on their PC or server to create their own personal in-house local cloud storage.

The NextCloud client is available for Windows, Linux, macOS, and smartphone platforms iOS and Android. So, it is cross-platform cloud storage with a modular architecture that’s capabilities can be extended using the plugins or extension provided by NextCloud. There are more than 200 extensions such as calendars (CalDAV), contacts (CardDAV), URL shortening suite, streaming media (Ampache), bookmarking service, image gallery, RSS feed reader, document viewer tools, browser-based text editor, connection to Dropbox, Google Drive & Amazon S3 and more…

The interface is quite easy to use and friendly. Here in this tutorial, we will see how to install NextCloud on Windows 10 without using XAMMP, WAMP, IIS server, or a Virtualization software like VirtualBox/Vmware player. We will use the Windows 10 WSL (windows subsystem Linux) feature. It allows us to run Linux environment apps natively on Windows 10 with a high degree of performance just like any native Linux server. That’s why NextCloud also runs on it very smoothly without any glitches.

nstall NextCloud server on Windows 10 using WSL (windows subsystem Linux) Ubuntu

Step 1:  Install the WSL feature on Windows 10.

The WSL (Windows subsystem Linux) is already there on Windows 10 and we just need to activate it. For that, the user has to go to Control Panel->Programs->Turn Windows feature On or off. For a more deep tutorial on WSL installation see: Activate Windows 10 subsystem for Linux



Step 2: Get Linux environment app from the Microsoft store

To install NextCloud on Windows 10, first, we need a Linux app from the Microsoft store. Go to the Windows search box and type Microsoft store as it appears, click on it and search for Ubuntu 18.


The store will show Ubuntu 18.04 or 20.04, select and install any of them as per your choice. This tutorial is written as per Ubuntu 18.04, those who want to go for the 20.04 version can see this one- How to install NextCloud on Ubuntu 20.04 LTS WSL Windows 10  and then use the launch button.

When you Launch the Ubuntu Linux environment it will take some time to get set up.


Step 3: Install Apache+PHP+MySQL/MariaDB for NextCloud

Run the following commands to install the Apache along with MySQL and PHP 7.2

sudo apt install apache2
sudo apt install mysql-server
sudo apt-get install php php-curl php-gd php-fpm php-cli php-opcache php-mbstring php-xml php-zip php-fileinfo php-ldap php-intl php-bz2 php-json libapache2-mod-php php-imagick php-redis php-mysql php-common
sudo a2enconf php-fpm
sudo systemctl reload apache2

 

Step 3: Download & Install NextCloud server on Windows 10

To download the latest version of NextCloud, we need to visit the official download page

As NextCloud doesn’t offer a repository like Owncloud to directly download the server files, so we have two options either via SNAP or directly from the website.

Unfortunately, the SNAP (Snapcraft) is still not workable on Windows subsystem Linux systems, so we can’t use that. Thus, the option left is via their download page.


On the Next cloud page right click on the Download button and copy the link address.

Now come to Ubuntu (WSL) window and type wget and then press right click of the mouse to paste the link.

wget https://download.nextcloud.com/server/releases/nextcloud-15.0.5.zip

 

Step 4:  Extract NextCloud server files

Extract the zipped file of the Next Cloud and then move that to the web directory

sudo apt install unzip

See the downloaded files

ls

Extract the files…

unzip downloaded_file name

In our case, the downloaded files name was: nextcloud-15.0.5.zip so the command was

unzip nextcloud-15.0.5.zip

Exactly in the same way you have to use your downloaded NextCloud zipped file name.


Step 5: Copy the Nextcloud files to the Apache web directory

After extracting, it’s time to move nextcloud folder to /var/www/html. The command is:

sudo mv nextcloud /var/www/html/nextcloud
or
sudo cp -R nextcloud/ /var/www/html/

Create a data folder inside the copied folder

sudo mkdir /var/www/html/nextcloud/data

Set the permission to the nextcloud directory

sudo chown -R www-data:www-data /var/www/html/nextcloud 
sudo chmod -R 755 /var/www/html/nextcloud/

Step 6: Create a new configuration file called nextcloud.conf

Now, we will create an Apache configuration file for NextCloud to tell Apache how to let users access our cloud storage. For this purpose, manually create a configuration file named nextcloud.conf.

The command is:

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

After the above step adds the following lines to the configuration file:

<VirtualHost *:80>

DocumentRoot /var/www/html/nextcloud/

Alias /nextcloud "/var/www/html/nextcloud/"

<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

To save and exit the files first press CTRL+O and then CTRL+X.

Enable the newly created site:

sudo service apache2 reload
sudo a2ensite nextcloud.conf
sudo apt update

Step 7:  Commands for Additional Apache configurations

Enable the following modules for proper Nextcloud working…

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod setenvif
sudo a2enmod mime
sudo service apache2 stop
sudo service apache2 start

 

Step 8: Create MySQL/MariaDB database for NextCloud

We have done almost everything related to web server settings for the NextCloud and it’s time to create a database plus a user for the same.

The commands are as following:

sudo mysql

Create a database, we are giving it a name nextdb you can give whatever you would like…

CREATE DATABASE nextdb;

Create a Database user along with a password and assigned all the rights to the above-created database.

Note: h2smedia is username and next@123 is the password. You can change them with your choice. Whereas the nextdb is the above-created database name.

GRANT ALL ON nextdb.* to 'h2smedia'@'localhost' IDENTIFIED BY 'next@123';

Flush the privileges so that MySQL can recognize the changes and then exit.

FLUSH PRIVILEGES;
exit

 

Step 9 – Setup and Configuring NetCloud server on Windows 10

Finally, go to your browser and type http://localhost/nextcloud or http://127.0.01/nextcloud. It will guide you to create an admin account and database setup page of NextCloud.

Enter the username and password which you want to assign to the Admin account for Next cloud. And then below that enter the details of the database we have created above and click on the Finish Setup button. That’s it.



This is the way to install NextCloud server cloud storage in Windows 10 without the installation of any software like WAMP or XAMMP.

Change Data Folder (Optional step)

By Default, whatever data we upload to NextCloud will go to its data folder that is at /var/www/html/nextcloud/data, it is in the root directory; so, Ubuntu WSL is in the C drive of Windows 10, therefore NextCloud will consume your C: Drive to store all the uploaded files. However, we can change that.

Here I am going to move the data folder from my C: Drive to G: Drive of the system, so all the uploaded files will consume my G: Drive Space, and C: drive will remain free.

This is the way to install NextCloud server cloud storage in Windows 10 without the installation of any software like WAMP or XAMMP.

Change Data Folder (Optional step)

By Default, whatever data we upload to NextCloud will go to its data folder that is at /var/www/html/nextcloud/data, it is in the root directory; so, Ubuntu WSL is in the C drive of Windows 10, therefore NextCloud will consume your C: Drive to store all the uploaded files. However, we can change that.

Here I am going to move the data folder from my C: Drive to G: Drive of the system, so all the uploaded files will consume my G: Drive Space, and C: drive will remain free.


Change the permission of your new data location: 

sudo chmod 0770 /mnt/g/data
sudo chown -R www-data:www-data /mnt/g/data

Note: Replace /mnt/g/data with the location of your folder.



,

No comments:

Post a Comment

Describe BIOS and UEFI

  BIOS (Basic Input/Output System) and UEFI (Unified Extensible Firmware Interface) are firmware interfaces responsible for initializing har...