How to install Nextcloud server on Windows 10

- Advertisment -
- Advertisement -

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 platform iOS and Android. So, it is cross-platform cloud storage with modular architecture that’s capabilities can be extended using the plugins or extension provide by the 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 the 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 Microsoft store. Go to 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 the Ubuntu 18 app, select and install it. 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 php7.2 apache2 libapache2-mod-php7.2
sudo apt-get install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring
sudo apt-get install php7.2-intl php-imagick php7.2-xml php7.2-zip php7.2-dom

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 the NextCloud doesn’t offer 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 which 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.


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


Extract the files…

unzip downloaded_file name

In our case, the downloaded files name was: so the command was


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 Apache web directory

After extracting its time to move the nextcloud folder to /var/www/html. The command is:

sudo mv nextcloud /var/www/html/nextcloud/
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 in 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
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud

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


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 setting for the Next cloud and its time to create a database plus 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 a Database user along with password and assigned all the right or above-created database to it.

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.


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 to open an account creation 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.

Other Resources to read:


Sarbasish Basu
From B.Tech (Hons.) Electronics & Instrumentation Engineer to Photography and Writing blogs; he ultimately has answers to everything. Oh, and he's also quite good in rapidly building a relationship and set up the trust; his articles are proof of that...


  1. This post saved me from giving up until I got this right when I ran
    sudo mysql
    The output was as follows
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)

    I have spent hours trying to fix this with no change in the outcome I am very lost if you or anyone have a idea I’m all ears. Thanks.

      • Sir I promise you I did that more times then I care to count never fixed it, even tried it again with no result. However and I don’t know why I installed Synaptic and Xserver and rolled through php, apache, and mariadb installs in full. Then restarted my PC and the server as well as ran [sudo service mysql start]….. Now it works! I have a question that I feel should be covered in this for good reason. When I restart the PC at any point will commands need to be run to restart the server and if so is there a way to setup a single script icon for it to do so in a batch action? O yes and one more, I plan to move this to a server after testing do I have a option to clone this as it will all be the same info as current?

        • Hi Jester,
          Tim this side, I am also playing around WSL to learn its curves…

          What I understand that you want to start MySQL automatically every time during the system boot. However, in WSL it would be a problem but on the real system, it will start automatically without any problem, as far as I know. Still, here is the link to a script for MySQL available on Ubuntu forum you can try it out:

          Other Question of yours which is cloning of Ubuntu system:

          You should not clone the WSL running system because it would not be feasible. As it is a kind of virtual machine and when you try to clone it to other hardware it will create problem. Just copy all the data and packa all the installed service in a package file which later we can run on the new Ubuntu system to install all the packages and services which were there on old one. Below I am giving the commands:

          However, if you are using the Ubuntu on some PC or other hardware then you can use the Clonezilla or bare metal backup software those will clone your system and deploy it exactly on new ones.
          Coming to the point:
          If you want to transfer old machine to a brand new machine but you won’t like to spend hours tuning it to get the same configuration as the one you have used for years?

          Let’s transfer your Ubuntu configuration and applications to your new computer in three simple steps.

          Note: The same version of Ubuntu should be installed on both machines. The architecture (32/64 bit) can be different.

          Step 1: Store the list of installed packages

          Run the following command on the source machine to store the installed packages names in ~/pkglist:

          sudo dpkg –get-selections | sed “s/.*deinstall//” | sed “s/install$//g” > ~/pkglist

          Step 2: Transfer your config

          Use scp or rsync or even a flash drive to transfer your home directory (~/*, ~/.*), the source list (/etc/apt/sources.list) and any other files you customized or installed (like apache config under /etc or softwares on /opt) from the source machine to the target one.

          Step 3: Install packages

          On the target machine run the following command in a failsafe terminal session to install your packages:

          sudo aptitude update && cat pkglist | xargs sudo aptitude install -y

          Let me know if it works for you!!!!

  2. Sorry Been very busy I have many questions about this and would like to try and perfect this method of install. I’m would like to get in to much deeper detail about the goal I have and the outcome that I seem to be getting. However I don’t feel the comments section on this post is the correct place to be posting a book of details and plans but you guys have been very helpful. The main goal here is for a 100% free Nextcloud server that can be run on a windows 10 enterprise pc that is a daily driver I have a NAS/Server but this is for the people that don’t have the ability or money. I would like to know where would be best that this guide can be perfected and hopefully worked on with as may people as possible for the maximum stability. This guide made my idea come alive and I want it to grow in the best way without the troll input that I have seen on some sites please give me the best input you can without hurting your own traffic. Thank you for the help so far!

  3. Hey Having trouble on Step 6. I get into the GNU nano 2.9.3 and it gives me a [ Error Writing /etc/apache2/sites-avaible/nextcloud.conf: no such file or directory ]

  4. Failed on the first step (sudo apt-get install apache2 mysql-server libapache2-mod-php7.2
    ) with following errors:

    Cannot open /proc/net/unix: No such file or directory
    Cannot stat file /proc/1/fd/5: Operation not permitted
    Cannot stat file /proc/3/fd/7: Operation not permitted

    • I found out “/proc is an interface that needs to be implemented by Microsoft, since it needs to be implemented using Windows API calls.”

      If /proc is not implemented, how are you managing to install on WSL?

  5. Hey guys,

    First thanks for the tutorial. After starting nextcloud ( I get the following messages:

    No database drivers (sqlite, mysql, or postgresql) installed.

    PHP module GD not installed.

    Please ask your server administrator to install the module.

    PHP module cURL not installed.

    Please ask your server administrator to install the module.

    PHP modules have been installed, but they are still listed as missing?

    Please ask your server administrator to restart the web server.

    Can you help?
    Thx Marcus

    • On Your Ubuntu WSL, again run these commands one by one and see all of them are installed properly.

      sudo apt-get install php7.2-gd
      sudo apt-get install php7.2-curl
      sudo apt-get install php7.2-mysql

      If yes, then restart the Apache

      sudo service apache2 stop
      sudo service apache2 start

      Also make sure the Mysql service is up and running

      sudo service mysql start

  6. Step 5: sudo mv nextcloud /var/www/html/nextcloud/
    it says mv: cannot move ‘nextcloud’ to ‘/var/www/html/nextcloud/’: No such file or directory

    What do I do?

  7. Thank you very much for this tutorial.

    One very important question: Since I want to use nextcloud from anywhere I definitely want to use an encrypted connection. How can I enable ssl with this type of setup? Many thanks in advance!

    • Are you planning to use some FUll Qualified domain or naked public Ipaddress? Most SSL certificates are bound to the hostname of the machine and not the IP address. Thus, it is recommended to buy a domain and an SSL certificated from the same place and after that point that domain to your Next cloud IP address using DNS section of DOMAIN.

  8. Another question: Is it possible to change the data folder to a different windows drive? As far as I understand, in this tutorial data would be stored on drive c, right?

    • Yes, it is possible to change the default drive for storing the NextCloud Data.

      For example you want to move your Nextcloud data location D: drive
      sudo mkdir -p /mnt/d/new
      sudo cp -a /var/www/html/nextcloud/data/ . /mnt/d/new
      sudo chown -R www-data:www-data /mnt/d/new/data
      sudo nano /path/to/nextcloud/config/config.php
      Find line:
      ‘datadirectory’ and change its path with new one i.e /mnt/d/new/data

      • Thanks a lot!
        Unfortunately, after trying this nextcloud says that my folder is not valid and that I should make sure that .ocdata is there, but the file exists.
        Before you answered, I tried it with different tutorials but this did also not work, getting permissions to work outside of the ubuntu win10 folder seems to be very difficult. Do you have any tipps to get it work?

        • Which folder you are trying to access within the WSL, is that folder outside the Windows filesystem? I mean any remote folder.

  9. Hi There!
    I followed your guide and my NextCloud server is running nicely!
    I managed to access external storage, but I can’t write or delete to the external folders.

    Do you guys how could we manage to make it work?

  10. Dear friends,
    After doing “sudo apt install mysql” I received this messages:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package mysql

    I already did “sudo apt update”.
    Any ideas?

    Thank you!

  11. Noob here, but I’ve made it nearly to step 7, but I’m having issues enabling the newly created site. It appears as though Apache2 cannot start. when I try to just run sudo service apache2 start, I get a permission denied error that looks like a port access issue.
    When I run sudo lsof -i:80 I see no response. Any tips???

    gwaller@Home-PC:~$ sudo service apache2 reload
    * Reloading Apache httpd web server apache2 *
    * Apache2 is not running
    gwaller@Home-PC:~$ sudo service apache2 start
    * Starting Apache httpd web server apache2 (13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
    (13)Permission denied: AH00072: make_sock: could not bind to address
    no listening sockets available, shutting down
    AH00015: Unable to open logs
    Action ‘start’ failed.
    The Apache error log may have more information.
    gwaller@Home-PC:~$ sudo lsof -i:80

    • I have got the same error…

      Simply edit apache ports confgiruation file and change Listen 80 to Listen port: 8080

      sudo nano /etc/apache2/ports.conf

      Then type:
      sudo service apache2 stop
      sudo service apache2 start

      if you get same error; start apache2 again using the above command.
      Once it get started. You can access the server at 8080 port.

      Now again edit port configuration file ports.conf and change the Listen 8080 to Listen 80

      stop and start the server, if get error; fire the Apache2 service start command one or two times given above to flush cache in case is there.

      • I got it to listen to 8080, but would never go back to 80.
        Also in order for it to work with 8080, I also had to add “AcceptFilter http none” to the end of apache2/ports.conf
        I was getting a (92)Protocol not available: AH00076: Failed to enable APR_TCP_DEFER_ACCEPT.

        Even though I never got it back to port 80, I was able to log in via local web browser to http://127.0.01:8080/nextcloud (specifically calling out to use port 8080).

        Is there any issue with leaving it at port 8080?
        (Nextcloud is fully up and running and functional)

  12. Be aware that you may have problems in filenames with special characters, when you install Nextcloud on WSL For example, I had a test folder with “&” character and couldn’t delete it even from web interface. If you sync a lot files, the desktop client will complain about them constantly, the client will not upload some random files. That’s probably because some incompatibility with Windows file system and PHP.

    I ended up installing Nextcloud on a Virtualbox VM over real Ubuntu Server. All of the filename problems gone.

    • Depending on your php version edit the php.ini file:

      sudo nano /etc/php/7.1/apache2/php.ini

      Note: replace the 7.1 with your current version of php version.

      And there find the below values and increase the memory as per your requirement.

      memory_limit = 128M

  13. Two questions:

    After running the first command in step # 3, I noticed this:

    “The following package was automatically installed and is no longer required:
    Use ‘sudo apt autoremove’ to remove it.”

    Can I run “sudo apt remove” in any session to remove the app and, am I correct in thinking it’ll remove the package installer for libfreetype6, not apache?

    Second question is a problem…four of the packages were unable to be retrieved…
    “Err:6 bionic-updates/main amd64 apache2-bin amd64 2.4.29-1ubuntu4.6
    404 Not Found [IP: 80]
    Err:7 bionic-updates/main amd64 apache2-utils amd64 2.4.29-1ubuntu4.6
    404 Not Found [IP: 80]
    Err:8 bionic-updates/main amd64 apache2-data all 2.4.29-1ubuntu4.6
    404 Not Found [IP: 80]
    Err:9 bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6
    404 Not Found [IP: 80]
    Fetched 320 kB in 3s (124 kB/s)
    E: Failed to fetch 404 Not Found [IP: 80]
    E: Failed to fetch 404 Not Found [IP: 80]
    E: Failed to fetch 404 Not Found [IP: 80]
    E: Failed to fetch 404 Not Found [IP: 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?”

    Do I need these?

    So I tried running the suggested commands, but didn’t work. Instead, gives a permission error, among other things. What’s the chmod permission code I should use?

    “doug@PC-NAME:~$ apt-get update
    Reading package lists… Done
    E: Could not open lock file /var/lib/apt/lists/lock – open (13: Permission denied)
    E: Unable to lock directory /var/lib/apt/lists/
    W: Problem unlinking the file /var/cache/apt/pkgcache.bin – RemoveCaches (13: Permission denied)
    W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin – RemoveCaches (13: Permission denied)
    doug@PC-NAME:~$ apt-get update –fix-missing
    Reading package lists… Done
    E: Could not open lock file /var/lib/apt/lists/lock – open (13: Permission denied)
    E: Unable to lock directory /var/lib/apt/lists/
    W: Problem unlinking the file /var/cache/apt/pkgcache.bin – RemoveCaches (13: Permission denied)
    W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin – RemoveCaches (13: Permission denied)”

    Otherwise, great tutorial. I’m hoping this Ubuntu 18 window will stay connected until someone replies.



Please enter your comment!
Please enter your name here

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

Latest Posts

4 Best Tablets under 10k which you can buy in 2020

Though smartphones might be the favourite and most popular gadget of the masses we also just cannot...

BattRE Launches Internet Connected Electric Scooter–BattRE IOT on Amazon India

Press Release Highlights: IOT based Electric Scooter available at your doorstep, hassle-free through Amazon. Smart Features – Navigation Assist,...

Best Good Performance Laptops which you can buy in 2020

Laptops have become both a trend as well as a necessity in today's world. Most of the...

Best AIO Personal Computers which you can purchase in 2020

No doubt that almost every one of us either has a laptop or a computer with us,...
- Advertisement -

ATEN collaborates with BOSCH to offer Intelligent Control Solutions

ATEN, the KVM manufacturer and a provider of AV/IT connectivity and management solutions, recently announced its collaboration...

Could cloud-based gaming spark the next smartphone revolution?

Hardware is not enough to make a smartphone stand out from the crowd in today’s digital...

- Advertisment -
- Advertisement -

You might also likeRELATED
Recommended to you