What is Nextcloud? Nextcloud is a forked by founder of ownCloud. Nextcloud move focus on apps as Calendar, Contacts, Documents, Video Chat, Email, and more.

I make package for Debian 8 Jessie for easy way of installation Nextcloud, in my example I use PostgreSQL database but supported is My SQL / MariaDB and SQLite by this repository.

 

Add Nextcloud Repository

Add the Nextcloud repository in the /etc/apt/sources.d/nextcloud.list

echo 'deb http://apt.jurisic.org/debian/ jessie main contrib non-free' >> /etc/apt/sources.list.d/nextcloud.list

Install release key of Nextcloud repository:

wget -q http://apt.jurisic.org/Release.key -O- | apt-key add -

And run apt-get update to download the list of packages.

apt-get update

 

Check out available Nextcloud packages

Let's check which packages we have for nextcloud now:

apt-cache search nextcloud

 

Choice database for Nextcloud

We can to use My SQL / MariaDB , PostgreSQL and SQLite, my choice is PostgreSQL but Nextcloud work excelent with other databases. 

Install PostgreSQL and setup new user & database

Install PostgreSQL with:

apt-get install postgresql

The PostgreSQL package will install all required dependencies.

Choose "y" to start the installation.

Add a PostgreSQL database

The next step is to create a PostgreSQL database for nextcloud.

Login to PostgreSQL on the commandline by running this command:

su - postgres
psql

Enter the following commands to create a database user with the name "nextuser" and and a database name "nextcloud". Replace the word "StorngPasswordHere" with your own password in the commands.

CREATE DATABASE nextcloud;
CREATE USER nextuser WITH PASSWORD 'StorngPasswordHere';
GRANT ALL PRIVILEGES ON DATABASE nextcloud to nextuser;

 

Install Nextcloud server

Install Nextcloud server with:

apt-get install nextcloud-server

When the shell part of the installation is finished, proceed by opening the Nextcloud web installer in your browser. The URL is http://[YOURIP]/nextcloud. In my case the IP is 192.168.1.100 so I enter http://192.168.1.100/nextcloud in my browser to get the installer:

Enter the desired administrator username and password in the login fields. Please choose a secure password and also a username that is not "admin" or "administrator" might be a good choice to make it less easy for attackers to guess your admin login.

Nextcloud is using sqlite as storage engine by default. This is not a good choice performace wise, so I will choose PostgreSQL as database backend. We have created a PostgreSQL database above, enter the details of that database now:

  • Username:         nextuser
  • Password:          The password that you have choosen for the database.
  • Database name: nextcloud
  • Hostname:         localhost

Then click on the button to finish the installation. You will get greeted with a welcome screen in your language.


 

Access Nextcloud with SSL (https)

The default installation of Nextcloud is not secured by SSL. To enable SSL in your webserver, run these commands:

a2enmod ssl
a2ensite default-ssl
service apache2 restart

Now you can access the web interface with https://[YOURIP]/nextcloud. You will probably get a SSL warning, this warning should be accepted. To avoid such warnings, get a free officially signed SSL certificate e.g. from Startssl (or check LetsEncrypt).