Find basic guideline to install NEXTCLOUD on a windows 10 desktop

Find basic guideline to install NEXTCLOUD on a windows 10 desktop

For that you need a virtual machine with Linux.

1 Like

What I read is that Nextcloud runs under Windows in Nextcloud pages. Is this a misleading information because it must have a Linux above it?
I have found nothing that describers how Nextcloud interphases with its hosts. And from what I have read 3 types of instances exist, A) the backbone which handles the data base, B) a PC participant and C) a mobile app. Rescuing 64GB from phone card I past by a recommendation of NEXTCLOUD to order and classify photos and other file it said. Well I would like to know what I would be getting into and how to set it up.

Yes.

Somewhere in the Nextcloud documentation is described that Windows is not supported.

Thank you very much.

Hi @AlanAbbott1, for more details about why nextcloud server does not support windows natively : Windows 10 Server - #20 by tflidd
and the documentation does not indicate that windows is supported : System requirements — Nextcloud latest Administration Manual latest documentation

Here is a link to the documentation for install nextcloud through a virtual machine: Installation on Linux — Nextcloud latest Administration Manual latest documentation.
there is another way to install nextcloud server on windows by using WSL : How to install Nextcloud server on Windows 10 - H2S Media

But I think it’s better to install it on a Linux instance.
To install it on Linux there are many tutorials:
I’ve made one for the latest version if you want:

my steps to install nextcloud on ubuntu 20.04 :

Installation of requirement :

  • sudo apt install apache2 mariadb-server
  • sudo apt-get install php zip libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp php-apcu -y
  • sudo mysql_secure_installation
    Enter current password for root (enter for none): Just press the Enter
    Set root password? [Y/n]: Y
    New password: Enter your password
    Re-enter new password: Repeat your password
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]: Y
    Reload privilege tables now? [Y/n]: Y
  • sudo mysql -u root -p
  • CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  • CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'user_password_here';
  • GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;
  • FLUSH PRIVILEGES;
  • EXIT;

/!\ for more security , replace nextcloudnextclouduseruser_password_here

Download of nextcloud

  • wget https://download.nextcloud.com/server/releases/nextcloud-21.0.0.zip
  • unzip nextcloud-21.0.0.zip
  • sudo mv nextcloud /var/www/nextcloud/
  • sudo chown -R www-data:www-data /var/www/nextcloud/
  • sudo chmod -R 750 /var/www/nextcloud/

Setting up apache

  • sudo nano /etc/apache2/sites-available/domain.conf ( Change domain by what you want )
<VirtualHost *:80>
DocumentRoot /var/www/nextcloud/
ServerName example.com

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

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

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

Replace example.conf by your domain name
If you want to acces to nextcloud by using only domain.com ( not domain.com/nextcloud/) just delete Alias /nextcloud "/var/www/nextcloud/"

  • ctrl+s
  • ctrl+x
  • sudo a2ensite domain.conf
  • sudo a2enmod rewrite
  • sudo a2enmod env
  • sudo a2enmod dir
  • sudo a2enmod mime
  • sudo systemctl restart apache2

you can access to the wizard installation of nextcloud on your local ip

  • create an admin account
  • set the path of your data directory ( where the data of users are stored ) this directory need to be available by www-data user with full access:
    sudo chown -R www-data:www-data /PathDirectory
    sudo chmod -R 750 /PathDirectory
  • Enter your user database ( in this tutorial , it is nextclouduser)
  • Enter your password user ( in this tutorial , it is user_password_here)
  • Enter your database name ( in this tutorial , it is nextcloud)

launch the installation

Add your domain to trusted domain

  • sudo nano /var/www/nextcloud/config/config.php
  • inside trusted domain add :
    1=> ' domain.com '

Enable ssl ( https connection ) using certbot ( need to open your router port and don’t forget to setup a firewall like ufw or other )

  • sudo apt-get install certbot python3-certbot-apache
  • sudo certbot --apache
  • Enter your mail address , agree the term, select you domain and redirect all traffic to https
  • sudo nano /etc/apache2/sites-available/domain-le-ssl.conf
  • add this line before the last </VirtualHost> :

Header always set Strict-Transport-Security “max-age=15552000; includeSubDomains”

Enable Redis Memcache

  • sudo apt-get install redis-server php-redis
  • sudo nano /var/www/nextcloud/config/config.php
  • add these lines before the last ); :

‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘localhost’,
‘port’ => 6379,
),

PHP memory limit and opcache:

  • sudo nano /etc/php/7.4/apache2/php.ini
  • ctrl+w
  • memory
  • set memory_limiteto 512 M
  • find the lines and set the values :
    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

PHP fpm :

  • sudo apt-get install php-fpm
  • sudo a2enmod proxy_fcgi setenvif
  • sudo a2enconf php7.4-fpm
  • systemctl restart apache2
  • sudo nano /etc/php/7.4/fpm/pool.d/www.conf
  • find the lines and set the values :
    pm.max_children = 120
    pm.start_servers = 12
    pm.min_spare_servers = 6
    pm.max_spare_servers = 18

link to nextcloud doc for tunning ( Redis / opcache / php fpm / SSL) : Server tuning — Nextcloud latest Administration Manual latest documentation