What is OwnCloud?
OwnCloud is a suite of client-server software for creating file hosting services and using them. OwnCloud is functionally very similar to the widely used Dropbox, with the primary functional difference being that OwnCloud is free and open-source, and thereby allowing anyone to install and operate it without charge on a private server. -https://en.wikipedia.org/wiki/OwnCloud
Installing WSL
- Launch Powershell as administrator
- Run the following command
# enable WSL feature
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# enable virtual machine platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all - Type Y to reboot the system
- Launch Powershell as administrator and run the following additional commands to use WSL 2
# enable virtualization platform
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
# enable wsl2
wsl --set-default-version 2
# download the wsl kernel update
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile .\wsl_update_x64.msi
# reset progress preference
$ProgressPreference = 'Continue'
# install the downloaded file
.\wsl_update_x64.msi - Click the Start Button > Search Microsoft Store > Select Microsoft Store
- Search for the Linux distribution to install (Debian, Ubuntu, etc), Debian in this example
- Select the Linux distribution and click the Get button
- After the Linux distribution downloads and installs, click Open or select the distribution from the Start menu to launch it
- Input a username and password to be used in the Linux environment
Installing ownCloud
- Continue with the following commands in WSL
# update software repositories
sudo apt update
# install software updates
sudo apt upgrade -y
# install prerequisite package(s)
sudo apt install wget -y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb-server mariadb-client -y
# install PHP components
sudo apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline php7.4-intl php7.4-json php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-zip php7.4-curl -y
# start the mariadb service
sudo service mariadb start
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type N and press Enter to not switch to socket authentication
- 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
CREATE DATABASE ownclouddb;
GRANT ALL ON ownclouddb.* to 'owncloud_rw'@'localhost' IDENTIFIED BY 'ownCl0ud!!';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands to download and extract ownCloud in the Apache webroot
# download latest owncloud version
sudo wget -O /tmp/owncloud.tar.bz2 https://download.owncloud.com/server/stable/owncloud-latest.tar.bz2
# extract owncloud-latest.tar.bz2
sudo tar -xf /tmp/owncloud.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 owncloud config
sudo a2ensite owncloud
# enable required apache modules
sudo a2enmod rewrite headers env mime unique_id dav
# restart apache2 service for the changes to take effect
sudo service apache2 restart - 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 connection information as follows
username: owncloud_rw
password: ownCl0ud!!
database name: ownclouddb
database host: localhost - Click Finish Setup
- After a few moments of setup ownCloud will be up and running
- Login with the username and password set on the previous screen
- Welcome to ownCloud running on WSL