You install ownCloud on Windows by leveraging WSL (Windows Subsystem for Linux) 2 with Ubuntu, creating your own private file sync and share solution.
ownCloud is a powerful, open-source platform enabling you to manage and share files, much like Dropbox or Google Drive, but with complete control over your data.
WSL 2 integrates a Linux environment directly into Windows, offering enhanced performance over WSL 1 for your ownCloud server.
This guide shows you how to set up your private cloud using this efficient combination, perfect for users who want to own their data. You’ll need a Windows PC with adequate disk space for both the Ubuntu environment and your synced files.
Enable WSL and Virtual Machine Platform in Windows PowerShell, then install Ubuntu from the Microsoft Store. After setting up your Linux username and password, install Apache and MariaDB using apt commands in the Ubuntu terminal.
Step 1Turn On WSL in Windows
Turning on the Windows Subsystem for Linux, or WSL, is the first step to install ownCloud on Windows.
First, open PowerShell as an administrator (this means you’ll have elevated permissions to run system commands). Click the Start button, type “PowerShell,” then right-click on “Windows PowerShell” and select “Run as administrator.”
Copy and paste this command into PowerShell:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
What happens: Windows will enable WSL. You should see a message saying “The operation completed successfully.”
Step 2Enable Virtual Machine Platform
Enabling the Virtual Machine Platform is necessary for WSL 2 to function correctly on your Windows computer.
Keep PowerShell open and run this command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Note: If you’re using an older version of Windows 10 (before version 2004), use this command instead:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
What happens next: After running the command, restart your computer. This is important or the next step won’t work.
After your computer restarts, open PowerShell as administrator again and run this command:
wsl --set-default-version 2
What this does: It sets WSL 2 as your default version.
Step 3Install Ubuntu on Windows
Installing Ubuntu on Windows gives you the Linux system needed to install ownCloud using WSL.
Open this link to download Ubuntu from the Windows Store:
Get Ubuntu 20.04 LTS – Microsoft Store
What is Ubuntu? It’s a free Linux operating system. Ubuntu 20.04 LTS gives you access to the Linux terminal, along with tools like bash, ssh, and git.

Click “Get” to install it. Once installed, launch Ubuntu.
What happens: Ubuntu will ask you to create a username and password. This is your Linux account (it doesn’t have to match your Windows username).
Example:
Enter new UNIX username: user
New password: (type your password)
Retype new password: (type it again)
passwd: password updated successfully
If you run into problems: Try these troubleshooting commands:
wsl --set-default-version 1
bcdedit /set hypervisorlaunchtype auto start
Step 4Install Apache Web Server
Installing the Apache web server is a key step to get ownCloud running on your WSL setup.
In your Ubuntu terminal, run these commands:
sudo apt update
sudo apt install apache2
Flag: These commands require admin privileges (which means you’ll need to use `sudo` to run them).
Useful Apache commands:
sudo service apache2 stop (stops Apache)
sudo service apache2 start (starts Apache)
sudo service apache2 restart (restarts Apache)
Test if Apache works: Open your web browser and go to:
http://localhost
What you should see: The Apache test page appears. This means Apache is working.

Step 5Install MariaDB Database
MariaDB is the database system ownCloud uses to store your files and settings, and we’ll install it on your WSL setup now.
To install it, run these commands:
sudo apt-get install mariadb-server mariadb-client
Flag: These commands require admin privileges.
Useful MariaDB commands:
sudo service mysql stop (stops the database)
sudo service mysql start (starts the database)
sudo service mysql restart (restarts the database)
Secure your database: Now protect your database with a password by running:
sudo mysql_secure_installation
Flag: These commands require admin privileges.
Answer the questions like this:
Enter current password for root (press Enter): (just press Enter)
Set root password? [Y/n]: Y
New password: (type a strong password)
Re-enter new password: (type it again)
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
Test MariaDB: Log in to see if it works:
sudo mysql -u root -p
Type your root password when asked. You should see the MariaDB prompt if everything works.
Type EXIT; to exit.
Step 6Install PHP
Installing PHP on your WSL system is crucial because it’s the programming language that connects all the parts for ownCloud.
Run this command to install PHP and all the extra parts ownCloud needs:
sudo apt install php libapache2-mod-php php-imagick php-imap php-json php-ldap php-common php-pgsql php-ssh2 php-sqlite3 php-xml php-mysql php-gmp php-curl php-intl php7.4-mbstring php-xmlrpc php-gd php-xml php-cli php-zip
Flag: This command requires admin privileges.
Check if PHP installed correctly: Run this command:
php -v
What you should see: The PHP version number and details. If you see this, PHP is working.
Test PHP with a test page: Create a test file:
sudo nano /var/www/html/phpinfo.php
Copy and paste this into the file:
<?php phpinfo( ); ?>
Save the file by pressing Ctrl+X, then Y, then Enter.
Now restart Apache:
sudo service apache2 restart
Open your browser and go to:
http://localhost/phpinfo.php
What you should see: A page showing all your PHP information and installed modules.

Step 7Create the ownCloud Database
Creating a dedicated database and user for ownCloud within MariaDB is a necessary step before you install ownCloud on WSL.
Log into MariaDB:
sudo mysql -u root -p
Type your root password.
Create a new database for ownCloud:
CREATE DATABASE owncloud;
Create a user for ownCloud (replace “new_password_here” with a real password):
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'new_password_here';
Give this user permission to use the ownCloud database:
GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost' WITH GRANT OPTION;
Save and exit:
FLUSH PRIVILEGES;
EXIT;
Step 8Download ownCloud
Downloading the ownCloud software and placing it in the correct directory on your WSL system is the next step.
First, check ownCloud download page to see if there’s a newer version than the one used in this guide.
Download ownCloud:
wget https://download.owncloud.org/community/owncloud-complete-20210326.zip -P /tmp
sudo unzip /tmp/owncloud-complete-20210326.zip -d /var/www
Flag: These commands require admin privileges.
Set the correct permissions so ownCloud works properly:
sudo chown -R www-data:www-data /var/www/owncloud/
sudo chmod -R 755 /var/www/owncloud/
Flag: These commands require admin privileges.
Step 9Configure Apache for ownCloud
Configuring Apache for ownCloud involves creating a specific configuration file within your WSL setup so it knows how to serve your files.
Create a new configuration file:
sudo nano /etc/apache2/sites-available/owncloud.conf
Flag: This command requires admin privileges.
Copy and paste this into the file. Replace “example.com” with your real domain name or IP address:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/owncloud/
ServerName example.com
ServerAlias www.example.com
Alias /owncloud "/var/www/owncloud/"
<Directory /var/www/owncloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file.
Enable ownCloud and required Apache features:
sudo a2ensite owncloud.conf
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime
Flag: These commands require admin privileges.
Restart Apache to apply the changes:
sudo service apache2 restart
Step 10Finish Setting Up ownCloud
Finishing the ownCloud setup is done through your web browser, where you’ll connect it to the database you created in WSL.
Open your web browser and go to (replace with your IP or domain):
http://example.com
What you’ll see: The ownCloud setup page.

What to do:
- Create an admin username and password
- Enter the database details (username: ownclouduser, password: the one you created earlier, database name: owncloud)
- Click “Finish Setup”
Log in with your admin account and start using your cloud!

Summary
You’ve now learned how to install ownCloud on Windows using WSL, setting up your own personal file storage system.
Troubleshooting: If something doesn’t work, check that all the steps were completed in order. Make sure you ran all commands with admin privileges (sudo). If you still have problems, use the comment form below.
Was this guide helpful?
100% of readers found this helpful (1 votes)
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!