Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Add the ownCloud Repository

On a machine running a pristine Ubuntu 14.04 LTS server, install the required
and recommended modules for a typical ownCloud installation, using Apache and
MariaDB, by issuing the following commands in a terminal:
apt-get install apache2 mariadb-server libapache2-mod-php5
apt-get install php5-gd php5-json php5-mysql php5-curl
apt-get install php5-intl php5-mcrypt php5-imagick

Add the ownCloud repository in the /etc/apt/sources.d/ directory:

echo 'deb
http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /'
>> /etc/apt/sources.list.d/owncloud.list

Install the release key of the official ownCloud repository:

cd /tmp
wget
http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release
.key
apt-key add - < Release.key

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

apt-get update

Check out available ownCloud packages


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

apt-cache search owncloud

The repository provides many ownCloud apps like PDF viewer, file encryption, a
versioning system, etc. beside the ownCloud base package.

Install ownCloud
I will start with the installation of the base package by executing this command as
root user on the shell:

apt-get install owncloud

The "owncloud" package will install all required dependencies like apache webserver,
php, mysql etc.

Choose "y" to start the installation.


The installation process will ask for a new MySQL root password. Choose a secure
password here:

And enter the password a second time:

Add a MySQL database


The next step is to create a MySQL database for owncloud.

Login to MySQL on the commandline by running this command:

mysql --defaults-file=/etc/mysql/debian.cnf

This opens up the MySQL commandline prompt:

Enter the following sql commands to create a database user with the name
"owncloud" and and a database of the same name. Replace the word
"mysecurepassword" with your own password in the commands.
CREATE DATABASE owncloud;
CREATE USER owncloud@localhost IDENTIFIED BY 'mysecurepassword';
GRANT ALL PRIVILEGES ON owncloud.* TO owncloud@localhost;
flush privileges;
quit
Create a data directory for ownCloud to store the uploaded files the file. Choose a
directory on your largest disk partition for this. I will use the directory /var/owncloud
here.

mkdir /var/owncloud
chown www-data:www-data /var/owncloud
chmod 750 /var/owncloud

When the shell part of the installation is finished, proceed by opening the ownCloud
web installer in your browser. The URL ishttp://[YOURIP]/owncloud. In my case the IP
is 192.168.0.100 so I enter http://192.168.0.100/owncloud 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.
I dont like my private files to be stored in the website root /var/www, so I choose the
folder /var/owncloud here.
OwnCloud is using sqlite as storage engine by default. This is not a good choice
performace wise, so I will choose MySQL as database backend. We have created a
MySQL database above, enter the details of that database now:

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

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

Access ownCloud with SSL (https)


The default installation of ownCloud 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]/owncloud. 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 in a few
months from LetsEncrypt when their free service started).

You might also like