Root-Server Tutorial

ROOT-SERVER TUTORIAL

Install Nextcloud on Debian

Learn how to install Nextcloud on Debian servers

Author:

Zoey Löchner

Last updated:

16/01/2021

Introduction

In this tutorial you will learn how to install Nextcloud.

I am doing this on a Debian 11 server (RS Zimtstern) but the installations should also work on other Debian versions.

Requirements

You need Apache2, PHP and MariaDB installed on your server. See here.

Installing Nextcloud

Nextcloud is an open source cloud software.

  • Follow Step 1.5 and create a new domain or subdomain for the website.
  • Switch to the folder you have just created (replace FOLDER with the name of the folder):
cd /var/www/FOLDER
curl -L -o setup-nextcloud.php https://download.nextcloud.com/server/installer/setup-nextcloud.php

After you installed Nextcloud you should adjust some more settings by running:

nano config/config.php

... and adding the following lines after 'installed' => true,

  'memcache.local' => '\OC\Memcache\APCu',
  'default_phone_region' => 'DE',
  'htaccess.RewriteBase' => '/',
  • Change DE if you do not live in Germany, look here for the ISO code of your country.
  • Save your changes by pressing CTRL + X, then y and finally by hitting ENTER. Next, execute the following commands:
sudo -u www-data php occ maintenance:update:htaccess
nano .htaccess
  • Go to the end of the file and add: Header always set Strict-Transport-Security "max-age=15552000".
  • Save your changes by pressing CTRL + X, then y and finally by hitting ENTER.

Conclusion

Now you have completed the installation of Nextcloud.
This tutorial contains content sourced from https://github.com/SanCraftDev/Debian-Setup/blob/main/README.md.

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributor's Certificate of Origin

By making a contribution to this project, I certify that:

  1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or

  2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or

  3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

Published 16/01/2021 by Zoey Löchner

Submit your tutorial

Get 60€ netcup vouchers for every published tutorial.