- Log into the Debian device
- Run the following commands in a terminal:
# update repositories and install any available software updates
sudo apt-get update
sudo apt-get upgrade
# install Apache HTTPD and MySQL
sudo apt-get install apache2 mariadb-server mariadb-client
# install PHP components
sudo apt-get install php7.3 libapache2-mod-php7.3 php7.3-curl php7.3-intl php7.3-json php7.3-gd php7.3-mbstring php7.3-mysql php7.3-xml php7.3-zip
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the Owncloud database and database user
MariaDB [(none)]> CREATE DATABASE ownclouddb;
MariaDB [(none)]> GRANT ALL ON ownclouddb.* to 'ownclouduser'@'localhost' IDENTIFIED BY 'ownCl0ud!!';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
exit - Continue with the following commands to download and extract Owncloud in the Apache webroot
# download latest owncloud version
sudo wget https://download.owncloud.org/community/owncloud-latest.tar.bz2
# extract owncloud-latest.tar.bz2
sudo mkdir /var/www/owncloud
sudo tar -xvf owncloud-latest.tar.bz2 --directory /var/www
# set the owner of the new owncloud directory to www-data
sudo chown -R www-data:www-data /var/www/owncloud
# create a new owncloud.conf file to configure the site
sudo nano /etc/apache2/sites-available/owncloud.conf - Paste the following configuration into owncloud.conf
Alias /owncloud "/var/www/owncloud/"
<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory> - Press CTRL+O, Enter, CTRL+X to write the changes to owncloud.conf
- Continue with the following commands to enable the site and restart Apache:
# enable the Ownload site and required PHP modules
sudo a2ensite owncloud
sudo a2enmod rewrite headers env mime unique_id dav
# restart apache2 service for the changes to take effect
sudo systemctl restart apache2 - Open a web browser and navigate to http://DNSorIP/owncloud
- The Owncloud setup screen should be displayed
- Enter a username and password
- Click the storage & database link to expand the section
- Select MySQL and fill out the database connetion information as follows
username: ownclouduser
password: ownCl0ud!!
database name: ownclouddb
database host: localhost - Click Finish Setup
- After a few moments of setup Owncloud will be up and running