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.

Install 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 

Install the WSL feature on Windows 10 nextcloud

 

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.

microsoft store to install Linux Nextcloud Windows 10

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.

install the Nextcloud server on windows 10

 

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 service apache2 restart

 

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.

download Nextcloud cloud storage windows 10

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.

install nextcloud window 10

 

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

Restart Apache to make the installed modules effective:

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 [email protected] 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 '[email protected]';

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.

next cloud windows 10

installation done of Nextcloud server on Windows 10

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.

sudo cp -r /var/www/html/nextcloud/ /mnt/drive-name

Replace the drive-name with the one where you want to save your all files.

For example, I want it on G drive thus the command in my case was like this:

sudo cp -r /var/www/html/nextcloud/ /mnt/g

 

Now, edit the NextCloud Config file:

sudo nano /var/www/html/nextcloud/config/config.php

Find this line:

'datadirectory' ='/var/www/html/nextcloud/data'.

Replace the current directory location with one where you have copied the data folder.

For example, I have copied it at /mnt/g/data. Thus, I use the same. You can see that in the below screenshot.

After that save it: CTRL+O and exit using CTRL+X.

Nextcloud Data directory

Nextcloud Data directory

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.

 

 

 

Other Resources to read:

 

 

Comments (64)

  1. DigitalJester88 March 12, 2019
    • H2S Media Team March 13, 2019
      • DigitalJester88 March 13, 2019
        • Tim master March 14, 2019
  2. DigitalJester88 March 18, 2019
  3. Eric Hamby April 14, 2019
    • H2S Media Team April 16, 2019
      • abuke May 3, 2019
        • abuke May 3, 2019
  4. Steven Webber April 24, 2019
  5. Paulianick June 6, 2019
  6. Mark Ramsay July 6, 2019
    • Mark Ramsay October 7, 2019
  7. Marcus July 23, 2019
    • H2S Media Team July 23, 2019
      • Hirak Desai November 20, 2019
  8. Marcus July 23, 2019
  9. Trever July 26, 2019
    • Paul August 22, 2019
      • H2S Media Team August 22, 2019
      • Trever September 9, 2019
  10. Terry August 26, 2019
    • H2S Media Team August 26, 2019
  11. dazzil August 29, 2019
    • H2S Media Team September 4, 2019
  12. dazzil August 29, 2019
    • H2S Media Team September 4, 2019
      • dazzil September 4, 2019
        • H2S Media Team September 5, 2019
  13. DMTwo September 1, 2019
  14. Ilan September 20, 2019
    • H2S Media Team September 20, 2019
  15. GabeW September 29, 2019
    • Taapan September 30, 2019
      • GabeW September 30, 2019
  16. Rogelio October 3, 2019
    • Samuel October 12, 2019
      • Samuel October 12, 2019
  17. James October 20, 2019
  18. Caleb October 28, 2019
  19. JAY November 14, 2019
  20. Zach December 13, 2019
    • H2S Media Team December 13, 2019
  21. Doug Mehus January 1, 2020
  22. Ruben March 27, 2020
  23. KillYourBuddhas November 27, 2020
    • H2S Media Team December 3, 2020
  24. imran omar January 26, 2021
    • Heyan January 26, 2021
  25. Tam Tama March 16, 2021
    • H2S Media Team March 16, 2021
  26. Claude April 3, 2021
  27. Ven May 28, 2021
    • H2S Media Team May 28, 2021
      • Ven May 29, 2021
        • H2S Media Team June 2, 2021
  28. Alan June 3, 2021
  29. Kimbo September 30, 2021
    • H2S Media Team September 30, 2021
      • Kimbo October 1, 2021
        • H2S Media Team October 2, 2021

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.