Install Nextcloud cloud server on a Raspberry Pi

Nextcloud is a personal cloud server, you’re not relying on Apple cloud or Google or Dropbox to hold and secure (laughable) your data. If you have a Raspberry Pi at home you can host your own cloud server. There are desktop apps for Windows and Macs and apps for almost ALL mobile operating systems too.

Nextcloud – a safe home for all your data

I’ve gone for the personal route because I find the free cloud server really don’t offer enough storage space, and security is a joke for most of them. Plus with the SSL guide you can make sure your is as secure as possible.

For easy reference:

Code:

sudo apt-get update

Code:

sudo apt-get install apache2

Code:

sudo apt-get install apache2 php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc libapache2-mod-php7.0

Code:

sudo service apache2 restart

Download link: https://nextcloud.com/install/#instructions-server

Code:

sudo wget https://download.nextcloud.com/server/releases/nextcloud-11.0.2.zip

Code:

sudo mv nextcloud-11.0.2.zip /var/www/html

Code:

cd /var/www/html

Code:

sudo unzip -q nextcloud-11.0.2.zip

Make a folder for the data!!!

Code:

sudo mkdir -p /var/www/html/nextcloud/data

Code:

sudo chown www-data:www-data /var/www/html/nextcloud/data

Code:

sudo chmod 750 /var/www/html/nextcloud/data

Next, set the correct ownerships on Nextcloud “config” and “apps” directories:

Code:

cd /var/www/html/nextcloud

Code:

sudo chown www-data:www-data config apps

Create a Login for Nextcloud

In a browser, surf to your new Owncloud web page. Use the URL:
http://your Pis IP address/nextcloud

For example, the address of my Pi is 192.168.1.9. So I go the the URL: http://192.168.1.9/nextcloud

Increase upload size from 2mb

Code:

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

Change these two lines:
post_max_size = 8M
upload_max_filesize = 2M
to:
post_max_size = 20M
upload_max_filesize = 20M

Code:

sudo service apache2 restart

Now setting up your own cloud isn’t good enough, you also need to secure all traffic and data, to encrypt the data on the drive use the plugin in the admin panel, for SSL use this tutorial.
Check domain and hostname

Code: Select all

domainname -b mysite.ddns.net

Code: Select all

sudo nano /etc/hostname

Make the domain name stick

Code: Select all

sudo nano /etc/sysctl.conf