Install OwnCloud Ubuntu

Dixmata Studio
6 min readJan 24, 2022

--

Install OwnCloud Ubuntu. OwnCloud is a software used for File Hosting or File Server services. OwnCloud service is very similar to Cloud Storage such as Nextcloud, Google Drive, Dropbox and other Cloud Storage services. By using OwnCloud, friends can create their own File Server service as needed. OwnCloud is widely used by Private Companies, Government Agencies, and some Universities.

This OwnCloud service can make it easier for friends to store and access personal data anywhere and anytime, as long as there is an internet network. OwnCloud is a free service that can be managed as desired. Although services like Google Drive, Dropbox, Microsoft OneDrive are also free, they have limitations.

Sumber : Install OwnCloud Ubuntu | Dixmata Labs

Owncloud Advantage

  • Open Source
  • Security can be set as needed
  • Easy to store, access and share data/files.
  • Can be accessed via Mobile Smartphone
  • No special restrictions/rules
  • Files are stored encrypted

Precondition

  • OS Ubuntu 20.04, Debian 10/11,
  • Akses root
  • HDD 50GB (Disarankan)
  • RAM 4 GB (Minimal)
  • INSTAL LAMP (Installasi LAMP)

Langkah 1 : Install Apache WebServer (Install OwnCloud Ubuntu)

The function of the web server is to manage websites that are online. To keep things running smoothly, the web server acts as an intermediary between the server machine and the client. The web server pulls content from the server at each user’s request and sends it to the web.

apt update && apt upgrade -y
apt install apache2 -y

By default apache2 is running automatically after being installed and to see the status of apache2 running, you can see with the following command

systemctl status apache2

If the apache2 status is not running, you can run the command below.

systemctl start apache2

If it’s running well, type in your browser the ip address of the server. http://[your-ip-address].

Langkah 2 : Install Php 7.4 (Install OwnCloud Ubuntu)

For php 7.4 on OS Ubuntu 20.04 it can be directly installed without additional repositories. First do the update on the OS

apt update -y
apt install php

Followed by installing the php script.

apt install php php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-mysqli php-intl -y

Automatically installed php is php 7.4. Confirm PHP Version

php -vPHP 7.4.3 (cli) (built: Aug 13 2021 05:39:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Langkah 3 : Creating OwnCloud Database (Install OwnCloud Ubuntu)

If finished installing Apache and PHP, then we continue by creating a database, friends, you can install MySQL 8 at the following link Installing MySQL 8 Installasi MySQL 8

apt install mysql-server && apt install mysql-client -y

Create database security by creating a root password.

mysql_secure_installationConnecting to MySQL using a blank password.VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: No
...
New password: ##Isikan Password
Re-enter new password: ##Konfirmasi Password
..
Remove anonymous users? (Press y|Y for Yes, any other key for No) : ## Enter
..
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : ## Enter
..
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : ## Enter
..
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ## Enter
..

Here’s the Database Name, User and Password that we will create for the Owncloud Database.

Database : OwncloudDB
Username : OwncloudUser
Password : OwncloudPass

Enter the root database server with the following command

sudo mysql -u root -p

fill in the password that has been set using the mysql_secure_installation command. Then create User, Password and Database for OwnCloud

CREATE DATABASE OwncloudDB;
CREATE USER 'OwncloudUser'@'localhost' IDENTIFIED BY 'OwncloudPass';
GRANT ALL PRIVILEGES ON OwncloudDB.* TO 'OwncloudUser'@'localhost';
flush privileges;

When finished exit MySQL:

exit;

Langkah 4 : Download OwnCloud in Ubuntu (Install OwnCloud Ubuntu)

Next we will download the OwnCloud zip file. friends can download it on the OwnCloud Official Website. on Ubuntu you can use the following command.

wget https://download.owncloud.org/community/owncloud-complete-20210721.zip

Then unzip the downloaded file into the Apache directory. i.e. /var/ww/. Install Unzip if the service is not yet available.

apt install unzip

Then unzip

unzip owncloud*

Then move the unzipped owncloud directory into the /var/www

mv owncloud /var/www/

Confirm whether the owncloud directory has moved to the /var/www

ls -la /var/www/

Change the permissions of the owncloud directory to www-data so that the webserver (apache2 ) can write/read in that directory. Follow these commands.

chown -R www-data:www-data /var/www/html/owncloud
chmod -R 775 /var/www/html/owncloud

Step 5 : Create Apache Virtual Server For OwnCloud

After successfully downloading the OwnCloud file and moving it into the Apache directory, now we will create a Virtual Apache, so that OwnCloud can be accessed via a browser, either using an IP Address or using a Domain.

Create an “owncloud.conf” file in the /etc/apache2/sites-available/

nano /etc/apache2/sites-available/owncloud.conf

Then copy the following configuration, into “owncloud.conf”

<VirtualHost *:80>
DocumentRoot "/var/www/owncloud"
ServerName cloud.dixmata.com
ErrorLog ${APACHE_LOG_DIR}/owncloud.error
CustomLog ${APACHE_LOG_DIR}/owncloud.access combined
<Directory /var/www/owncloud/>
Require all granted
Options FollowSymlinks MultiViews
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud/
SetEnv HTTP_HOME /var/www/owncloud/
Satisfy Any
</Directory>
</VirtualHost>

Save, then activate owncloud.conf and some other scripts needed to run Apache and OwnCloud

a2ensite owncloud.conf
a2enmod rewrite
a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime

If the configuration has been completed and the above modules have been activated, now Restart Apache Service

systemctl restart apache2

Step 6: Open OwnCloud Page (Install OwnCloud Ubuntu)

Now all the configurations have been successful, and for the final step to setup the OwnCloud page by opening it in your browser. Open Browser follow these steps

Open with Domain or with IP Address

http://cloud.dixmata.com

or

http://IP-Address-Server/owncloud

If the page has been successfully displayed, fill in the Username and Password for the OwnCloud Admin User. Scroll down the page and we will setup the OwnCloud Database

Do a database setup or enter the Username, Password and Database that we created in Step 3. Look at the picture below.

Then click Finish setup. Wait until the process is complete, until the OwnCloud Login display only appears without Database configuration. When finished, we can login with the Admin user that was created earlier.

If successfully logged in, a page like the following will appear.

Congratulations, friends, you have successfully installed and setup your OwnCloud as a Private Cloud Storage. OwnCloud is very similar to NextCloud, if you want to learn more, you can check Install Nextcloud, from creating SSL and User Groups. That’s all of our documentation, please criticize and suggest, sorry if there are mistakes. Thank you.

--

--

Dixmata Studio

Dixmata Labs adalah website tutorial Belajar Linux Fundamental , Installasi Hardware dan Software yang berkaitan dengan Linux.