Owncloud

Here is a guide on how to install the free and open-source (FOSS) “Dropbox” alternative. We will install Owncloud on a MySQL / Apache / Ubuntu server which is the most commonly used way of using Owncloud.

The Owncloud organization provides an Enterprise server which will bring you mobile branding and support. The base of the product Owncloud Server (Community Edition) is FOSS. The community is active and provides good working apps for common tasks.

On the Owncloud website you can find the Owncloud client to install on your computer (Windows / MacOS / Linux) and the links to the tablet/smartphone clients.

Installation

1. Update your server to the latest version

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo apt-get update
sudo apt-get upgrade

[/pastacode]

2. Install the Apache web server

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo apt-get install apache2

[/pastacode]

3. Install PHP and the PHP modules on the Ubuntu 14.04 server

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo apt-get install php5 php5-mysql php5-gd php5-json php5-intl php5-mcrypt php5-imagick php5-curl

[/pastacode]

4. Install your MySQL Server and secure the MySQL server

By default the MySQL server isn’twell secured. With the mysql_secure_installation script the server will be more secure. Some thing the script does: disallow remote login, remove test database, set root password.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo apt-get install mysql-server
sudo mysql_secure_installation

[/pastacode]

5. Create the MySQL owncloud user and database

Enter the MySQL command line with your (mysql) root user and password

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

mysql -u root -p

[/pastacode]

Create user and Database within the MySQL command line. Choose your own password for the owncloud user in the following sample.

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

CREATE USER 'user_owncloud'@'localhost' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE db_owncloud;
GRANT ALL ON db_owncloud.* TO 'user_owncloud'@'localhost';
FLUSH PRIVILEGES;
exit

[/pastacode]

6. Install Owncloud

Download and unpack the latest from the owncloud website

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

wget https://download.owncloud.org/community/owncloud-8.0.2.tar.bz2
sudo tar -xvf owncloud-8.0.2.tar.bz2 -C /var/www/html/

[/pastacode]

Set the permissions on the unpacked files

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo chown -R www-data:www-data /var/www/html/owncloud/

[/pastacode]

7. Configuring Apache

Edit the default apache config file (or create your own)

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

sudo vi /etc/apache2/sites-available/000-default.conf

[/pastacode]

Add the following in the file just before </VirtualHost>

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

<Directory /path/to/owncloud>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

[/pastacode]

Restart the apache daemons or just the whole server.