The lines that the user needs to enter or customize will be in red in this tutorial! The rest should mostly be copy-and-pastable.
ownCloud is an open source Data Storage solution similar to Dropbox or Google Drive. One can grab its source code and install it anywhere he/she wants and thus gain much more control over his/her data.
The latest version of ownCloud as of this writing is 5.0.4 and that version will be installed in this tutorial.
First off, we need a LAMP (Linux, Apache, MySQL and PHP) stack in order to run ownCloud 5. Before installing it, we should perform a few system updates and upgrades.
sudo apt-get update sudo apt-get upgrade
Next, we install the actual LAMP stack with the following command:
sudo apt-get install lamp-server^
Note the "^" character at the end of the package name, it is important to type it for the LAMP stack to be installed properly. The setup will prompt you for the MySQL root password, be sure to enter something sensible and easy to remember.
That's it, now we have a fully working LAMP stack on our VPS.
Although ownCloud can use SQLite to store its data, in this tutorial, we will use MySQL database for ownCloud's internal data as MySQL is way faster than SQLite.
Type the following to run MySQL secure installation:
sudo mysql_secure_installation
It will prompt you for your MySQL root password. Enter the password you entered upon installation of LAMP stack.
It will ask you to change root password, type "n" for no.
It will ask you to remove anonymous users, type "y" for yes.
It will ask you to disallow remote root logins, type "y" for yes.
It will ask you to remove test database and access to it, type "y" for yes.
It will ask you to reload privilege tables, type "y" for yes.
Now we have a secure MySQL installation in place.
Before we can fully utilize ownCloud, we need to install additional libraries that will be used by ownCloud. Execute the following:
sudo apt-get install php5-gd php-xml-parser php5-intl smbclient curl libcurl3 php5-curl
Ubuntu will install additional libraries, and now we have fulfilled all system requirements for ownCloud to function.
ownCloud uses Apache's .htaccess files (you can find more information on .htaccess here) for security purposes. However, in order to use them, we need to enable two apache modules and edit the apache configuration to allow for the .htaccess file.
Now we need to enable mod_rewrite and mod_headers, the Apache2 modules that are needed for ownCloud to function normally.
The mentioned two modules are used for URL rewrite rules, that is, they help Apache2 rewrite URLs of a certain web site in a proper way. mod_headers module is used for controlling HTTP request and response headers.
To enable mod_rewrite and mod_headers, type the following:
sudo a2enmod rewrite sudo a2enmod headers
Additionally, we have to change Apache2 config file in order for ownCloud rewrite rules to work properly. Execute the following:
sudo nano /etc/apache2/sites-available/default
There, find "<Directory /var/www/>" section and change the following:
AllowOverride None
to
AllowOverride All
Hit Ctrl + X, then Y, and then Enter to save the changes.
Now we need to restart Apache2 for changes to take effect:
sudo service apache2 restart
That’s it, proceed to the next step.
Now we need to download the source files of ownCloud 5 and place them in the corresponding directory in order for a web server to be able to serve requests properly.
To download ownCloud 5.0.4 source files, execute the following:
wget http://download.owncloud.org/community/owncloud-latest.tar.bz2
It will download the latest version of ownCloud 5. Now we need to extract the archive. Execute the following:
tar -xjf owncloud-latest.tar.bz2
Now we need to move ownCloud source files in the appropriate directory. Execute the following:
mv owncloud /var/www
Having ownCloud source files in the right place is nice, but we have to change a few folder permissions for ownCloud to function normally. Execute the following:
cd /var/www sudo chown -R www-data:www-data owncloud
We're almost done, there's only one thing left to do before we begin installation - setting up a proper MySQL database.
First, log in to MySQL with the following command:
mysql -u root -p
It will prompt you for root password, enter the one you entered upon installing LAMP stack.
Next, create a new database with the following command:
CREATE DATABASE owncloud;
Then assign a new user with proper privileges to the new database:
GRANT ALL ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'some_password';
Be sure to replace "some_password" with the actual password you desire for your MySQL database.
Believe it or not, we're done! Type "quit" to exit MySQL interface and point your browser to http://fqdn-of-your-droplet.tld/owncloud to access ownCloud 5 installation.
Be sure to replace "fqdn-of-your-droplet.tld" with the actual FQDN of your droplet.
Then, after the installation dialog opens, fill in the details for the admin account. Next, enter the MySQL database details as you set them up in the previous step and click Finish Setup.
You've reached the end of the tutorial! Enjoy your new ownCloud 5 installation.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’ve had it running on Ubuntu for about six months or so & it works flawlessly. Also Gnome 3.8 now features ownCloud integration directly into the file system (it’s running OK on Fedora 19 Alpha RC4)…
There’s a syntax error in this article.
“Hit Ctrl + X and then Enter to save the changes.” This is not correct. It should say “Hit Ctrl + X, then y and then Enter to save the changes.”.
Perfect, thank you
Hi, new here… I’m a bit lost in this part… " Believe it or not, we’re done! Type “quit” to exit MySQL interface and point your browser to http://fqdn-of-your-droplet.tld/owncloud to access ownCloud 5 installation.
Be sure to replace “fqdn-of-your-droplet.tld” with the actual FQDN of your droplet." Can anybody help? Thanks
@emanon1978 that means you should type “quit” in the MySQL console to exit the console and browse to http://yourdomain.com to access ownCloud 5.
Hi, something has not worked for me. I’ve created a new droplet laghw01 with the application Wordpress on Ubuntu12.10 with a www.lagunaheadwaters.org. Then I’ve followed install instructions for Wordpress including editing nano /etc/apache2/sites-enabled/laghw01 Then installed postfix & phpmyadmin The wordpress installation comes up well Then I’ve installed ownCloud except for the apache_server^ which was already present So I think its being bypassed by wordpress defaulting to /home/wordpress/public_html . Any suggestions on how WordPress and ownCloud work together :) I was thinking of reading up on what I can do in /etc/apache2/sites-available or moving /var/ownCloud into /home/wordpress/public_html? Any suggestions greatly appreciated
Hi I got it working by creating nano /etc/apache2/sites-available/owncloud per http://www.nineproductions.com/owncloud-quick-setup-for-debian/
Automated updates can be obtain by using the package installation method as mentioned on the owncloud install page: http://owncloud.org/install/
openSUSE Build Service hosts the package repositories for all distributions: http://software.opensuse.org/download/package?project=isv:ownCloud:community&package=owncloud
The instructions above work great. Downloadable clients from owncloud.org work. As a cautionary tale, I went down the path of “aptget install owncloud”. Either a partial install or an older version was the result. Ended up deleting all of it out and just following the instructions above.
I did make one addition to the instructions above. I didn’t like user data piling up under /var/www/owncloud/data, so I switched the data directory to /var/lib/owncloud/data. Note that you have to change the /var/www/owncloud/config/config.php to correctly access this location and make sure UID and group are set to www-data.
I am also running davical just fine along side owncloud - both working fine (many comments in forums about webdav of one package interfering with another).
Instead of doing owncloud-5.0.4.tar.bz2 like the article shows, do owncloud-latest.tar.bz2 instead. As it speaks for itself, it will download the latest version of ownCloud. Would save the user time finding out the latest version.