ownCloud on Windows WSL is a private file hosting server that runs right on your Windows 10 or Windows 11 PC without a separate machine. It uses Windows Subsystem for Linux version 2 (WSL 2) to host your files locally so you keep complete control over your data instead of renting space on a company server.
This setup gives you free, unlimited storage that only depends on your computer’s hard drive size, with no monthly subscription fees. You can access your documents, photos, and music from anywhere while keeping every file safely stored at home.
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
Windows Subsystem for Linux (WSL) lets your Windows computer run Linux programs. To install ownCloud on Windows using WSL, turn on this feature first by opening PowerShell as an administrator and running the deployment image servicing and management command. This enables the core environment needed to host your ownCloud server directly inside Windows without needing a separate physical machine.
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
Virtual Machine Platform is a required Windows feature that lets WSL 2 run virtualized Linux kernels. Keep your PowerShell window open and run the deployment image command to turn on this platform. This step is crucial for WSL 2 functionality and ensures your ownCloud server runs with the proper system architecture and performance. Keep PowerShell open and run this command:dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Note: If you use an older Windows 10 version (before 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 will fail.
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
Ubuntu is a free Linux operating system that provides the exact environment needed to run ownCloud on your PC. Go to the Microsoft Store, search for Ubuntu, and click get to download it. This gives you a working terminal to complete the rest of the ownCloud server installation steps. Open this link to download Ubuntu from the Windows Store: Get Ubuntu 20.04 LTS – Microsoft Store What is Ubuntu? It is a free Linux operating system. Ubuntu 20.04 LTS provides access to the Linux terminal and tools like bash, ssh, and git.
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
Apache web server handles incoming web traffic for your ownCloud installation in WSL. Open your Ubuntu terminal and run the apt update and apt install commands using administrator privileges. These commands download and set up the web server so your browser can load the ownCloud interface properly. In your Ubuntu terminal, run these commands:sudo apt update
sudo apt install apache2
Flag: These commands require admin privileges (which means you 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 a database management system that stores all your files, user accounts, and settings for ownCloud. Run the apt-get install command in your Ubuntu terminal with administrator privileges to set up the database server. This ensures your ownCloud instance has a secure place to save user data and system configurations. 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: Protect your database by setting a password with this command:
sudo mysql_secure_installation
Flag: These commands require admin privileges.
Answer the questions like this:
Enter current password for root (press Enter): (press the Enter key)
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
You will be prompted to type your root password. Seeing the MariaDB prompt means everything is working.
Type EXIT; to exit.
Step 6Install PHP
PHP is a scripting language that connects your web server, database, and ownCloud application. Run the apt install command in your Ubuntu terminal along with the required PHP modules to set up everything ownCloud needs to run smoothly. This enables the server to process code and render the file sharing platform correctly. 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: You will see the PHP version number and details confirming that PHP is active.
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
MariaDB requires a dedicated database and user account before ownCloud can store any information. Log into MariaDB using your root password and run the create database and create user SQL commands to set up the storage space. This gives ownCloud secure, isolated access to save its tables and records. Log into MariaDB:sudo mysql -u root -p
You will be prompted to 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 package gets the core application files onto your WSL system. Check the official ownCloud download page for the latest version link, then use the wget command to download the zip file and the unzip command to place it in the web directory. This puts all application files where Apache can read them. First, check ownCloud download page to see if there is 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 can work 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
Apache configuration files tell the web server how to direct traffic and display your ownCloud files. Use the nano command in your terminal to create a new site configuration file in the sites-available directory, then paste your server settings inside. This links the web server directly to your downloaded ownCloud directory. 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 actual 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
Web-based setup finalizes your ownCloud installation by connecting the application files to your MariaDB database. Open your web browser, enter your server IP address, and fill out the admin account details along with your database credentials. This completes the installation and opens your new personal file storage dashboard. Open your web browser and go to (replace with your IP or domain):http://example.com
What you will see: The ownCloud setup page.

- Create an admin username and password
- Enter the database details (username: ownclouduser, password: the one you created earlier, database name: owncloud)
- Click “Finish Setup”

Summary
Installing ownCloud on Windows using WSL gives you a fully functional personal file storage server running locally on your computer. If something does not work, double-check that you followed all steps in order and ran commands requiring administrator privileges using sudo. This ensures all web services, databases, and configuration files communicate properly. Troubleshooting: If something does not 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!