ownCloud file sync and share server installation on Debian 8 Jessie Linux

This article will describe an installation of the ownCloud file sync and share server on Debian 8 Linux Jessie. This article does not assume any pre-installed packages. Using the commands below you can install ownCloud on the fresh installation of Debian 8 Linux Jessie. Furthermore, we will be using external sources to install the latest version of ownCloud suite.

Let’s begin by inclusion of the ownCloud repository:

# wget -q http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key
# apt-key add - < Release.key
# echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list
# apt-get update

Now install the owncloud package which will also fetch all required prerequisites such as mysql-server or apache2 webserver:

# apt-get install owncloud

In the next step we are going to configure database. Let’s enable database to start after reboot and start the database:

# systemctl enable mysql
# service mysql start

Once the MySQL( mariaDB ) is up and running, we need to create a new database called owncloud. All mysql commands below require administrator user name and password. Replace root user if your administration to access to mariaDB database is different:

# mysqladmin -u root -p create owncloud
Enter password:

Next, we need to create a new database user eg. owncloud with password pass123 and grand all privileges to this user on database owncloud:

mysql -u root -p -e "CREATE USER 'owncloud'@'%' IDENTIFIED BY 'pass123';"
mysql -u root -p -e "GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'%' WITH GRANT OPTION;"

Database is ready. All what remains is to configure apache web server. First disable the default page:

# a2dissite 000-default

What the next command will do is to change the owncloud access URL from http://yourhostname/owncloud to http://yourhostname/ This step is optional:

# sed -i '0,/owncloud/s///' /etc/apache2/conf-available/owncloud.conf

Now, enable and start apache webserver:

# systemctl enable apache2
# service apache2 start

Now you can begin the actual owncloud installation by navigation your browser to http://yourhostname/ and entering the information above.
NOTE:It is highly advisable to further configure your access to owncloud via HTTPS using SSL certificates.