Copy the NextCloud data to the www directory

  1. In terminal change location to /tmp/

    cd /tmp/


  2.  We will now download the .zip file into this directory.


  3. Once downloaded verify that the zip file is located in the /tmp/ directory.


  4. We now need to unpack the zip file.


    If you don’t have the unzip program installed you can run the following script.

    sudo apt install unzip


    After Unpacking the zip file you should now see a new folder called nextcloud.

  5. We now need to copy and create the nextcloud folder in the www directory.

    sudo cp -r nextcloud /var/www


    ## Configuring the site with Apache

1. We will need to create the nextcloud .conf file in /etc/apache2/sites-available/nextcloud.conf . Inside this conf file we need the following.

sudo nano nextcloud.conf

Alias /nextcloud “/var/www/nextcloud/”

<Directory /var/www/nextcloud/> Options +FollowSymlinks AllowOverride All

<IfModule mod_dav.c> Dav off </IfModule>

SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud


2. We then need to create a symlink. This creates a sync conf file between enabled sites and available sites.

sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf

3. For Nextcloud to work correctly, we need the module mod_rewrite. Enable it by running:

a2enmod rewrite

4. Now restart Apache2 or reboot.

sudo service apache2 restart


Installing NextCloud

  1. Run the following cmd

    chown -R www-data:www-data /var/www/nextcloud/