In this tutorial we will learn about, how to install Owncloud 6 on Ubuntu 14.04 LTS Server. Owncloud now a days very popular in Internet World. It is one the awesome alternate for Drop Box. Moreover it is free and Open Source software, primarily using for ‘file hosting’.
In case you are looking for creating your Own file hosting Server, Owncloud is more suitable for you. It is free and Open source, has many great features.
You can find many apps developed by Owncloud team and many volunteers in owncloud apps repository. You can also write the apps for Owncloud and submit in the repository . It will be great help to Owncloud community.
Currently, Owncloud has released version 6 series. You can read about the new features of Owncloud 6 from this link.
Installing Owncloud 6 on Ubuntu 14.04 LTS Server (Trusty Tahr)
In this practical, the installation has been done on Single Server, where Owncloud, Apache and MySQL are installed.
Requirements :
(1) Database Server : MySQL (version 5.6)
(2) Web Server : Apache (version 2.4)
(3) Operating System : Ubuntu 14.04 LTS Server Edition
(4) Web Application : Owncloud version 6.x
(5) Knowledge of IP based and Name based Virtual Hosting in Apache
Follow the given below steps to install Owncloud 6 on Ubuntu 14.04 LTS (Trusty Tahr)
(Step 1): Install MySQL Server
You can install MySQL 5.6 on Ubuntu 14.04 LTS . At the time of writing this post, it is the latest and stable release. The latest MySQL 5.6 version is available in Ubuntu repository, hence it can be installed via using apt-get command .
sudo apt-get update sudo apt-get install mysql-server-5.6
(Step 2) : Create MySQL user for Owncloud server
Now create mysql user for Owncloud server. The MySQL user will help the Owncloud Server to connect with Database. We also give full privilege to this MySQL user on Owncloud’s database.
The given below are the details which will create in MySQL Server.
Database Name : owncloud
MySQL User Name : ownclouduser
MySQL User’s Password : Password
Login into MySQL Server with root user (Use MySQL root password here).
mysql -u root -p After login you will get the mysql prompt like this mysql > Now create a user and set the password. Use strong password mysql> CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'Password'; create database called owncloud mysql> create database owncloud; Grant privileges to owncloud user in owncloud database mysql> GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost'; mysql> flush privileges; mysql> exit
( Step 3 ): Install Apache and PHP
For web server requirement, we are installing Apache . The Owncloud is PHP based application, hence we will install PHP version 5 . To connect PHP code with MySQL database, we will install the module named as php5-mysql.
sudo apt-get install apache2 php5 php5-mysql
(Step 4 ) : Enable rewrite module
The Owncloud application has .htaccess file which has some rewrite rules. Use below given command to enable rewrite module
sudo a2enmod rewrite sudo service apache2 restart
(Step 5 ): Install Owncloud Server
Now in this step we will install owncloud package on Ubuntu 14.04 LTS
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list" wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key sudo apt-key add - < Release.key sudo apt-get update sudo apt-get install owncloud
( Step 6 ): Move Owncloud data directory
By default, after installation of Owncloud its data directory is saved in /var/www .
In Ubuntu 14.04, default Apache 2.4 is shipped. You can see defualt DocumentRoot as /var/www/html in Apache 2.4 (Ubuntu 14.04 LTS) , which is different than previous Ubuntu version (Earlier it was only /var/www)
Move the Owncloud data directory to /var/www/html
sudo mv /var/www/owncloud /var/www/html
(Step 7 ) : Configuring owncloud.conf file
By default, you will get owncloud.conf file in /etc/apache2/conf.d after owncloud installation.
Here we will do some changes, so that it should work with Apache 2.4 version
Take backup of original owncloud.conf file.
sudo cp -p /etc/apache2/conf.d/owncloud.conf /etc/apache2/conf.d/owncloud.conf.orig.`date +%F`
Move owncloud.conf file to /etc/apache2/sites-enabled
mv /etc/apache2/conf.d/owncloud.conf /etc/apache2/sites-enabled
Unlink the default Apache Configuration file, known as 000-default.conf
Note: 000-default.conf is softlink
sudo unlink /etc/apache2/sites-enabled/000-default.conf
Edit the owncloud.conf file as given below .
YOU HAVE TWO OPTIONS EITHER CONFIGURE WITH IP BASED VIRTUAL HOST or NAME BASED VIRTUAL HOST.
I AM WRITING BOTH METHOD. YOU HAVE TO SELECT ONLY ONE METHOD TO EDIT owncloud.conf FILE
IP based Virtual Host
For configuring Apache we use IP Address of Server here. Which you can obtain by using ifconfig
command
sudo vi /etc/apache2/sites-enabled/owncloud.conf
Paste given below contents in owncloud.conf file. NOTE: Replace 192.168.56.101 with your Server IP Address
ServerAdmin webmaster@localhost DocumentRoot /var/www/html/owncloud ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined AllowOverride All Require all granted
OR
Name based Virtual Hosting
In case you have Domain name, you can use Name based Virtual Hosting .
sudo vi /etc/apache2/sites-enabled/owncloud.conf
Paste given below contents in owncloud.conf file. NOTE: Replace owncloud.example.com with your domain name.
ServerAdmin webmaster@localhost DocumentRoot /var/www/html/owncloud ServerName owncloud.example.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined AllowOverride All Require all granted
(Step 8): Restart apache service
After doing configuration, restart apache service.
sudo service apache2 restart
( Step 8 ): Installing Owncloud through Web Interface
* Open the Owncloud URL in Web Browser .
* Give Owncloud Dashboard administrator user name. We have given the name as "admin"
* Click on Advanced tab , it will open the Database option. Click on MySQL tab. And give the MySQL credentials, which we have already set up in Step 2
Then, finally click on Finish setup button. And that is it, you are into Owncloud Admin dashboard.
We would like you to explore awesome features of Owncloud. You can give your contribution to Owncloud project, it will be wonderful gift to others.
Hello sir,
Greetings Of the Day!!
I have not installed this owncloud…Before that I want to know whether it can be linked with php virtualbox.If yes, can you tell me how to link them?.
Also, I want to know whether this ownCloud only provides storage. Whether it provides any computation can be done using this ownCloud…..Waiting for valuable reply..
Thanks & Regards,
BeSwed
Hello BeSwed,
You can consider Owncloud as alternate of Dropbox .
I did not get with your question on php virtualbox because php virtualbox is a web interface management for ‘Virtual Box’.
Try installing Owncloud on virtualbox and let us know your feedback.
Regards
Sharad
i followed all the steps and i was able to acess to owncloud but how to acess from example.com/ownclound instead of example.com, i have no much experience on this, thank you
Hello Kantu,
Follow the steps for “Name based Virtual Hosting”,it is written in tutorial.
example.com we have taken as an example only. You must have your own registered domain. just like sharadchhetri.com.
Thanks and Regards
Sharad
hi there i followed your instructions, worked well, tnx!
but today i wanted to upgrade my installation to the latest version using the owncloud update-center, but i get an error which means that there are rights missing to write the files,..
did anyone else find this problem?
Hello Max,
Thanks for reporting this issue.
I will reproduce the problem in my testing machine will work on it.
Seems may be while updating it is looking for /var/www/html location .
Regards
Sharad
seems that privileges for the owncloud directory are missing: sudo chown www-data:www-data -R /var/www/html/owncloud
then it works
Welcome Max.
Thanks for the tutorial, at least I’ve got OC working after a fashion.
There is a typo in the ‘wget’ call in Step 5; there should be a ‘/’ (slash) between ‘isv:’ and ‘owncloud’, it should read. ‘…..isv:/owncloud….’.
Advice to anyone intending to install OC on a fresh Ubuntu 14.04 install is to include the ‘LAMP’ server from the list of available options during o.s. installation. It avoids the dependency problems associated with installing individual packages (apache2, php, etc.) later.
My own problem is that installing OC in the way recommended in this tutorial does away with the default apache index page. Earlier versions were called by ‘http://192.168.x.x/owncloud’ but installing this way requires ‘http://192.168.x.x’, doing away with the apache index page.
ThankYou David.
And also thanks for suggestion
Regards
Sharad
I am new to this and trying to set up owncloud on my Ubuntu 14.04 server. I have followed your directions up to the point where you are supposed to install owncloud via apt-get. I keep getting the error:
The following packages have unmet dependencies:
owncloud : Depends: php (>= 5.3.3) but it is not installable
Recommends: php5-apc but it is not installable
E: Unable to correct problems, you have held broken packages.
Any advice is welcome, I have tried to install php5-apcu and php5-apc via apt-get and it still will not install own cloud
I have also checked the version of php5 by php5 –version and it showed that I have 5.5.9
Hello Jesse,
Welcome in my blog.
Run the command
cat /etc/issue
I suspect you are using Ubuntu 14.04 Desktop Edition. Actually the post is written for Server Edition.
Kindly let me know the details, we will surely overcome from this issue
Regards
Sharad
Sharad,
Thank you for your quick response. I am positive that I have installed the Ubuntu Server edition on the machine I am working on. But I seemed to have resolved my issue. I started trying to follow another tutorial (https://www.youtube.com/) and there was a few packages that were recommended and after installing those I was able to install owncloud via apt-get. The packages were:
sudo apt-get install php5-gd php-xml-parser php5-intl smbclient curl libcurl3 php5-curl php5-ldap
Thanks again and great blog!
Thankyou Jesse,
Your comment will help other readers if face similar issue like yours.
Appreciate for sharing the command.
Thanks and Regards
Sharad