{"id":11806,"date":"2021-11-09T04:04:11","date_gmt":"2021-11-09T04:04:11","guid":{"rendered":"https:\/\/linuxways.net\/?p=11806"},"modified":"2021-11-16T13:13:57","modified_gmt":"2021-11-16T13:13:57","slug":"how-to-install-owncloud-on-ubuntu","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-owncloud-on-ubuntu\/","title":{"rendered":"How to Install OwnCloud on Ubuntu"},"content":{"rendered":"<p>OwnCloud is an open-source application that lets users sync and shares their files from anywhere, and from any device. It lets users take control of their data by not relying on third-party data hosting services. Similar to other online cloud storage services, OwnCloud also allows you to sync your files via web browser, desktop and mobile app. OwnCloud desktop client is available for, Mac, Windows, and Linux systems and the mobile app is available for Android and iOS devices.<\/p>\n<p>In today\u2019s post, we will install OwnCloud on <strong>Ubuntu 20.04<\/strong> <strong>LTS<\/strong>.<\/p>\n<h2>Step 1: Installing Prerequisites<\/h2>\n<p>First, we will install some prerequisites which include LAMP stack packages and some additional PHP libraries. Use the commands below for the installation of these packages:<\/p>\n<p>To install Apache server, use the command below:<\/p>\n<pre>$ sudo apt install apache2<\/pre>\n<p>Then install MariaDB server:<\/p>\n<pre>$ sudo apt install mariadb-server<\/pre>\n<p>Then install PHP and some other prerequisites:<\/p>\n<pre>$ sudo apt install wget coreutils libapache2-mod-php php-imagick php-common php-zip php-curl php-gd php-imap php-intl php-json php-mysql php-redis redis-server php-mbstring php-ssh2 php-xml php-apcu<\/pre>\n<p>Enter sudo password. If it prompts with <strong>y\/n<\/strong>, press <strong>y <\/strong>and then<strong> Enter <\/strong>key.<\/p>\n<h2>Step 2: Configuring Database<\/h2>\n<p>In this step, we will first secure MariaDB installation and then we will configure the database and a user for OwnCloud.<\/p>\n<p>To enhance the security of the MariaDB database, we will need to run the mysql_secure_installation shell script:<\/p>\n<pre>$ sudo mysql_secure_installation<\/pre>\n<p>After running the above command, you will be asked for the current root password, press <strong>Enter<\/strong>. Then set a password for the root account by hitting the<strong> y<\/strong> key and entering the new password twice.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"488\" class=\"wp-image-11810\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-57.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-57.png 705w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-57-300x208.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/p>\n<p>For all the next questions, hit <strong>the y<\/strong> key.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"534\" class=\"wp-image-11812\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-59.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-59.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-59-300x221.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p>Login to MySQL using the command below:<\/p>\n<pre>$ sudo mysql -u root -p<\/pre>\n<p>Now we will create the database and a user for OwnCloud and assign this user the necessary permissions. Other than the database and user name used here, you can use different names.<\/p>\n<p>Then to create a database named <strong>mycloud, <\/strong>use the command below:<\/p>\n<pre>$ CREATE DATABASE mycloud;<\/pre>\n<p>Then create a user named <strong>clouduser<\/strong> with password <strong>tintin. <\/strong><\/p>\n<pre>$ CREATE USER 'clouduser'@'localhost' IDENTIFIED BY \u2018tintin\u2019;<\/pre>\n<p>Then grant the database user <strong>clouduser<\/strong> permissions on the database <strong>mycloud<\/strong>:<\/p>\n<pre>$ GRANT ALL ON mycloud.* TO 'clouduser'@'localhost' WITH GRANT OPTION;<\/pre>\n<p>Then apply the changes and exit the MySQL shell using the commands below:<\/p>\n<pre>\r\n$ FLUSH PRIVILEGES;\r\n\r\n$ EXIT;\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"529\" class=\"wp-image-11821\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-65.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-65.png 873w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-65-300x182.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-65-768x465.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/p>\n<h2>Step 3: Installing OwnCloud<\/h2>\n<p>Now we will download the OwnCloud server zip package from its official <a href=\"https:\/\/owncloud.com\/download-server\/\">website<\/a>. Or you can use the command below for downloading the OwnCloud server latest version (as of <strong>July 21, 2021).<\/strong><\/p>\n<pre>$ wget https:\/\/download.owncloud.org\/community\/owncloud-complete-20210721.zip<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1239\" height=\"246\" class=\"wp-image-11826\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-71.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-71.png 1239w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-71-300x60.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-71-1024x203.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-71-768x152.png 768w\" sizes=\"auto, (max-width: 1239px) 100vw, 1239px\" \/><\/p>\n<p>Now extract the downloaded zip file in to <strong>\/var\/www<\/strong> directory.<\/p>\n<pre>$ sudo unzip owncloud-complete-20210721.zip -d \/var\/www\/<\/pre>\n<p>The zip file contents will be extracted to <strong>\/var\/www\/owncloud<\/strong> directory.<\/p>\n<p>Change the ownership of the <strong>\/var\/www\/owncloud<\/strong>\/.<\/p>\n<pre>$ sudo chown -R www-data:www-data \/var\/www\/owncloud\/<\/pre>\n<p>Also, modify the permissions on the <strong>\/var\/www\/owncloud<\/strong> directory.<\/p>\n<pre>$ sudo chmod -R 755 \/var\/www\/owncloud\/<\/pre>\n<h2>Step 4: Configuring Apache<\/h2>\n<p>In this step, we will configure Apache by creating a virtual host configuration file for OwnCloud. Create the virtual host configuration file as follows:<\/p>\n<pre>$ sudo nano \/etc\/apache2\/conf-available\/owncloud.conf<\/pre>\n<p>Then add the below configuration lines in the file:<\/p>\n<pre>&lt;Directory \/var\/www\/owncloud\/&gt;\r\nAlias \/owncloud \"\/var\/www\/owncloud\/\"\r\n\r\n&lt;Directory \/var\/www\/owncloud\/&gt;\r\n\r\nOptions +FollowSymlinks\r\n\r\nAllowOverride All\r\n\r\n&lt;IfModule mod_dav.c&gt;\r\n\r\nDav off\r\n\r\n&lt;\/IfModule&gt;\r\n\r\nSetEnv HOME \/var\/www\/owncloud\r\n\r\nSetEnv HTTP_HOME \/var\/www\/owncloud\r\n\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>Then save and close the <strong>owncloud.conf<\/strong> file.<\/p>\n<p>Now enable the virtual host configuration file using the command below:<\/p>\n<pre>$ sudo a2ensite owncloud.conf<\/pre>\n<p>Reload Apache configurations using the command below:<\/p>\n<pre>$ sudo systemctl reload apache2<\/pre>\n<p>Now the installation of OwnCloud has been completed, you can access OwnCloud through your web browser.<\/p>\n<h2>Step 5: Configuring OwnCloud<\/h2>\n<p>To access OwnCloud, open the address below in your web browser:<\/p>\n<p><a href=\"https:\/\/IP-address\/owncloud\">https:\/\/IP-address\/owncloud<\/a><\/p>\n<p>Replace <strong>ip-address<\/strong> in above URL with your system\u2019s IP address where OwnCloud server is installed.<\/p>\n<p>After accessing the above address, you will see the below OwnCloud page asking you to create an admin account. Type any username and password for your new admin account.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"425\" class=\"wp-image-11831\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-76.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-76.png 817w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-76-300x156.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-76-768x400.png 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/p>\n<p>Now scroll down to <strong>Storage &amp; database<\/strong> section. Under the <strong>Data folder<\/strong>, you will see the OwnCloud default data directory. Leave this default location as it is.<\/p>\n<p>Under <strong>Configure the database<\/strong> section, provide database username, database password, and the database name we configured in the previous (Step 2: Configuring Database) section. Leave the <strong>database host<\/strong> field as <strong>localhost<\/strong>. Then click <strong>Finish setup<\/strong>. <img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"785\" class=\"wp-image-11839\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-83.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-83.png 818w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-83-300x288.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-83-768x737.png 768w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/p>\n<p>Now you can sign in to your OwnCloud account using the admin credentials you have created in the previous step.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"589\" class=\"wp-image-11844\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-89.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-89.png 821w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-89-300x215.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-89-768x551.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>Once you are logged in, you will see the OwnCloud main interface. Here, you can upload files to your cloud and share with others.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"887\" height=\"608\" class=\"wp-image-11849\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-92.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-92.png 887w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-92-300x206.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-92-768x526.png 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/p>\n<p>That is all there is to it! In today\u2019s post, we installed OwnCloud on Ubuntu OS. Now you can start using your on-premises OwnCloud server. For more information about OwnCloud, visit its official <a href=\"https:\/\/doc.owncloud.com\/server\/10.8\/\">documentation<\/a>.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>OwnCloud is an open-source application that lets users sync and shares their files from anywhere, and from any device. It lets users take control of their data by&hellip;<\/p>","protected":false},"author":1,"featured_media":11852,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-11806","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11806"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11806\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11852"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}