{"id":7274,"date":"2019-01-07T15:11:00","date_gmt":"2019-01-07T15:11:00","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=7274"},"modified":"2019-01-08T13:22:59","modified_gmt":"2019-01-08T13:22:59","slug":"how-to-install-and-configure-owncloud-with-apache-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/07\/how-to-install-and-configure-owncloud-with-apache-on-ubuntu-18-04\/","title":{"rendered":"How To Install and Configure ownCloud with Apache on Ubuntu 18.04"},"content":{"rendered":"<p><a href=\"https:\/\/owncloud.org\/\">ownCloud<\/a> is an open source, self-hosted file sync and file share platform, similar to Dropbox, Microsoft OneDrive and Google Drive. ownCloud is extensible via apps and has desktop and mobile clients for all major platforms.<\/p>\n<p>In this tutorial we\u2019ll show you how to install and configure ownCloud with Apache on an Ubuntu 18.04 machine.<\/p>\n<h2>Prerequisites<\/h2>\n<p>You\u2019ll need to be logged in as a <a href=\"\/post\/how-to-create-a-sudo-user-on-ubuntu\/\">user with sudo access<\/a> to be able to install packages and configure system services.<\/p>\n<h2>Step 1: Creating MySQL Database<\/h2>\n<p>ownCloud can use SQLite, Oracle 11g, <a href=\"\/post\/how-to-install-postgresql-on-ubuntu-18-04\/\">PostgreSQL<\/a> or MySQL database to store all its data. In this tutorial we will use MySQL as a database back-end.<\/p>\n<p>If MySQL or MariaDB is not installed on your Ubuntu server you can install by following one of the guides below:<\/p>\n<ul>\n<li><a href=\"\/post\/how-to-install-mysql-on-ubuntu-18-04\/\">Install MySQL on Ubuntu 18.04<\/a><\/li>\n<li><a href=\"\/post\/how-to-install-mariadb-on-ubuntu-18-04\/\">Install MariaDB on Ubuntu 18.04<\/a><\/li>\n<\/ul>\n<p>Start by login in to the MySQL shell by typing the following command:<\/p>\n<p>From inside the mysql console, run the following SQL statement to <a href=\"\/post\/how-to-create-a-mysql-database\/\">create a database<\/a>:<\/p>\n<p>CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;<\/p>\n<p>Next, create a <a href=\"\/post\/how-to-create-mysql-user-accounts-and-grant-privileges\/\">MySQL user account and grant access<\/a> to the database:<\/p>\n<p>GRANT ALL ON owncloud.* TO &#8216;owncloudsuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;change-with-strong-password&#8217;;<\/p>\n<p>Finally, exit the mysql console by typing:<\/p>\n<h2>Step 2: Installing PHP and Apache<\/h2>\n<p>ownCloud is a PHP application. PHP 7.2 which is the default <a href=\"\/post\/how-to-install-php-on-ubuntu-18-04\/\">PHP in Ubuntu 18.04<\/a> is fully supported and recommended for ownCloud.<\/p>\n<p>Install Apache and all required PHP extensions using the following command:<\/p>\n<p>sudo apt install apache2 libapache2-mod-php7.2 openssl php-imagick php7.2-common php7.2-curl php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-pgsql php-smbclient php-ssh2 php7.2-sqlite3 php7.2-xml php7.2-zip<\/p>\n<h2>Step 3: Configuring Firewall<\/h2>\n<p>Assuming you are using <a href=\"\/post\/how-to-setup-a-firewall-with-ufw-on-ubuntu-18-04\/\">UFW<\/a> to manage your firewall, you\u2019ll need to open HTTP (80) and HTTPS (443) ports. You can do that by enabling the \u2018Apache Full\u2019 profile which includes rules for both ports:<\/p>\n<p>sudo ufw allow &#8216;Apache Full&#8217;<\/p>\n<h2>Step 4: Downloading ownCloud<\/h2>\n<p>At the time of writing this article, the latest stable version of ownCloud is version 10.0.10. Before continuing with the next step visit the <a href=\"https:\/\/owncloud.org\/download\/\">ownCloud download page<\/a> and check if there is a new version of ownCloud available.<\/p>\n<p>Use the following <a href=\"\/post\/wget-command-examples\/\">wget command<\/a> to download the ownCloud zip archive:<\/p>\n<p>wget https:\/\/download.owncloud.org\/community\/owncloud-10.0.10.zip -P \/tmp<\/p>\n<p>Once the download is complete, <a href=\"\/post\/how-to-unzip-files-in-linux\/\">extract the archive<\/a> to the \/var\/www directory:<\/p>\n<p>sudo unzip \/tmp\/owncloud-10.0.10.zip -d \/var\/www<\/p>\n<p><a href=\"\/post\/linux-chown-command\/\">Set the correct ownership<\/a> so that the Apache web server can have full access to the ownCloud\u2019s files and directories.<\/p>\n<p>sudo chown -R www-data: \/var\/www\/owncloud<\/p>\n<h2>Step 5: Configuring Apache<\/h2>\n<p>Open your text editor and create the following Apache configuration file.<\/p>\n<p>sudo nano \/etc\/apache2\/conf-available\/owncloud.conf<\/p>\n<p>\/etc\/apache2\/conf-available\/owncloud.conf<\/p>\n<p>Alias \/owncloud &#8220;\/var\/www\/owncloud\/&#8221;<\/p>\n<p>&lt;Directory \/var\/www\/owncloud\/&gt;<br \/>\nOptions +FollowSymlinks<br \/>\nAllowOverride All<\/p>\n<p>&lt;IfModule mod_dav.c&gt;<br \/>\nDav off<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>SetEnv HOME \/var\/www\/owncloud<br \/>\nSetEnv HTTP_HOME \/var\/www\/owncloud<\/p>\n<p>&lt;\/Directory&gt;<\/p>\n<p>Enable the newly added configuration and all required Apache modules with:<\/p>\n<p>sudo a2enconf owncloud<br \/>\nsudo a2enmod rewrite<br \/>\nsudo a2enmod headers<br \/>\nsudo a2enmod env<br \/>\nsudo a2enmod dir<br \/>\nsudo a2enmod mime<\/p>\n<p>Activate the changes by restarting Apache service:<\/p>\n<p>sudo systemctl reload apache2<\/p>\n<h2>Step 6: Installing ownCloud<\/h2>\n<p>Now that ownCloud is downloaded and all necessary services are configured open you browser and start the ownCloud installation by visiting your server\u2019s domain name or IP address followed by \/owncloud :<\/p>\n<p>http:\/\/domain_name_or_ip_address\/owncloud<\/p>\n<p>You will be presented with the ownCloud setup page.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/lxer.com\/post\/how-to-install-and-configure-owncloud-on-ubuntu-18-04\/install-owncloud-ubuntu.jpg\" alt=\"\" \/><\/p>\n<p>Enter your desired admin username and password and the MySQL user and database details you previously created.<\/p>\n<p>Click on the Finish setup button and once the installation process is completed you will be redirected to the ownCloud dashboard logged in as admin user.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/lxer.com\/post\/how-to-install-and-configure-owncloud-on-ubuntu-18-04\/owncloud-dashboard.jpg\" alt=\"\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>You have learned how to install and configure ownCloud on your Ubuntu 18.04 machine. If you have a domain name associated with your ownCloud server, you can follow this guide and secure your <a href=\"\/post\/secure-apache-with-let-s-encrypt-on-ubuntu-18-04\/\">Apache with Let\u2019s Encrypt<\/a>.<\/p>\n<p>To find more information about how to manage your ownCloud instance visit the <a href=\"https:\/\/doc.owncloud.com\/server\/index.html\">ownCloud documentation<\/a> page.<\/p>\n<p>If you have any question, please leave a comment below.<\/p>\n<p><a href=\"http:\/\/lxer.com\/module\/newswire\/ext_link.php?rid=264508\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ownCloud is an open source, self-hosted file sync and file share platform, similar to Dropbox, Microsoft OneDrive and Google Drive. ownCloud is extensible via apps and has desktop and mobile clients for all major platforms. In this tutorial we\u2019ll show you how to install and configure ownCloud with Apache on an Ubuntu 18.04 machine. Prerequisites &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/07\/how-to-install-and-configure-owncloud-with-apache-on-ubuntu-18-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Install and Configure ownCloud with Apache on Ubuntu 18.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7274","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=7274"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7274\/revisions"}],"predecessor-version":[{"id":7613,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7274\/revisions\/7613"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=7274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=7274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=7274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}