How to install owncloud in Debian Wheezy 7

Installing owncloud in Debian is easy stuff. And hardly take a few minutes to install.I have posted some how to on installing owncloud in CentOS and Ubuntu as well.

The details of Debian server

IP Address:
OS info: Debian GNU/Linux 7 n l
arch: x86_64

To install owncloud in Debian Wheezy 7, follow the given below steps

Step 1 : Login into server and become super user (root)

sudo su -


su -

Step 2: Run the below given command to add repo of owncloud and its repo key.

echo 'deb /' >> /etc/apt/sources.list.d/owncloud.list 

apt-key add - < Release.key  
apt-get update

Step 3: Install owncloud,mysql-server,apache2 and php5

apt-get install owncloud mysql-server apache2 php5

Note: while installation you will get screen of setting mysql root password. Hence set the mysql root password

Step 4: Now enable apache rewrite module.

a2enmod rewrite

Step 5: Login into mysql with user root and create database for owncloud. Here we are also creating owncloud user in mysql and only giving privileges to owncloud database.

Database Name: owncloud
MySQL User name: ownclouduser
Password of MySQL user(ownclouduser): GivePassword

# mysql -u root -p
(give mysql root password)

mysql> create database owncloud;

mysql> create user 'ownclouduser'@'localhost' IDENTIFIED BY 'GivePassword';

mysql> GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost';

mysql> flush privileges;

mysql> exit;

Step 6: Now open the webbrowser and type http://localhost/owncloud OR if you have installed in remote server then http://ip-address/owncloud.
Here I have installed the owncloud in remote server hence I am using debian server ip address
Find the ip address of your server by using ifconfig command.

Set owncloud admin username and password. Here I am using username as admin,you can also use any other name and that username will be admin of owncloud web console.
After setting admin username and password, click on Advanced button and select MySQL


Step 8: Now give all information of mysql database which you have set. And then click on "Finish Setup"


After clicking Finish Setup,you will be redirected to Admin panel of owncloud. This is last step of owncloud server.
Enjoy uploading,downloading and sharing your stuffs.


11 thoughts on “How to install owncloud in Debian Wheezy 7”

  1. Thank you Sharad for the insights. I have tried a few ways of installing ownCloud and still receive the same message:
    After “reading state information” i receive “E: unable to locate package owncloud”. Do you know where this error stems from?

    • Thankyou Eric,

      Definitely we will solve this issue. I need some information from your side –
      1. What is the Debian system (Run the 2 command
      a. cat /etc/issue
      b. arch
      2. I would like to know how many ways have you attempt to install owncloud .

      I believe the problem is related to owncloud-client.

      Meanwhile kindly read this post from owncloud forum

  2. Very useful. But first time I saw php script as plain text when I access http://my.ip/owncloud. You can fix it by installing libapache2-mod-php5

    apt-get install libapache2-mod-php5
    aptitude install libapache2-mod-php5

    I think you should add it 😀

  3. Hey,

    Thank you for this great user friendly tutorial.
    everything working within a few minutes.

    could you make a similair one regarding making owncloud accessible from outside ones home network and maybe include how to set up selfsigned ssl connection.


    • Danke Robert, übersetzte ich Ihren Kommentar und froh zu wissen, dass Sie es verwenden in Ihrer Schule.

      Thankyou Robert, I translated your comment and glad to know you are using it in your school.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.