Installing owncloud in Ubuntu 13.04
In this tutorial we will learn how to install owncloud in ubuntu 13.04.
Step 1: Update the apt repo source list
sudo echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_13.04/ /' >> /etc/apt/sources.list.d/owncloud.list
Step 2: Now add the repository key to apt
sudo wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_13.04/Release.key apt-key add - < Release.key
Step 3: Update the system
sudo apt-get update
Step 4: Install the owncloud
sudo apt-get install owncloud apache2 mysql-server php5 php5-mysql
Step 5: Now edit the owncloud.conf file
linux@tuxworld:~$ sudo su - [sudo] password for linux: root@tuxworld:~# root@tuxworld:~# cd /etc/apache2/conf.d/ root@tuxworld:/etc/apache2/conf.d# cp -p owncloud.conf owncloud.conf.orig Now edit the owncloud.conf like given below root@tuxworld:/etc/apache2/conf.d# vi owncloud.confAllowOverride All order allow,deny Allow from all root@tuxworld:/etc/apache2/conf.d# Now restart the apache also root@tuxworld:/etc/apache2/conf.d# /etc/init.d/apache2 restart
Step 6: Now create user and database in mysql and give privileges to the user
root@tuxworld:~# mysql -u root -p Enter password: mysql> create database ownlcoud; mysql> CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'password'; mysql> GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost'; mysql> flush privileges; mysql> exit;
Step 7: Open the owncloud console in web browser (firefox,chrome etc.)
http://localhost/owncloud
Now you will get the owncloud console like this in web browser
Step 8 : Fill all the required field in owncloud page. And click on Finish Setup button.
Now you will be directly login into the owncloud console page.Try uploading some files and check is everything working or not.
This is the final step, now you can start uploading and sharing the files through owncloud console.
John says
Thanks for the tutorial. A newbie here, I have tried this on Ubuntu 13.10 and several other owncloud tutorials but still I get No Found in the browser. Is there some thing obvious? I have Apacje running and PHPMYADMIN where I can see the database
sharad chhetri says
Welcome John,I would be very helpful in troubleshooting if I get more details like what is the error you are getting on webpage.
Kindly share your details as follows
(1)owncloud.conf file
(2) Check the Document Root path where owncloud files are installed eg. /var/www/owncloud
(3) The hostname of MySQL server, from your server are you able to connect the MySQL server, To check you can use this command – mysql -h ip-address-of-mysql-server -u username -p password
Robert Peake says
Please delete the previous comment which posted, I think, when I double-clicked on some text.
Thanks for your explanation. I assume, from the code:
GRANT ALL ON owncloud.* TO ‘ownclouduser’@’localhost’
that the ownCloud MySQL database administrator requires full (DBA) privileges, but that these should be limited to the owncloud database. There seems to be some confusion in this area. I have even seen posts indicating that full MySQL root privileges have been granted to the owncould administrative account. I think some guidance is needed, and I applaud your idea of devoting some time to the database aspects of owncould!
sharad chhetri says
your last comment is deleted. Creating new user and giving privileges at particular database is widely use in all application. It is recommended to do not use mysql root user for connecting database. As I explained why we should not use root because of security.
Prevention is better than cure. Hence do not use root user because root has all privileges. The root password should not be disclosed to anyone as well as not to be written in config files.
Robert Peake says
A few questions about the instructions for setting up a MySQL database for ownCloud: What is the admin account? Specifically, is it the root account for MySQL or a separate administrative account created especially for owncloud? Furthermore, must it be a pre-existing account or will owncloud create it, as the web page seems to suggest? What privileges must the account provide? Likewise, what privileges must the ownclouduser acount provide? Finally, is the ownclouduser intencded to be the administrator for the owncloud database or an account that is provided for owncloud users to access the owncloud server? The newbies among us are easily confused.
sharad chhetri says
(1) What is the admin account?
Answer: Admin account in mysql is root
(2) Specifically, is it the root account for MySQL or a separate administrative account created especially for owncloud?
Answer: In any database server we can create a new user and assign limited or administrative privileges to it. We can specify role limitation to database user as per Database privileges also.This is a short brief of your question.
So lets see the example, Which I have written in Step 6 in this post-
=> I login with user root of mysql server which is bydefault first user and administrator of mysql server.
=> I newly created a user called owncloud and set the password . In mysql either you can create a user first and set password later OR create a user and along with set the password in one line. I used the same here, one liner command eg. “CREATE USER ‘ownclouduser’@’localhost’ IDENTIFIED BY ‘password’;”
=> Then I use the Grant command to provide ALL Privileges to user called ownclouduser in Database called owncloud (database is created by command ‘create database database_name’)
=> At the end I use the flush privileges. I use flush privileges command because when mysql server start it reads all grant table contents into memory. By using command flush privileges we instruct mysql server to reload the grant settings.
You can read more details from this link http://dev.mysql.com/doc/refman/5.0/en/privilege-changes.html
(3) ownclouduser intended to be the administrator for the owncloud database or an account that is provided for owncloud users to access the owncloud server?
Answer: It is always good to create a new user and grant privileges as per requirement only to specific database.Using root credentials in configuration file is not a good idea. If there is any security breach in Server or the configuration file is compromised there is more chance the Database server is easily hacked and entire database damage.
Here we are giving privilege to specific user in limited database hence if any such thing happen our other database will be safe.
I hope these above given answers can clear your doubts. If doubt is not clear let me know I will try to elaborate more.
I think now I should concentrate on Database section of my blog it has been dormant for long time.
Sidney says
Thanks for this great how-to. I’ve been struggling to get ssl working with this setup. Do you think maybe you could give it a crack and post your efforts here?
Thanks again!
admin says
Yes Sidney soon I will post on how to setup SSL in owncloud.
admin says
Sidney, for ssl configuration with owncloud has been posted. You can find the answer from this link https://sharadchhetri.com/2013/05/24/how-to-configure-self-signed-ssl-certificate-in-owncloud-ubuntu/