OwnCloud Installation on Debian

Nick's picture

OwnCloud is a file sharing platform like DropBox or similar services.  They have paid enterprise solutions and free open source offerings.  Go to https://owncloud.org/ to learn more about the open source choices.  They let you install the system on your own server giving you complete and total control over the files.  This is especially good if security is a concern or privacy is needed.  I was exploring this solution for a file sharing solution that I didn't have to upload out of the building to send large files to clients.

Server Setup

Install Debian with at least Web Server selected.  I installed everything on the list except Print Server and DNS Server.

After getting Debian up and running, (for Debian 7.0) run the following as root:

echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list
apt-get update
apt-get install owncloud

To add the key to apt, do this (not manditory).

wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key
apt-key add - < Release.key

By default, the files for OwnCloud are placed in /var/www/owncloud.  So, if your site was example.com, you would access it through example.com/owncloud.

Not Recommended:

I like to not have the /owncloud in the URL, so I move all the files ../ (don't forget .htaccess!).

Installation Wizard and Configuration

Navigate to the setup wizard web page (example.com/owncloud) of your OwnCloud installation.  You will be prompted for username, password and database options.

Some other config happens in the admin menus of OwnCloud.  Go to settings/personal to set your admin email address.  Next, setup other admin stuff at settings/admin.  Here I get an error message about default_charset in php.ini, you can edit the file here /etc/php5/apache2/php.ini.  Uncomment the default_charset line to look like this:

; PHP's default character set is set to empty.

; http://php.net/default-charset

default_charset = "UTF-8"

Next, setup the mail server.  Its also on the settings/admin page.  Populate it with your SMTP settings you use for email.  I found it was easier to use another server's SMTP (like gmail) to work easily.  (One thing I did not like was the password for your SMTP server is saved as plain text in /var/www/owncloud/config/config.php!!!)

Changing file upload limits.  My default install limited uploads to 2Mb.  That's not super useful...  So, there are 2 things we need to change.  First is /etc/php5/apache2/php.ini and the other is /var/www/owncloud/.htaccess.  I changed mine to 16G.

Default parameters in /etc/php5/apache2/php.ini

php_value upload_max_filesize 2M

php_value post_max_size 8M

php_value memory_limit 128M

php_value max_input_time 3600

php_value max_execution_time 3600

upload_tmp_dir = /var/big_temp_file/

Default parameters in /var/www/owncloud/.htaccess

php_value upload_max_filesize 513M

php_value post_max_size 513M

php_value memory_limit 512M


Output Buffering must be turned off in .htaccess or .user.ini or php.ini, or PHP will return memory-related errors:

output_buffering = 0


changed  /etc/php5/apache2/php.ini to upload_max_filesize=16G


changed  /etc/php5/apache2/php.ini to post_max_size=16G


not sure why it isn't 513M?...?






You may distribute a set of default files and folders to all users by placing them in the owncloud/core/skeleton directory on your ownCloud server. These files appear only to new users after their initial login, and existing users will not see files that are added to this directory after their first login. The files in the skeleton directory are copied into the users’ data directories, so they may change and delete the files without affecting the originals.


To integrate with dropbox, log in to your developer page and create a new app with the DropBox API.  Add the keys to the admin page on OwnCloud.



Apache config file to /etc/apache2/conf.d/owncloud.confwhich contains an Alias to the owncloud installation directory as well as some more needed configuration options.

because i changed owncloud to the root folder

# Alias /owncloud "/var/www/owncloud/"

<Directory "/var/www">

    Options +FollowSymLinks

    AllowOverride All


    <IfModule mod_dav.c>

      Dav off



    SetEnv HOME /var/www         

    SetEnv HTTP_HOME /var/www         



<Directory "/var/www/data/">

  # just in case if .htaccess gets disabled

  Require all denied