Installation OwnCloud on Ubuntu 18.04 / CentOS 8

How to Install OwnCloud on Ubuntu 18.04 / CentOS 8

OwnCloud is free robust open source software that allows you to set up your own cloud syncing, like Dropbox and Onedrive cloud storage, and other cloud storage services out there, unlike the other cloud storage services, OwnCloud is free to use

After ubuntu installation you need to assign the hostname

We also need to allow port in your network firewall

Nano /etc/hosts

After fixing now start to install Owncloud 10.0.5

Steps –

Need to update and upgrade server

shariq@cloud:~$ sudo apt-get update -y

Installing LAMP Server

LAMP stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP

LAMP stands for Linux, Apache, MySQL, and PHP. Together, they provide a proven set of software for delivering high-performance web applications. Each component contributes essential capabilities to the stack

sudo apt-get install lamp-server^ -y

starting and enabling apache

Now here starting & enabling mysql

Starting the mysql installation type the mysql password

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Installing the PHP server libraries

Install PHP and Related Modules

sudo apt-get install php php-opcache php-gd php-curl php-mysqlnd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip -y

sudo systemctl restart apache2

Now that you’ve install all the required packages, continue to start configuring the server

shariq@cloud:~$ sudo mysql -u root -p

Now here creating database

mysql> CREATE DATABASE ownclouddb;

Granting privilege

Create a database user called ownclouduser with new password

CREATE USER ‘ownclouduser’@’localhost’ IDENTIFIED BY ‘Sharique’;

Then grant the user full access to the database.

mysql> GRANT ALL ON owncloud.* TO ‘ownclouduser’@’localhost’ IDENTIFIED BY ‘Sharique’ WITH GRANT OPTION;

Flushing privileges


sudo apt-get install zip -y

Downloading Latest OwnCloud 10.0.5 Release

shariq@cloud:~$ wget


Moving owncloud directory

shariq@cloud:~$ sudo mv owncloud /var/www/html/

Run the commands below to set the correct permissions for OwnCloud to function

sudo chown -R www-data: /var/www/html/owncloud

shariq@cloud:~$ sudo nano /etc/apache2/sites-available/owncloud.conf

<VirtualHost \*:80>


     DocumentRoot /var/www/html/owncloud


    <Directory /var/www/html/owncloud>

         Options FollowSymlinks

         AllowOverride All

         Require all granted


ErrorLog ${APACHE_LOG_DIR}/vaksonit.com_error.log

CustomLog ${APACHE_LOG_DIR}/own.vaksonit.com_access.log combined


Here we need to check the assign domain and static server if no we need to insert the static ip and domain

shariq@cloud:/var/www/html/owncloud/config$ sudo nano config.php


$CONFIG = array (

  ‘instanceid’ => ‘oci18uoxqwr6’,

  ‘passwordsalt’ => ‘4GO6x7T72kSybOrLKlfgfAPH9CPAV/’,

  ‘secret’ => ‘FpO+S1x1Ekm0/4xTSnyOCXilSOyMwQIT6iXjpAIfj8mqB0’,

  ‘trusted_domains’ =>

  array (

          0 => ‘’,

          1 => ‘’,


  ‘datadirectory’ => ‘/var/www/html/owncloud/data’,

  ‘overwrite.cli.url’ => ‘’,

  ‘dbtype’ => ‘mysql’,

  ‘version’ => ‘’,

  ‘dbname’ => ‘owncloud’,

  ‘dbhost’ => ‘localhost’,

  ‘dbtableprefix’ => ‘oc_’,

  ‘mysql.utf8mb4’ => true,

  ‘dbuser’ => ‘ownclouduser’,

  ‘dbpassword’ => ‘Sharique’,

  ‘installed’ => true,

  ‘theme’ => ”,

  ‘loglevel’ => 2,

  ‘maintenance’ => false,

  ‘mail_from_address’ => ‘admin’,

  ‘mail_smtpmode’ => ‘smtp’,

  ‘mail_sendmailmode’ => ‘smtp’,

  ‘mail_domain’ => ‘’,

  ‘mail_smtphost’ => ‘’,

  ‘mail_smtpport’ => ’25’,

  ‘logtimezone’ => ‘UTC’,

  ‘apps_paths’ =>

  array (

    0 =>

    array (

      ‘path’ => ‘/var/www/html/owncloud/apps’,

      ‘url’ => ‘/apps’,

      ‘writable’ => false,


    1 =>

    array (

      ‘path’ => ‘/var/www/html/owncloud/apps-external’,

      ‘url’ => ‘/apps-external’,

      ‘writable’ => true,



  ‘installed’ => true,


After that

Create a file in your home directory

shariq@cloud:~/html$ sudo vi index.htm

PHP and Mysql Version

So now start your browser

Type static ip or your mention domain including with port

Owncloud landing page

After the login

Admin profile

List of users

One thought on “Installation OwnCloud on Ubuntu 18.04 / CentOS 8

  • August 21, 2022 at 7:33 pm

    Nice read, I just passed this onto a friend who was doing a little research on that. And he actually bought me lunch as I found it for him smile Thus let me rephrase that: Thank you for lunch!


Leave a Reply

Your email address will not be published. Required fields are marked *