Skip to main content

ownCloud Installation in Ubuntu 18.04.2

ownCloud

ownCloud is the leading OpenSource Cloud Collaboration Platform. It allows to access and share your files, calendars, contacts, mail and more from any device on your terms.

ownCloud is a suite of client–server software for creating and using file hosting services. ownCloud functionally has similarities to the widely used Dropbox. The primary functional difference between ownCloud and Dropbox is that ownCloud does not offer data centre capacity to host stored files. The Server Edition of ownCloud is free and open-source, thereby allowing anyone to install and operate it without charge on their own private server.

For More Details on Features - https://owncloud.org/features/

This post summarizes the commands required for ownCloud installation commands.

The installation comprises of 2 stages:

(1) Installation of LAMP stack

(2) Installation of ownCloud

(3) Setting up ownCloud


(1) Installation of LAMP:

LAMP - Installation of Apache, MySQL and PHP in Linux environment.
Here we are installing in the latest Ubuntu 18.04.2 Desktop version.

Apache2:

First we install, then we check the status of Apache. After that, we allow firewall access to port 80 and port 443. Once done, we can check whether it is installed properly via browser.

1. sudo apt-get update

2. sudo apt-get install apache2

3. sudo systemctl status apache2  (type 'q' to quit)

4. sudo ufw allow 80/tcp

5. sudo ufw allow 443/tcp

Check http://localhost or http://127.0.0.1 to see Apache page

MySQL:

First we install MySQL Server version, then check its status. We run secure installation to create root password for root user. Once password is set, we login using those credentials. We set up a database and grant all privileges to the user of the database.

1. sudo apt-get install mysql-server

2. sudo systemctl status mysql  (type 'q' to quit)

3. sudo mysql_secure_installation

4. sudo mysql -u root -p

5. mysql>  CREATE DATABASE owncloud;
    mysql>  CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'password';
    mysql>  GRANT ALL ON owncloud.* to owncloud@localhost;
    mysql>  FLUSH PRIVILEGES;
    mysql>  exit


PHP:

We will install basic php and also certain modules required for ownCloud. All those modules are mentioned along with php installation command. Once done, we check for the version installed.

1. sudo apt-get install php php-cgi libapache2-mod-php php-common php-pear php-mbstring  php-curl php-json php-xml php-gd php-zip php-intl php-mysql

2. php -v

(2) Installation of ownCloud:

This is not exact installation, but just similar to cloning the repository to the local system. Use the following commands to create ownCloud folder inside Apache server. We also change permission for accessing owncloud and the associated data / storage folder. 

We download the resource to tmp folder and extract it to var/www/html folder and change permission there. After doing it, we simply remove the tar file from tmp folder to free up space.

ownCloud:

1. cd /tmp

2. wget https://download.owncloud.org/community/owncloud-10.0.7.tar.bz2

3. cd /var/www/html

4. sudo tar xjf /tmp/owncloud-10.0.7.tar.bz2

5. sudo chown -R www-data:www-data owncloud

6. sudo chmod -R 755 owncloud

7. sudo rm -f /tmp/owncloud-10.0.7.tar.bz2

8. cd


(3) Setting up ownCloud:

Open your browser.

1. Go to http://localhost/owncloud

     You will see a page as below:




2. Create Admin account:

      username: admin
      password: admin

3. Leave Data folder as it is

4. Configure database as follows:

       Database user: owncloud
       Database password: password   (as created in mysql prompt)
       Database name: owncloud
       localhost

     

5. Click Finish set up 

6.  You will directed to the login page as below:



7. Login with admin account credentials

8. You will be taken to the ownCloud main interface page as below:

   


Thus, you have ownCloud in your system 


Note:

1. For Host - If you have openstack previously installed, http://localhost/ will automatically redirect to openstack dashboard since openstack and ownCloud share the same host-ip in a single system.
So you have to unstack openstack, delete all concerned files and restart system. Then start installing ownCloud from scratch scratch. 

2. For VM - Its better that you create a new VM and start installing ownCloud from scratch.

--------------------------------------------------------------------------------------------------------------------------

Uninstall Process of ownCloud:

Sometimes http://localhost/ had to be freed up for other works.

Uninstall ownCloud:

To uninstall ownCloud, simply deleting the owncloud folder in var/www/html will remove it.

But real uninstall sometimes needs Apapche, MySQL and PHP also to be removed.

Execute the following commands to completely remove them from your system.

Uninstall PHP:

$ sudo apt-get purge php php-cgi libapache2-mod-php php-common php-pear php-mbstring  php-curl php-json php-xml php-gd php-zip php-mysql

$ sudo apt-get autoremove

$ whereis php
   php: /etc/php

(if path is shown, remove all paths)

$ sudo rm -rf /etc/php


Uninstall MySQL:

$ sudo systemctl status mysql

$ sudo apt-get purge mysql-server

$ sudo apt-get autoremove

$ whereis mysql
   mysql: /etc/mysql

$ sudo rm -rf /etc/mysql


Uninstall Apache2:

$ sudo systemctl stop apache2

$ sudo apt-get purge apache2

$ sudo apt-get autoremove

$ whereis apache2
   apache2: /etc/apache2

$ sudo rm -rf /etc/apache2

check http://localhost/   -  it shows nothing

Note:
when you check with:
whereis php => php:
whereis mysql => mysql:
whereis apache2 => apache2:

it means all related files have been removed.

Comments